3 ms·
It's so refreshing to not see anyone here whining about Python forcing them to indent their code properly. The kind of people who think that's a PROBLEM instead
by DonHopkins 7y ago
It's so refreshing to not see anyone here whining about Python forcing them to indent their code properly. The kind of people who think that's a PROBLEM instead of a FEATURE really should not be ever writing any new code, and instead should be punished by forcing them to maintain other people's code written with that same lazy misguided attitude, until they recognize how self indulgent, inconsiderate, and disrespectful that is not just to other people who have to read their code, but also to themselves.
The same kind of people criticize Lisp for having too many parenthesis, then go on to write unintelligible shell scripts, Perl and C++ code chock full of skewbald menageries of sigils and punctuation bound together with a towering inferno of precedence rules, terribly worse than Lisp's "too many parenthesis".
- johnydepp 7y agoAnd by mentioning it your ruined the pleasant reading.
- kazinator 7y agoThe best, brightest and most informed/experienced people who do not think it is a good idea for significant whitepace to be the determiner of syntactic nesting do not hold that position because they would like to inflict badly formatted code on their maintainers. You've invented a stupendously silly strawman.
- DonHopkins 7y agoThat's a stupendously anonymous appeal to authority you've made there, and it's unclear what argument you're actually saying without some explicit parenthesis around all those deeply nested phrases, or some kind of grammatical diagram. Can you please restate how we disagree in a few simple sentences? Are there any names or links or citations or concrete examples you could add to support your argument and help us respect your authority? Speaking of best, brightest and most informed/experienced people: Have you ever used Dave Winer's outliner based scripting language, "Frontier"? Since the syntax of the scripting language is actually a structured outline, it's impossible to indent your code improperly. It's not that white space is significant, it's that no white space or brackets or begin/end keywords are even necessary, because your code is simply an outline. https://news.ycombinator.com/item?id=20425970 https://news.ycombinator.com/item?id=20425970 After the success of MORE (an outliner and slide renderer for the Mac), he went on to develop a scripting language whose syntax itself (for both code and data) was an outline. Kind of like Lisp with open/close triangles instead of parens! It had one of the most comprehensive implementation of Apple Events client and server support of any Mac application, and was really useful for automating other Mac apps, earlier and in many ways better than AppleScript. https://en.wikipedia.org/wiki/UserLand_Software#Frontier https://en.wikipedia.org/wiki/UserLand_Software#Frontier http://frontier.userland.com/ http://frontier.userland.com/ Then XML came along, and he integrated support for XML into the outliner and programming language, and used Frontier to build "Aretha", "Manila", and "Radio Userland". http://manila.userland.com/ http://manila.userland.com/ http://radio.userland.com/ http://radio.userland.com/ He used Frontier to build a pioneering fully programmable content management system, blogging and podcasting platform, with a dynamic HTTP server, a static HTML generator, structured XML editing, RSS publication and syndication, XML-RPC client and server, OPML import and export, and much more. He basically invented and pioneered outliners, RSS, OPML, XML-RPC, blogging and podcasting along the way. Frontier certainly had its problems, but it was enormously successful. I think it's a good idea to learn from Dave Winer's experiences successfully designing and using practical powerful scripting languages. Dave Winer's second outliner screencast: https://www.youtube.com/watch?v=mgUjis_fUkk https://www.youtube.com/watch?v=mgUjis_fUkk Dave Winer's the many lives of Frontier screencast: https://www.youtube.com/watch?v=MlN-L88KScw https://www.youtube.com/watch?v=MlN-L88KScw Dave Winer on The Open Web, Blogging, Podcasting and More: https://www.youtube.com/watch?v=cLX415mHfX0 https://www.youtube.com/watch?v=cLX415mHfX0 >UserLand's first product release of April 1989 was UserLand IPC, a developer tool for interprocess communication that was intended to evolve into a cross-platform RPC tool. In January 1992 UserLand released version 1.0 of Frontier, a scripting environment for the Macintosh which included an object database and a scripting language named UserTalk. At the time of its original release, Frontier was the only system-level scripting environment for the Macintosh, but Apple was working on its own scripting language, AppleScript, and started bundling it with the MacOS 7 system software. As a consequence, most Macintosh scripting work came to be done in the less powerful, but free, scripting language provided by Apple. >UserLand responded to Applescript by re-positioning Frontier as a Web development environment, distributing the software free of charge with the "Aretha" release of May 1995. In late 1996, Frontier 4.1 had become "an integrated development environment that lends itself to the creation and maintenance of Web sites and management of Web pages sans much busywork," and by the time Frontier 4.2 was released in January 1997, the software was firmly established in the realms of website management and CGI scripting, allowing users to "taste the power of large-scale database publishing with free software." https://en.wikipedia.org/wiki/RSS https://en.wikipedia.org/wiki/RSS https://en.wikipedia.org/wiki/OPML https://en.wikipedia.org/wiki/OPML https://en.wikipedia.org/wiki/XML-RPC https://en.wikipedia.org/wiki/XML-RPC
- ubu7737 7y agoI just don't think Winer should be used as an authority for anything like this. What he pioneered was "just make it work for the user" solutions from a usability perspective, and not from an engineering perspective. Winer part in the XML-RPC and SOAP outcomes was a source of misery for developers in the early part of this century. MORE was neat because it had a place on the Macintosh System 6 platform, when there was literally nothing else of its kind. What did MORE evolve into later? Nothing. Winer has long been an advocate of "the semantic Web", which is a user-focused idea of what's essentially an engineering problem. The semantic Web was/is a dead-end and in its time it led to a great many stupid uses of HTTP. Winer can be celebrated as an advocate for users but not as a great engineer.
- deleted 7y ago[deleted]
- boyobo 7y agoI am a novice programmer who started with python and have recently been using javascript, where I use auto-indent-on-save. Coming back to python is annoying because it's harder to make sure code is at the right indent level than to use { }. In fact writing this comment inspired me to find this: https://github.com/mathialo/bython https://github.com/mathialo/bython
- reallydontask 7y agoMost IDEs have a shortcut to format code. In over 12 years, as mostly a C# developer, I've only seen one person not use the standard indentation style and this was because he was a junior who didn't know that you could format the code with a shortcut. edit: I should point out that it was always rejected at PR time, it just took me a few PRs to realise what the problem was
- shortercode 7y agoI consider it a must that code should be correctly indented, no matter the language. What I have issue with is relying on whitespace to represent scope etc. With .sass files I've had too many occasions where moving the content around between editors has completely borked the file, and without braces it's tedious to correct the indentation. This is mostly the fault of text editors trying to be "smart" about indentation, and failing miserably, but it's a pain I'd rather not exist.
- ben509 7y agoAs much of a fan of Python's syntax as I am, there are real problems with whitespace-sensitive syntax. It's not that it's hard to parse or necessarily to write. The trouble is that generic tooling around text is really bad, especially various websites and chat boards still haven't figured it out. Code is a way to share ideas, which was one of GvR's key insights. People share a ton of code in discussions and such and WSS makes it a bear; even here I have to tediously type in four spaces to share a snippet of Python. > The kind of people who think that's a PROBLEM instead of a FEATURE really should not be ever writing any new code, and instead should be punished by forcing them to maintain other people's code written with that same lazy misguided attitude, until they recognize how self indulgent, inconsiderate, and disrespectful that is not just to other people who have to read their code, but also to themselves. Having gotten worked up like this myself plenty of times, I think you're treating someone doing a bad job as an injustice to you. Unless there's a malign intent, it's simply not. And elevating it to an injustice is creating stress and strife for yourself (which you're venting here) that you don't need.