Hello list,

A few weeks ago I had a conversation with a programmer friend of mine
about solving problems. I tend to use J alot now (but do have
experience in several imperative programming languages) , and my
friend is a c/c++ coder all the way.

I stated to him that I had just solved another Project Euler, by using
J and pasted the J code for him to see, even though I know for a fact
he wont read the - in his own words - "gibberish" text that was
presented infront of him. To my suprise, he said that J was "cheating"

I obviously defended his statement and asked how could J be cheating,
and his response was that J was using pre-made algorithms.

So it is true that J has some brilliant pre-built verbs, such as  1 p:
y   and   q: y   which greatly helps with some of the problems I tend
to solve, but I still wouldn't class it as "cheating"

My counter argument was that when he writes his own prime check
function, he will re-use that same code in all his projects,
essentially using a pre-built algorithm.
Here is a snippet of our conversation

Ian:    I just solved 187
Steve:  in J?
Ian:    yea
Steve:  J is cheating in my opinion
Steve:  because your using pre-made algorithms
Ian:    when you write a prime class, do you re-use it everytime?
Steve:  when *I* write a prime-class
Steve:  not when J writes the class for you
Ian:    no difference, I could write one up if I wanted too, like I have
many of times. But there is no point in importing mine when its an
exact copy of the existing one
Steve:  that's called stealing, lol
Ian:    you could say the same as sqrt
Ian:    you use a pre-made sqrt function
Ian:    or you could write your own
Ian:    but you wont
Steve:  I have in the past
Ian:    yes I know, but I bet you don't use it
Ian:    for example, if I want to sqrt in J, i would type %: 50.... you
would type math.sqrt(50); or whatever
Ian:    we both using pre-existing functions

By his definition of "cheating", everybody will "cheat" unless they
completely write their code in assembly, where there is no such thing
as sqrt, is_prime etc (that I know of anyway)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to