(Untitled)

Nov 10, 2009 23:19

Initial reactions to the new Go programming language (not that I plan to do much systems programming ( Read more... )

Leave a comment

firegoblin November 11 2009, 14:19:03 UTC
Yesterday I started a project with Python and discovered that there the newline is the end-of-statement marker. *right pinky cries for lack of semicolons*

Reply

big_bad_al November 11 2009, 17:16:08 UTC
Really? I far prefer Python's lack of semicolons. It's obvious to people where statements end, and it ought to be obvious to the parser as well.

Reply

firegoblin November 11 2009, 17:58:47 UTC
It doesn't bother me conceptually, I'm just going to have to retrain my pinky.

Reply

avani November 11 2009, 17:35:19 UTC
I remember thinking it was a little wierd for a few hours, but it grows on you very quickly, and now, a few years later, I find languages that use other delimiters unnatural. Also, I believe you can still put semi-colons in if you choose and the parser will just ignore them (just tried it; seems to work on basic examples).

I highly recommend setting your indentation level to something small so you don't end up out of screen real estate 3 levels in. The only mildly annoying bit about python using newline is that you may have to do some creative line-breaking to avoid hitting 80 char, if you care about that sort of thing.

Reply

derakon November 11 2009, 20:03:46 UTC
You can generally enclose things in parens if you need to insert newlines. "if (foo and bar)" is equivalent to "if foo and bar" except in the former you can slap a newline in anywhere between the two parens. You can also stick a \ at the end of the line to continue the statement on the next line.

Reply

avani November 11 2009, 22:13:12 UTC
I know. It's still creative + a pain to make it pretty, esp. when you're working under style guidelines. Since python is very much a "glance and see what it does" language, it's doubly important that any code produced look pretty and readable. It's not really a complain. I love that I can get away working only in Python (with occasional Bash).

Reply


Leave a comment

Up