New project, "Code to Code"
Marc Lanctot
lanctot-yfeSBMgouQgsA/PxXw9srA at public.gmane.org
Wed Dec 17 20:33:42 UTC 2008
Christopher Browne wrote:
>> Honestly, how many languages differ in the semantics and expected usage of a
>> for loop? It's not like someone trying to learn a completely different
>> programming paradigm would cross between paradigms (eg. imperative to
>> functional programming) .. that's just not what the tool is meant to
>> accomplish.
>>
>> And, even if someone would do something like this, there should be user
>> contributed notes attached to each translation.. following my example "Note:
>> In LISP a better way to do a for loop is to do <<insert crazy recursive
>> functional construct>>".
>
> Actually, let me poke at this one a bit...
I knew I should not have mentioned LISP. My instinct told me not to and
I didn't listen. Bad Marc :)
I am snipping out your examples but they are good examples. I certainly
agree that LISP (functional programming in general) allows you to think
about what you're trying to do and express it in a better way than
imperative programming typically does. As to whether that is a good or
bad thing in general, IMO, it depends on your application. I've gotten
into this argument before and I certainly don't want to again (and I'm
not sure it's relevant anyway, see below). Suffice to say that I agree
with you on the surface level about LISP allowing you to represent your
intentions better.
>> Are you implying that a for loop is a bad habit in any language? :) A
>> programmer's style comes from the programmer, not his/her reference tools.
>
> I think that *numeric* for loops indeed are frequently a bad habit.
>
> This is the difference between looking at a computer as a "number
> processor" and a "symbol processor." We often get sucked into
> thinking the former, when the latter is a much more accurate way of
> looking at things, and is sometimes more convenient, to boot.
I don't see why what you call "numeric for loops" to be bad. In some
cases you just have to do it. Why would we want to prevent anybody from
being able to return a sum of a set of numbers? There are perfectly
legitimate reasons to do this. If your argument is that the /language/
shouldn't allow you do do this by using for loops because it's better to
think of it as a something different, then I think you're saying that
you have something against the syntax/semantics of the language.
Either way, the existence of the reference tool is orthogonal to this
discussion (I hope you agree). If you mean that people should not be
using numeric for loops in certain cases and that it is a bad thing,
then my point is that having Code-to-Code out there will not encourage
bad programming for people who are already bad programmers. Bad
Programmers encourage bad programming. A reference tool for programmers
to save time can only be a good thing... bad programmers exist and will
continue to exist regardless of the tools that exist to help the good
programmers. And, a reference tool that helps good programmers should
not be considered harmful just because bad programmers exist.
Marc
--
What a season to be beautiful without a reason.
-- The White Stripes
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list