Live data from Hacker News

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

news.ycombinator.com

101–110 of 231 posts

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

#101
post #67
post #45

Earlier quoted context omitted.

OCaml is a dying, soon obsolete, language. Better use F# which has way better libraries and tools.

As I understand it OCaml is in heavy use at a number of shops in the financial industry. I wouldn't say it was dying just yet. On the other hand F# is a new and as compared to OCaml untried and untested language.

Number of financial companies using F# is about the same as for OCaml (but numbers are not evolving in the same manner). F# uses .NET which is way more tested than OCaml runtime. F# uses .NET libraries which are way more tested than OCaml libraries. F# core language is still a bit less tested, but considerable work is being done. In contrast, there is only fulltime person working on OCaml. OCaml community is dying, while .NET community is huge.

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

#102
post #59

Earlier quoted context omitted.

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

"decora tions ", not "decora tors ". 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.

PEP-318 (http://www.python.org/dev/peps/pep-0318/) refers to a decorated functions as a having a decoration.

Counter-edit: My response was in jest. I deliberately misinterpreted the term for humorous purposes.

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

#103
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…

>> feel like I'm evolving my own design patterns

I think that this is happening to many people who are doing a lot of 'non-trivial' JavaScript. The language is still very young and because the concepts that were chosen when creating the language are powerful and flexible (prototypal inheritance, objects can be accessed like hashes, first-class functions etc) there's always a million ways to code something.

OO-wise i think you can divide into those who use the `new` keyword and build objects that are more or less Java-like classes and those who create objects and prototypes on the fly, and probably use a lot more ideas from the functional and LISPy side of things.

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

#104
post #51

I'm a guy from a C/C++ background who did linux kernel development, and picked up python along the way and used it to do desktop tools. I used python (without knowing any of it) to write a disassembler for a project I was doing in 2003 on a non-x86 processor. It took me 5 days to learn the language enough to do so and to write the entire tool, at which point I "got it". First off, Java isn't a toy language. You've ch…

""" Java is a bureaucratic language. You have to cross your t's dot your i's, fill out your requests in triplicate at the FactoryFactoryFactory to get the objectOfYourDesire. """

This is such an absolutely fantastic way of succinctly describing why I dislike Java so much. Bureaucratic!

Absolutely fantastic post, get this on a blog somewhere. I seriously wish I could upvote you more.

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

#106
post #101
post #67

Earlier quoted context omitted.

As I understand it OCaml is in heavy use at a number of shops in the financial industry. I wouldn't say it was dying just yet. On the other hand F# is a new and as compared to OCaml untried and untested language.

Number of financial companies using F# is about the same as for OCaml (but numbers are not evolving in the same manner). F# uses .NET which is way more tested than OCaml runtime. F# uses .NET libraries which are way more tested than OCaml libraries. F# core language is still a bit less tested, but considerable work is being done. In contrast, there is only fulltime person working on OCaml. OCaml community is dying, w…

.Net being tested is not the same as F# being tested.

The idea that the OCaml community is dying is purely subjective. OCaml, having been around longer than F#, may just be going through a perceived lull.

Either way generalizing that F# will replace OCaml as the goto language in the ML family from a perceived decline in the OCaml community is probably not the right call.

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

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

Given a = [1, 2, 3, 4, 5]:

    Ruby:    a.map{|i| i+1}.reject{|i| i%3 == 0}.map{|i| i*i}
    Python:  [i*i for i in filter(lambda i: i%3 != 0, [i+1 for i in a])]
Please ignore the fact that the whole operation can be simplified mathematically - nontrivial map-grep-map operations do occur.

I find the Ruby version clearer because it proceeds from left to right like a shell pipeline.

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

#108
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…

You seem to be complaining that when using a language new to you in combination with a large framework written in that language you would have been forced to read the (very good) documentation to figure out what was happening.

The inconsistencies you mention are (in a well written code base) very rare. If you call a method get_name() odds are you are going to get back a string. If you seem to randomly get back an int or a dictionary or a datetime object it's a pretty good sign the code is foobar'd. Good Python programmers don't abuse the dynamic nature of the language. Methods should return predictable types (documentation is important), it might return different types depending on the input but this should be documented and obvious (say a parse date method that returns a datatime object if you pass it a string containing a date and time). The values() example you use is very clearly documented as returning a ValuesQuerySet that supplies dictionaries not models (http://docs.djangoproject.com/en/dev/ref/models/querysets/#v...).

In a number of years using python, the standard library and 3rd party libraries I've never been left wondering "If I pass X to this method what the hell type am I going to get back". Just like in C/C++ I need to remember it returns a list or a string or a dictionary but that's usually where the mental overhead stops.

Python is dynamic which means it's flexible. Flexibility is usually reached by sacrificing simplicity so Python encourages testing and good documentation. I would argue that these are both necessary features of any good code base, Python is just more upfront about this than a number of languages.

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

#109

Earlier quoted context omitted.

Python's whitespace indentation seems like a great idea until you realize that it makes things like copying & pasting code from web pages etc far more difficult and, worse, makes automatically reindenting a block of code in an editor impossible. If I come across a badly formatted block of code in Ruby or Java or C in emacs it takes me one keypress to sort it out. In Python I have to carefully, manually look at each l…

It's also very annoying to have to un-indent an entire block of code during debugging just because you want to comment out the conditional statement around it...

You could do what you say - comment the conditional:

    # if x:
    if 1:         # DEBUG
        block

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

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

The ruby examples don't behave the same as the python version since they use ARGF in place of stdin. They are also non-idiomatic. Here is a correct, idiomatic Ruby version:

    $stdin.read.split.each do |w|
      puts w if w.match(/ing$/)
    end
or as a single 57 column line:

    $stdin.read.split.each { |w| puts w if w.match(/ing$/) }
we can also use the match operator:

    $stdin.read.split.each { |w| puts w if w =~ /ing$/ }
I'm inclined to assume that the other language examples are also suspect.
Post reply on HN