Live data from Hacker News

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

news.ycombinator.com

91–100 of 231 posts

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

#91
post #6

Earlier quoted context omitted.

I've never understood this objection. Do you not indent your code anyway? If so, why should you also need to delineate scopes in another way? Python allows you to choose your indentation, it just requires consistency: something that is always required by coding standards (with good reason). If there was a command line switch, would you use it? Why?

I do indent my code, but I prefer to auto-indent. Using indentation to determine if a line of code falls inside or outside some logic block requires a lot more effort for me. Would much rather just use curly braces. Curly braces also make copying and pasting code blocks much easier.

Whitespace doesn't help you write code. I helps you read code, which is a lot harder writing it, even though it seems like it should be the other way around.

The pain of keeping indentation correct is a forced ongoing investment in readability that is well worth it--at least to me.

I'm glad that haskell also has whitespace rules.

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

#92

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.

I'm glad I don't have to read your code. But I don't believe you should be downvoted. Only reformed. ;-)

BTW in haskell whitespace is optional but nobody write code that way.

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

#93
post #58
post #44

Earlier quoted context omitted.

I indent my Perl code. Not everyone does, however. It's a trivial task to reformat it in an editor. I guess the only complaint I might have is why bother thinking about indentation, ever? Throw in a couple of {} and now the tools can provide additional help.

I indent my Perl code. Not everyone does, however. It's a trivial task to reformat it in an editor. But in Python, you don't even have to worry about other people not indenting their code! I guess the only complaint I might have is why bother thinking about indentation, ever? Throw in a couple of {} and now the tools can provide additional help. When you edit Python, the tools can already help as much. The start of a…

You do have to worry as their Python code produces errors if they do not indent it properly!

I don't like Python either and prefer Perl. (In Python I did not like indentations, dicts, tuples, lists, and the IDLE gui.)

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

#94
post #87

Earlier quoted context omitted.

curious what you prefer about Ruby. i'm very familiar with python, and have only looked at Ruby long enough to decide (mistakenly?) that it wouldn't do anything for me which python doesn't already.

Python and Ruby are very much alike but I find Ruby more ergonomic. It's more consistently object-oriented, which means I spend less time looking things up because the core is easier to remember. The syntax is more expressive, which makes my code shorter and easier to read. The consistent use of blocks everywhere is more intuitive and consistent than Python's mix of loops and comprehensions. I find I can take in a bl…

That's about it - Python has a richer, more refined set of libraries to call on than Ruby. (Ruby also has a ton...)

Ruby is more fun,but python is more mature. In the end - whatever gets the job done right?

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

#95
post #76
post #43

Earlier quoted context omitted.

You don't really appreciate Python until you try and program in something like Java again. The following code is readable and I have required a variation of it in a program before: sorted([ord(c) for c in set('letters in this sentence') & set('and this one')], reverse=True) Doing it in Java would be a chore now.

Here's a translation of that to Clojure, since I'm learning that now: (use 'clojure.set) (reverse (sort (map int (intersection (set "letters in this sentence") (set "and this one"))))) Edit: Take two... (use 'clojure.set) (->> (intersection (set "letters in this sentence") (set "and this one")) (map int) sort reverse) (experienced lispers, feel free to make this more idiomatic)

Here's one using a list comprehension to make it more closely resemble the Python example.

    (require ['clojure.set :as 's])

    (-> (for [c (s/intersection (set "letters in this sentence")
                                (set "and this one"))] (int c))
        sort
        reverse)

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

#96
post #74
post #65

Earlier quoted context omitted.

Java certainly was not designed to be this "enterprise language" it is now. It only was similar enough to Smalltalk to replace it. (and Smalltalk has this culture of "if it is repetitive then extend IDE to automate it", which to some extent influenced Java IDEs)

My impression, although I'm not an insider and could be off base, is that it wasn't conceived to be an enterprise language, but its patterns were. I learned it when I started application programming for my startup (I had been doing scientific routines, i.e. FORTRAN and Mathematica), because I was curious about OO. A lot had changed since I hacked out a little C and assembler on my Mac+ many years ago, and the scale o…

Interesting about objects in javascript. I have actually started feeling that prototype-based object orientation is less tacked on than its class-based cousin. The syntactical implementation is a bit strange (the 'function' keyword for objects, putting functions on the prototype object rather than the object itself), but the mechanism itself seems more generic and flexible. The implementation in Io is better I think, you should check that out before discounting prototype-based object systems outright.

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

#97
post #59

Earlier quoted context omitted.

Python for me is the language closest to pseudocode. There are no decorations and few gimmicks. You simply write your ideas down into code.

On the contrary, it has had decorators since Python 2.4.

"decorations", not "decorators".

I think it's fairly clear from context that he/she means, "not a lot of red tape", rather than a reference to specific language features.

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

#98
post #87

You owe it to yourself to learn at least one dynamic high level language. The advantage of Python (and Ruby, which I prefer) is that, for the right tasks, it's an extremely productive language. Compared to C++ or Java you have to write far, far less code and you can usually find good libraries that reduce the amount of code you have to write even further. Python doesn't have the elegance or flexibility of Lisp, but i…

curious what you prefer about Ruby. i'm very familiar with python, and have only looked at Ruby long enough to decide (mistakenly?) that it wouldn't do anything for me which python doesn't already.

Ruby is incredibly flexible, whereas Python is not. Often times my idea of the way things should be done is not Guido's idea, and so Python seems a bit lacking.

I really enjoy the pretty simply object model, the message passing OO, and blocks.

An interesting point that I read somewhere the other day, from someone who codes in a lot of both: Ruby (to him) is kind of ugly, and Python is very pretty. Yet, the exact parts that make Ruby ugly allow it to have _awesome_ libraries. Python, with its rigidity, means that the core language is great, but the libraries end up being worse because of it. He uses RSpec as an example, specifically. So for him, Ruby ends up being better to use, even though he likes the Python language better.

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

#99
post #87

You owe it to yourself to learn at least one dynamic high level language. The advantage of Python (and Ruby, which I prefer) is that, for the right tasks, it's an extremely productive language. Compared to C++ or Java you have to write far, far less code and you can usually find good libraries that reduce the amount of code you have to write even further. Python doesn't have the elegance or flexibility of Lisp, but i…

curious what you prefer about Ruby. i'm very familiar with python, and have only looked at Ruby long enough to decide (mistakenly?) that it wouldn't do anything for me which python doesn't already.

All the popular scripting languages "do" the same things. But I prefer Ruby to Python (while still liking Python) because it feels more programmer-friendly.

    Ruby: a = %w( apple pear orange )
    Python: a = [ "apple", "pear", "orange" ]

    Ruby: a=%q/O'Malley says "Hello"/
    Python: a = "O'Malley says \"Hello\""
Python lets you use "'" or '"' as the delimiter, which solves 80% of these cases - but why not generalize the concept, as Perl and Ruby did?

In Ruby, the last expression in a function is the return value; in Python you must use the return keyword, even though there's no ambiguity.

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

#100
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.

I agree that short python samples are as clear as a high level language can possibly be. Implementing algorithms, for instance, becomes incredibly easy in Python. I face problems when Python programs get above a certain length. I've done some Django programming in the past. A view gets a request object (pardon me if I'm wrong or if this has changed recently) and is supposed to then render the response (or something s…

what makes you think you can't grep for the request object/class?
Post reply on HN