Live data from Hacker News

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

news.ycombinator.com

151–160 of 231 posts

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

#151
post #148

I am a day-to-day C programmer. I am surprised to hear Python did not fit well after C for you. In my view, Python is the like the easy scripting version of C. I first learned Tcl/Tk, then Perl, then looked at bash scripting (my god, horrible) and seen that the earlier three has some obscure syntax with some special meanings of $'s and @'s and hyphenated flags everywhere with no resemblance to C. Then looking into py…

Agreed. And interesting you said C and Python.

A few years ago I was thinking about what would be the minimum set of languages that would be good to know in order to be able to do almost anything you wanted, and do it well, and to always be employable. I ruled out 1 language alone because of the C phenomenon: there's a whole class of software where today C is the best choice, and a whole different set where C is a bad choice. Therefore, the ideal set was 2+ with C being one. I ended up settling on C, Java and Python. Java for enterprise/BigDumbCompany work, but also because there's a lot of great tooling and innovation happening in the Java space more so than other langs. Python for the role of glue and prototyping and high level no boilerplate bureaucracy but where you could still trust every developer using it. Ruby could probably fill that role decently instead, except be a little better or worse in diff areas.

C, Java, Python

Then I found out that Google had picked these three as well. Nice!

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

#152

Earlier quoted context omitted.

I don't get what you mean by "toy language." Clearly some big, powerful, practical stuff has been written in it. Usually the phrase "toy language" is used to refer to those with little practical use. Java is unwieldy, but it has a rich ecosystem and compiles to very efficient code across a broad range of platforms. If you want Java without the unwieldiness, try Groovy. It's Java with a ton of syntactic goodness added…

As I said earlier. "Secondly I don't mean to criticize Java. By calling it a toy language, I was simply referring to the fact that Java tends to make writing bad code difficult, and in doing this takes away some of the flexibility and power that you tend to associate with other languages." Judging from the general reaction it seems I should not have used the term "toy language". My apologies if I ended up implying th…

> Java tends to make writing bad code difficult

I've known people who could write bad code in Java with the utmost ease!

It'd probably be more accurate to say that Java deliberately limits its expressiveness, in order to make it harder for people to shoot themselves in the foot, and to make it easier for one programmer to understand what another has written.

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

#153
post #80

Earlier quoted context omitted.

I think the header-file and source-file distinction was more of an architectural decision (so that you could implement an efficient compiling and linking system) than a language design decision. Just an opinion, though.

of course it was architectural, but that's precisely the problem - why are we still using a language designed for an age of computational scarcity? another example: functions should be virtual by default.

another example: functions should be virtual by default.

No no no!

C++ got this one right, and then C# did better ('virtual' to declare a virtual/overridable function in the base class, and 'override' to replace it in the subclass).

http://www.artima.com/intv/nonvirtual.html

Every time you say virtual in an API, you are creating a call back hook. As an OS or API framework designer, you've got to be real careful about that. You don't want users overriding and hooking at any arbitrary point in an API, because you cannot necessarily make those promises. And people may not fully understand the promises they are making when they make something virtual.

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

#154

Earlier quoted context omitted.

Well of course I'm doing it wrong, I got crashers during execution :) I understand the concept, but sometimes in a medium-size project, you just accidentally send the wrong object back. It happens. But Python won't tell you, and it'll blithely wait for the code to get exercised before dying. I don't remember exactly why I was having this problem, but the bug wasn't shallow, and required a certain confluence of except…

"I don't remember exactly why I was having this problem, but the bug wasn't shallow, and required a certain confluence of exceptions to occur before it would fire. The sort of thing that would even escape most unit testing." I agree that this does indeed happen... I think it's a matter of, the more flexible a language is, the more rope you get to hang yourself with, even unintentionally and unexpectedly. (Anecdote:)…

Regardless of the language, when you get to over 50K lines of code, cute tricks need to go out the window.

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

#155
The biggest revelation Python gave me is peoples thought process/problem solving process/whatever you want to call it (I call it brains) work differently. And importantly peoples brains are wired to work really, really well with specific language qualities(dynamic, functional, boilerplateish) as manifested in specific languages. But really poorly with other qualities/languages.

So, no you are not a bad person. If you've given Python a honest attempt (took me a year to do that, I had whitespace hangup that was hard to get past), then you aren't missing anything either. Python just isn't the language for you. Move on, be happy.

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

#156
post #109

Earlier quoted context omitted.

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

Or, even quicker and dirtier:

    if 1: # x:
        block

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

#157
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)

Not sure why we are posting alternative language implementations, but here is the Scala version :). You could say that this was an exercise for me in learning 2.8, which I am unfamiliar with. A for comprehension isn't needed because Scala already treats Strings as a sequence of characters.

(Set("letters in this sentence":_* ) & Set("and this one":_* )).toSeq.sorted.reverse

Or you, can take advantage of Scala's rich choice of collections.

import scala.collection.immutable.TreeSet

import scala.math.Ordering._

TreeSet("letters in this sentence":_* )(Char.reverse) & Set("and this one":_* ) toSeq

The machinery Scala has in place to make the second example work is quite impressive, and I was pleased to see that it worked. Even though the intersection method returns a brand new set, using implicit arguments it correctly creates a set of the correct type (TreeSet) with the correct ordering function (Char.reverse), without any duplication of code in the standard library (like overriding '&' in every sub-class).

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

#158
post #99
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.

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 conce…

    a = '''O'Malley says "Hello"'''

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

#159
Python people are too busy solving real world problems fast and quick and getting their shit done, to fall in love with python.

Tools are just tools. And I don't mean to come across as a jerk. I love developing. But that is as a means to an end, but not as an end in itself. - Those who like the latter, end up as research scholars; or Rubyists.

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

#160
post #45

Earlier quoted context omitted.

You sound that you will like Haskell. It's type system can be really paranoid (it lets you express many invariants through it), yet remain very flexible. And If you can't fathom the segregation of (side) effects, there's still Ocaml.

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

Don't overlook the fact that F# is build on top of a proprietary, potentially patent-ridden platform. For many people, including me, that's a non starter.
Post reply on HN