Live data from Hacker News

I don't like Python. Does that make me a bad person?

news.ycombinator.com

11–20 of 231 posts

Re: I don't like Python. Does that make me a bad person?

#11

I hate Python too, only because of its insistence on indentation and because of its verboseness relative to, say, Perl. I'm not against the non-Perl philosophy of There Is Only One Way To Do It, but for God's sake, don't insist on indentation! I am under a personal vow that until Python lifts its indentation requirement (say, via a command-line switch), I'm no way using this language for my programming needs.

First, to the topic question, I'm not qualified by your criteria to answer the question, but I'll say anyway that I prefer doing video game programming in Python for 99% of the tasks that come up compared to C++. (For example, the PyGame wrapper for SDL just feels a lot better than the C++ interface, plus it adds some nice features.) My own take on mental models can be simplified with the example of strings. In Python, I can think of a string as a string, or a word, or a sentence, or an iterable list of characters. In C, I can't ever forget that it's all pointers. Python lets me think at higher abstractions more readily from looking at code. Plus I really love dynamic duck typing.

And to the parent: I really hate to be "that guy", but can you give me an example where non-indented code looks better than indented code (since all your complaint really is about is style rather than what Python can help you do)? If it's just braces you're after, Python "supports" those by just commenting them out. When I first learned Python years back I was coming from a PHP and some Java background, and my code was sometimes single-space-indented, sometimes not indented at all, and it was hideous. After I realized I should be indenting anyway, Python made a lot of sense, all these languages with braces or 'end's everywhere didn't, and I can't think of any case I've ever thought "Man, I wish I didn't have to indent here." The one thing I can say I don't exactly like about Python now is the occasional self-hell.

Re: I don't like Python. Does that make me a bad person?

#12
Before I ever encountered Python, I'd gotten pretty familiar with a wider variety of languages than C, C++, and Java.

So if you don't have to learn Python right now, maybe you should first learn Lisp, Haskell, or whatever else you want or need to learn that isn't much like C/C++/Java. I think you'll have more fun this way. :-)

Re: I don't like Python. Does that make me a bad person?

#14

I hate Python too, only because of its insistence on indentation and because of its verboseness relative to, say, Perl. I'm not against the non-Perl philosophy of There Is Only One Way To Do It, but for God's sake, don't insist on indentation! I am under a personal vow that until Python lifts its indentation requirement (say, via a command-line switch), I'm no way using this language for my programming needs.

The only reason I have had lately to get annoyed at Python is when one of the guys I'm working with on a project was using an editor where the tabspacing wasn't set correctly. That meant anything that he changed/added led to the script not working. Even though this was an easy change (=G in vim), it's still annoying to think that such a minor issue would completely kill the script.

Of course I prefer Ruby, but that's a whole other can of worms :)

Re: I don't like Python. Does that make me a bad person?

#15
post #4

Yesterday there was an interesting link on HN comparing NLP in Python vs. other languages: http://nltk.googlecode.com/svn/trunk/doc/howto/nlp-python.ht... . I think this article shows the clearness of the Python language - - and this clearness and simplicity is the reason why I love to code in Python.

This is the main draw for me. Compared to Python, other languages (well, some) seem to require you to do so many things that just seem... unnecessary.

I couldn't believe all the junk Java required of me when I took a stab at it. It's like being confronted with some unhelpful bureaucrat: I know what I mean, they know what I mean, but they're damn well going to make me trudge through all the nonsense so that what I mean is turned into something the bureaucracy understands. The linked NLP examples are great for illustrating this.

Re: I don't like Python. Does that make me a bad person?

#16
post #11

I hate Python too, only because of its insistence on indentation and because of its verboseness relative to, say, Perl. I'm not against the non-Perl philosophy of There Is Only One Way To Do It, but for God's sake, don't insist on indentation! I am under a personal vow that until Python lifts its indentation requirement (say, via a command-line switch), I'm no way using this language for my programming needs.

First, to the topic question, I'm not qualified by your criteria to answer the question, but I'll say anyway that I prefer doing video game programming in Python for 99% of the tasks that come up compared to C++. (For example, the PyGame wrapper for SDL just feels a lot better than the C++ interface, plus it adds some nice features.) My own take on mental models can be simplified with the example of strings. In Pytho…

Sometimes I have trouble when breaking looong lines of Python code in multiple lines ... like for example when I have method chaining. I don't like long lines of code, it makes the code unreadable.

Of course, most situations can be solved by a backslash-enter, and simple statements can be separated by ; but there are places where I wished for more flexibility.

This is only about readability, and overall Python code tends to be more readable than in other languages, although I've read beautifully written code in Java or Perl or C++, and the readability really depends a lot on the programmer writing it.

I think the major problem is the lack of focus in high-school / college on such things ... quite the contrary, many teachers are usually disconnected from real-world projects and don't have this skill themselves.

Re: I don't like Python. Does that make me a bad person?

#17
Preference for languages can take into account everything from the syntax to the libraries to the community. It's not surprising when someone has strong opinions about them. The problem is when people get precious, but you seem to be straight up about it. And with C and C++ you certainly won't suffer because you aren't a Python guy.

Re: I don't like Python. Does that make me a bad person?

#18

I hate Python too, only because of its insistence on indentation and because of its verboseness relative to, say, Perl. I'm not against the non-Perl philosophy of There Is Only One Way To Do It, but for God's sake, don't insist on indentation! I am under a personal vow that until Python lifts its indentation requirement (say, via a command-line switch), I'm no way using this language for my programming needs.

The indentation is not a big deal at all. You indent your code anyway, right? Python doesn't enforce a specific standard, you can indent however you want, just as long as you use the same units of indentation consistently.

The only time I've had a problem with indentation is while copy-pasting things, occasionally that can get messed up and be annoying. Everything else is fine.

Post reply on HN