Close-block Delimiter Symbols Considered Helpful

Sep 10, 2006 18:50

I've decided to start posting some of my thoughts about programming languages and software development tools. Since I so love to bitch and moan, I'll motivate myself by starting off with a complaint about the language I use every day at work, Python. ( And so, donning my asbestos smoking jacket, I wax philosophical about syntax: )

nerdiness, programming languages, python

Leave a comment

Comments 7

the_macnab September 11 2006, 16:43:00 UTC
Given that your wrists apparently leak boiling pitch whenever you type, this seems like a labor of love (or spleen, perhaps). You're right, though. The more I've fiddled with python, and with languages that use block-delimiters, the more sympathetic I've become to the homely {} combo. It doesn't affect my life as often as it does yours, but I could see where it'd become maddening fast.

Reply

confuseme September 11 2006, 18:29:29 UTC
Never attribute to love that which is adequately explained by obsessive-compulsive disorder.

Reply

the_macnab September 11 2006, 18:34:24 UTC
There's a difference? Shit, The Girl's gonna be pissed when she finds THIS out...

Reply


inhumandecency September 11 2006, 18:35:44 UTC
There is one advantage to enforcing indentation: it forced bad programmers to write code that's properly organized and easy to read. (well, better than if they didn't have to indent, anyway). It also requires newbies to learn good habits from the start -- which I can appreciate, since I've experienced python as a language someone who's almost totally ignorant can pick up and start using.

That said, I don't understand why they don't also use explicit delimiters. It may be theoretically redundant, but I agree with you -- there are too many whitespace-eating display methods, and too many ways to screw up your own indentation, to be purist about it.

Reply


allea September 11 2006, 20:44:18 UTC
Wow...I miss listening to you rant. I always learn things.

Thanks.

Reply


pass will do anonymous January 24 2008, 00:52:58 UTC
Brilliant article.

I've been looking for some way to add delimiters in python. Writing a parser seems a bit excessive and since I can't find any on the web I think I'm just going to use "pass" as a close-block delimiter.

def blabla(self):
dosomework
pass

It does look a bit weird but it doesn't use much more space than "}" and after a while I'll probably get used to it. At least, next time someone messes up my code/indentation with some exotic editor I'll be able to see where blocks actually end :)

Now, if only python could force me to do this...

I've always felt strongly about this but I wasn't exactly sure why. Thanks for describing this in details and in a very clear way.

Clem

Reply


oxy hydrogen generator anonymous February 18 2011, 10:31:07 UTC
pretty valuable stuff, overall I imagine this is worthy of a bookmark, thanks

Reply


Leave a comment

Up