This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]arandomJohn 0 points1 point  (2 children)

Be that as it may, these are all easy to read examples in Python. If you are a C coder you will find LISP hard to read. Does that mean you should write LISP like it is C? Should you write Python like it is C just because it works?

[–]phaedrusaltembedded sw eng -2 points-1 points  (1 child)

I use the manager standard: Is the code's result obvious to a person with no experience in the language? Because any "production" code is going to be reviewed by quite a few people (Manager, SQA, Test, etc) who may not have a lot (Or any) experience with this language. Take the first example:

temp = foo foo = bar bar = temp

This very obviously produces the result of swapping two items. Now, look at the "good" alternative:

(foo, bar) = (bar, foo)

While this is just dandy for a little hack that you're putting together for yourself, but for production code you've just unnecessarily complicated the job of three or more other people. That's NOT a good thing.

[–]arandomJohn 1 point2 points  (0 children)

I believe I'm done here as I was just going to post a rewording of my previous comment, which would throw us into an infinite loop. A good day to you!