6 ms·
I know, I know, what I'm about to say is just an artifact of the Language Wars and will cost me karma. I can't help myself. We should not be teaching impressio
by area51org 12y ago
I know, I know, what I'm about to say is just an artifact of the Language Wars and will cost me karma. I can't help myself.
We should not be teaching impressionable students that whitespace has semantic significance. This is a fundamental design flaw of Python, and it's just a Bad Idea.
Sorry, Guido.
- chillingeffect 12y agoIagree100%.Therereallyisnoreasontoattributetheattributeofseman ticallysignificanttowhitepsace.Justasineverydaylanguage,comput erprogrammersshouldhavethefreedomtonotusewhitespaceastheyseefi t,justasmusicshouldnothaverests;it'sonlythenotesthathavemeanin g.Finally,gentlepeople,Iimploreyouthatwallsinhousesshouldbemad einfinitesimallythin,too,becauseIseenoneedtoseparateanything.
- Doctor_Fegg 12y agoPlease don't break everyone's formatting by writing something quite so long that won't wrap. Thanks.
- McP 12y agoCan someone delete this comment please? I'd like to read the other comments here but this one means I've got to scroll back and forth for each line :(
- NinjaViking 12y agoFor a temporary solution, try right-clicking on it, select "inspect element" or something to that effect and deleting the text.
- Rynant 12y agoI use a bookmarklet that comes in handy in cases like this: javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3B%3B%24('*').on("contextmenu"%2C function(evt) %7Bevt.preventDefault()%3B%7D)%3B%24('*').mousedown(function(evt)%7Bif(evt.which%3D%3D%3D3)%7Bevt.srcElement.remove()%3B%7D%7D)%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)() After clicking the bookmarklet, you can right-click on any element to remove it.
- VexXtreme 12y agoYou know what man, FUCK YOU. You broke the layout of the discussion for everyone and it's next to impossible to follow the conversation without a ton of horizontal scrolling. Take your trolling elsewhere, it's not welcome here.
- dang 12y agoWhoa, please don't. This comment would be fine if it were just the second sentence.
- gpvos 12y agoPeople, if you install a comment collapser like the greasemonkey script on this page, you can hide the above post. http://alexander.kirk.at/2010/02/16/collapsible-threads-for-hacker-news/ http://alexander.kirk.at/2010/02/16/collapsible-threads-for-...
- rectangletangle 12y agoI happen to like this comment, it gets the point across.
- __david__ 12y ago> This is a fundamental design flaw of Python, and it's just a Bad Idea. That sounds like a gut reaction and not a reasoned argument. I was skeptical of it at first, but after coding some Python I decided all my reasons for hating it weren't valid. Turns out it's very practical and makes the code prettier. I don't like the language for other reasons, but the significant whitespace never gave me any problems, headaches, or weird spurious bugs. The only negative thing about it for me was that hitting TAB in Emacs doesn't indent to the "proper" place (since it's impossible to actually determine the proper place). Instead, it would alternate amongst the valid tab points from most likely to least, which felt like a reasonable compromise to me. Interestingly, I never hear anyone whine about Haskell's use of significant whitespace…
- e12e 12y agoI was bit by haskell's whitespace - but I think that was connected to a bug with the do-notation or some such syntactic sugar. In general I think significant whitespace is a great way to deliniate blocks
- toyg 12y agoI guess you agree that "impressionable students" should be taught that collaboration is essential, hence clear formatting is necessary and precise indentation (aka whitespace) is critical. However, when a language comes around that actively enforces and promotes these rules... you say it's a "Bad Idea". Could you elaborate on why you think it's so bad?
- 6d0debc071 12y ago> I guess you agree that "impressionable students" should be taught that collaboration is essential, hence clear formatting is necessary and precise indentation (aka whitespace) is critical. Not particularly, no. Or at least I think that should be the IDE's problem.
- toyg 12y ago*> Not particularly, no. Or at least I think that should be the IDE's problem. You still have to tell the IDE what to do with your code, which you do with brackets, I guess? So now your code is full of brackets and parentheses, which are naturally less readable (how many levels of parentheses do you use in natural language?), and their role is almost entirely to... help the IDE indent your code.
- 6d0debc071 12y agoAbout as many carriage returns as I use in natural language. The act of inserting any sort of punctuation seems inherently approximate; an attempt to encode that which is usually transmitted in tone, rhythm, body language. People, even before computers, invented several different types of formal logic notation just so that they'd have a language that was better suited to these sorts of puzzles. I don't think that code is a good approximation of natural language, nor do I think that it should try to be. Natural language is very poorly suited to expressing layers of abstraction, and even basic logical relationships. Of course it's easier to write programs that resemble natural language, just as it's also easier to speak than it is to write Vx[Yx->...etc...] but that doesn't mean it's the best way to look at a problem. # But that's a bit besides the point. You can do it however you like, even with whitespace if that's your preference. The key is that the IDE has to be aware of the meaning of your code. Python's solution to that is to assert by fiat that the white space should be a syntactically meaningful unit in this sense, but it could be anything. If you have the information there, then people can look at it and write it however they please.
- deleted 12y ago[deleted]