Python-indentation (Was: Re: Is the world coming to an end?)

ulrik.mikaelsson at gmail.com ulrik.mikaelsson at gmail.com
Sat Apr 2 15:18:03 PDT 2011


> PS I don't want to say every of Python's decisions is wrong. Many of them  
> are great (but defenitely not significant intendation).
On a side-note, I thought the same, until I realised I hate redundancies  
even more than I hated forced code-styles. And code-indentation AND  
brackets are clearly redundant, since they pretty much convey the same  
information "block", only one is structural and the other visual.

Nowadays, my complaint on Python-indentation are that they aren't fully  
enforcing a STRICT policy on indentation. Mixed-code indentation in 3d-part  
can cause a lot of unexpected bugs.


Personally, I'd like to see a world where "plain old text" (whatever that  
means, considering all the related encoding and line-ending-problems  
constantly biting us multi-platform non-ASCII-people in the behind) were  
replaced with something just slightly higher-level, such as semantic trees.  
For programming, the notion would be to, instead of storing "text", storing  
the AST of the parsed code, letting the editor render the tree to the  
user's preferences, to create true separation between information (the  
structural code) and visualization (the readable code).

If a standardized format for the serialized tree was used, VCS:es could use  
it to record changes not as "lines changed", but changes in the AST.  
Name-changes would not change entire lines, but just the references to that  
symbol. Wrapping a block of code into an "if-statement" could clearly be  
visualized, instead of appearing like a big chunk of code were COMPLETELY  
rewritten (when in reality it was just indented.)

For other tree structured formats, if nothing else, efficient standardized  
tree-representation could significantly boost performance of some  
protocols. (XML, I'm looking at you)

I know, it's not going to happen, but one can dream?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110402/8604a408/attachment.html>


More information about the Digitalmars-d mailing list