-
Website
http://codefluency.com -
Original page
http://codefluency.com/articles/2008/12/26/revisiting-python/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
John Barnette
1 comment · 1 points
-
Eleo
1 comment · 1 points
-
ReinH
2 comments · 6 points
-
kidbrax
1 comment · 1 points
-
therealadam
1 comment · 1 points
-
-
Popular Threads
http://cbcg.net/2007/04/22/python-up-ruby-down-...
Properties are part of the larger concept of descriptors, which seem to me largely just for designing cleaner APIs.
Generators are very, very easy to use once you understand them. They can be used for implementing event handling, co-routines, infinite sequences, etc.
> if, God forfend, you use _spaces_— someone should shake the crap out of you
Looks like you had a typo in there, fixed.
The contextlib.contextmanager decorator can simplify the implementation of many context managers: http://docs.python.org/library/contextlib.html
I am a Rubyist and I really wonder who complains about this. Do you know any Rubyist blogger who does?
I feel the whole complaining about whitespace sensitivity is brown out of proportion without data-proof of it.
I for example always felt that python code feels very clean that way.
That being said, the need to use : really is annoying. I wonder why the : is needed.
Without : it would be better.
> A good developer is going to indent correctly and consistently anyway.
I agree with you, and see above. However, on a purely aesthetical language, I think the better programming language, the parser, simply should not care at all about the indent, and it should try to run and make things work. This is the year 2009. This is an advanced language.
Why need a parser be so concerned with something as stupid as wrong indents? That is a general question, not one aimed against python.
I feel that a language with indent problems is of suboptimal design, especially when one needs to use : anyway
> If you don’t have a standard way of indenting your code— or if, God forfend, you use _tabs_— someone should shake the crap out of you.
I agree about tabs. I indent with 2 spaces always, and I indent heavily. But again, I think the parser should never care about the
indent... it just feels silly in the year 2009 to have a parser fail due to indent.
> I love my end keyword.
I never loved it. It gets very annoying for multiple ends... would be nicer to be able to omit them. But I dont want to use : all over the
place to end definitions of methods... that would feel wrong too. Two wrongs dont make a right... they keep being two wrongs.
> Lose it, and if you have to re-indent code manually it’s a serious pain in the ass.
Well, maybe we have a language with pseudo-indent, and indent one can choose to have (or not have)
> The fluttering, anchor-less statements of Python rely on a single colon to indicate an upcoming indentation, and that’s not enough
> for my poor eyes.
Agreed.
> It is a bit nice to lose an extra line every time, but I’ll happily refer to it as the Clarity Tax.
Well, I agree too, somewhat. As said, if I could ignore multiple end's, i would happily do so.
But using : is annoying.
Anyway, it really is minor compared to other issues. Whatever language comes, it needs to beat BOTH python and ruby.
With ease.
That is a BIG task for future programmers. They will have to think a lot.
I agree with you about the "self" in Python. This should really have been removed for Python 3. It's just annoying.
Beside this, I think Python has a great feature, especially with stuff like Django and SQLAlchemy.
In practice, I tend to use parenthesis for invocation anyhow, unless there are no parameters or I'm writing in a more fluent, DSL style. I think this is the case for many Ruby developers.