4 ms·
Pythons whitespace usage, for example, makes it DOA for me. I'm not touching it. If it works for you, great. It doesn't work for me. This has to be up there wi
by naner 14y ago
Pythons whitespace usage, for example, makes it DOA for me. I'm not touching it. If it works for you, great. It doesn't work for me.
This has to be up there with people claiming they don't like Lua because array indexing starts at 1 instead of 0. Of all the weaknesses of Python, focusing on something so superficial just seems lazy.
Perhaps in the future just say that you're experienced and comfortable with Ruby and have no reason to investigate Python at the moment. :)
- darkandbrooding 14y agoPython's whitespace-as-logic means that, for any given project, every editor used by every developer needs to have the same the same definition of what a "tab" is, because mixing tabs and spaces can introduce logic errors. You can reasonably argue that a project team should already have and enforce a coding style guide, so specifying a "tab" isn't a big deal. But what if you're part of two separate projects which different coding standards? Do you use Editor A for Project A, and Editor B for Project B? Or do you maintain separate configuration profiles, one for each project? Granted, this also isn't a big deal: Just "git checkout ProjectA" in the directory where you keep your preferences before you start coding. But it is an extra step in your workflow. You can use the "-t" or "-tt" flags to spit warnings or errors if someone mixes tabs and spaces, so any conscientious group can easily catch whitespace incompatibility problems. But Python's whitespace usage has organizational consequences, and it can affect a developer's choice of tools and/or workflow. For some people, this is not a superficial impediment.
- PommeDeTerre 14y agoThis is a non-issue. Just follow PEP 8, which clearly suggests to "Use 4 spaces per indentation level." PEP 8 has been around for over a decade, so there's no excuse for not following its recommendations.
- steveklabnik 14y agoEven Rubyists always use 2 spaces, no tabs, even though whitespace is (mostly) insignificant.
- kamaal 14y agoHaving to follow a indentation spec just to ensure your code runs is too much rigidity to ask of a programmer.
- Daishiman 14y agoNo, not really. All projects involving more than one coder involve coding standards, and practically all languages have a single set of well-defined coding standards(Go, Python, Java, C#, among others). Coding standards are the most time-wasting form of bicycle shedding. Choose one and stick with it. gofmt is fantastic, and so is PEP8.
- michaelwww 14y agoI prefer my white space to not mean anything because I normally can't see it. If I show white space then I see meaningful and non-meaningful white space. I find this aggravating and figure the designer of such a language is a control freak who will likely continue to aggravate me in other stupid ways. I don't need this in my life. I don't know how this disagreement between myself and the language designer seems 'superficial and lazy' to you.
- ubernostrum 14y agoialsoagreewiththisandfindthatshowingwhitespaceisacompletelyunnecessarythingandonlygetsinthewayofhowawesomelysmartiamtobeabletoreadallthecodeiwrotewithoutanywhitespaceinit
- michaelwww 14y agoWe're talking about white space as a source code token, not as used in written verbal languages.
- damncabbage 14y agoYour text is breaking the page. I need to flag this, sorry. (And HN needs something to stop this happening.)
- calinet6 14y agoYou can compare the trivial differences all you want, but the truth is, they are real differences in the way you think about your code and programming. Indexing starting at 1 is not only irritating, it's mathematically difficult. Certain concepts actually can't be described (as easily) with array indices that start at 1. It's not a trivial argument. Similar with white space; having to write code which obeys white space and tab rules is not the way some people like to think. As much as I love Python (and I do), I find it more restrictive and less fun than Ruby. It's not just superficial, it changes the way you think, and what you think about. Of course Python has its advantages, lots of them. But it also has its own style, which may not be everyone's song and dance. I do program in both Python and Ruby frequently, and I have to say that it has nothing to do with experience or comfort, it's truly a judgement, and a valid one at that. Nice try :)
- alexanderh 14y agoI would love to see an example of a large project in another language besides python, that uses frequent cases of non-pythonic indentation. Sure, there are certain edge cases when I wish I could represent something all in one line, or something similar, but they are so few and far between that I really cant see it as a major argument against not wanting to use python. I felt the same way about whitespace at one time, but then I got used to it, and wonder why I ever felt so strongly one way or the other. The cases when my indentation isnt exactly like python in other languages is very rare. If you find yourself using frequent cases of non-pythonic indentation in other languages, you may be writing some very unfriendly/unreadable code in a lot of instances. It may make sense to you, but I wouldnt want to work on the same team.
- kamaal 14y agoThe problem is something like this. There is a cancer patient and he complains of head ache, the family members around give him a Paracetamol 500mg. The family members now also expect that Paracetamol just given will also cure him of cancer apart from curing his headache too. Python people constantly advocating white space indentation as some kind panacea to all programming problems programmers have ever faced is irritating to those people who know it is not and can never be. Also look at what is happening in this thread. This thread is about Ruby, every time some thread on Ruby or Perl is started- You see Python trolls descending all over the thread to push their shiny tool down others throat. I mean this is happening for years now, may be even decades. There is also this quote... "And what defines a 'python activist' anyway? Blowing up Perl installations worldwide?" - Ivan Van Laningham http://mail.python.org/pipermail/python-announce-list/2005-June/004139.html http://mail.python.org/pipermail/python-announce-list/2005-J... That is how notoriously Python people troll on other languages. Trolling on other languages is a irritating thing, sooner or later people figure you have nothing to offer. Instead of doing this and trolling on other languages, may be the Python community should build about something awesome and let people decide if they should use on its merits.