Live data from Hacker News

Why Python is Important for You

blaag.haard.se

181–190 of 231 posts

Re: Why Python is Important for You

#181

I do love Python, but I often wish there was more rigor for some things. I currently work on a large project (>500K LOC) and have started to see it fall apart with a bigger team. Lack of enforced typing in function arguments, inability to create strict interfaces, inconsistency in standard library conventions, and package management would probably be my biggest gripes.

500K LOC in Python is what, 2.5M->5M in a statically typed language? At that size I would expect any project to require explicit convention and communication management, simply because no one person can hold the whole thing in their mind at a resolution that reveals the code's meaningful features.

And it's probably 200k lines in Haskell, which is very statically typed :)

(For reference, GHC--a very complicated compiler with clever optimizations, language extensions, multiple backends...etc--is something like 125k lines of Haskell.)

I've spent a significant amount of time with Python, both at work and in my classes and yet my Haskell code is usually 2-3x shorter for very similar programs. I think it's also easier to read, but that's indubitably a matter of taste.

Re: Why Python is Important for You

#182
post #57

Earlier quoted context omitted.

I must respectfully disagree. I work with web-based systems and find the dynamic typing of Python to be its biggest strength. The ability to just throw another property onto an object before sending it to the template-engine saves so much engineering work, it totally overcomes the downsides of not annotating required types. I can see where it may be an issue, but I think the documentation should focus on what functio…

"I must respectfully disagree. I work with web-based systems" Web-based systems tend toward smallness and/or flatness, with fairly straight execution paths through the system. You're not going to run into the limitations being discussed.

Yeah and big systems architects should really learn from that. A bunch of small services connected by well defined interfaces is the flipping bomb!

Re: Why Python is Important for You

#183
post #11

As a commenter on the article wrote: what about Ruby? I say this as a happy Python user. Ruby seems very similar but I'm reminded of a pg essay on language power: looking up the power curve, you see '$Language plus a bit of weird stuff that is probably irrelevant.' So I don't trust myself. As someone who loves Python and doesn't know any Ruby beyond a few bits of syntax and the obvious bits that are common to most la…

If the distance between Ruby and Python is the Moon and Earth. Then the distance between Ruby/Python and any other common language is the Earth and Sun.

You aren't missing much, comparatively.

Re: Why Python is Important for You

#184

Earlier quoted context omitted.

Yeah, I goggled a bit at that one too. Particularly when it's immediately followed by a complaint about things being modified unexpectedly. Some of the complaints are not really issues, eg. you can comment out loops by adding an "if 0:" after commenting out the top line, or else surrounding it with triple quotes """...""". [5] is an outright lie. Major Python apps support 2.4 onwards, true, but virtualenv (a common p…

Python mixes immutability and mutability in ways that require careful thinking about the problem if you want to write unbuggy code. E.g., does a tuple holding lists allow modification of the member lists? Intuitively, it would seem to me that immutability should cascade, but thinking about tuples as holding a bag of pointers suggests that the lists are still mutable. Anyway. I generally take the position that if you…

Virtualenv is a pragmatic approach to solve actual problems during both development and deployment. As long as you have a python executable (don't have to be installed system-wide) and the virtualenv.py module, you can create a virtualenv. How is that "a whole ecosystem"?

Re: Why Python is Important for You

#185

Earlier quoted context omitted.

Some many years ago I decided I should learn a new scripting language because PHP wasn't general-purpose enough. I decided it would be either Python, Ruby or Perl. For some reason Perl was dropped early, I forget why (don't worry I learned some Perl later). So I started Googling for Python vs Ruby. After checking some language basics tutorials, I decided that really, for my purposes they were about equivalent in powe…

Also, just a little disclaimer: This was a couple of years back (I forget how many, 5 or so) maybe the Ruby community changed, and it's also totally possible that I just happened to land on a rather "particular" region of the Ruby blogosphere, so take this cum grano salis. I had to make a choice and was about this close to just flipping a coin over it :) ruby-talk used to have, as one of a number of perma-threads, th…

Well, one issue is that with a language as popular as Python (or Ruby or Java...) it's relatively hard to avoid working with them. So it's actually very beneficial if a technology one likes becomes popular.

Re: Why Python is Important for You

#186
post #177
post #46

Earlier quoted context omitted.

Just to be clear, Python is strongly typed but not statically typed. But I definitively agree with your comment. The startup I'm working for is Python based, but I'm currently learning Haskell, because I'd like to take advantage of a good type system for my larger efforts.

Aren't you concerned about unpredictable memory requirements?

To be honest I don't have enough experience with lazily evaluated languages to be concerned about it yet.

Re: Why Python is Important for You

#187
post #76

Earlier quoted context omitted.

> How is Haskell "weird"? Functional the world (of wide-spread computing languages) is imperative, lazy the world is eager, objects-less when the world is object-oriented, curried when the world is uncurried, pattern-matched when the world is conditional and brings up "strange" concepts from mathematical bowels like "monads", "functors" or "zippers" when the world barely iterates on arrays. How is Haskell not weird f…

I understand "different". Not "weird".

You seem to be attaching a non-existent negative connotation to weird. Weird means different. Weird is "more" different.

Re: Why Python is Important for You

#188

Earlier quoted context omitted.

Also, just a little disclaimer: This was a couple of years back (I forget how many, 5 or so) maybe the Ruby community changed, and it's also totally possible that I just happened to land on a rather "particular" region of the Ruby blogosphere, so take this cum grano salis. I had to make a choice and was about this close to just flipping a coin over it :) ruby-talk used to have, as one of a number of perma-threads, th…

Call me a cynic, but I'm weirded out by the idea that the only reason for civility is to emulate an idol who is civil.

Call me a cynic, but I'm weirded out by the idea that the only reason for civility is to emulate an idol who is civil.

Idol? He's a nice guy who does admirable work and many people think it ungracious to be rude when publicly discussing his language.

Only reason? Geeks get into stupid pissing matches. Sometimes a little reminder is a good thing, that's all.

Re: Why Python is Important for You

#189

Earlier quoted context omitted.

+1 on the static type checking problem.. i am beginning to feel very annoyed by the same... have found that writing and maintaining unit test cases help.. but are a PITA nevertheless...

Well, as I see it, more or less every error should be expressible as a type error. In order to actually do that, you’d need full dependent types, and that’s a huge language-design “now you have two problems” feature—compiler authors are understandably uncomfortable with undecidable, non-inferable type systems. Anyway, Haskell and even C++ used intelligently can tell you a lot about your program at the outset, so ulti…

Yep, I agree with you - although every error should be expressible as a type error, languages like Coq where this is actually possible make writing usable code pretty difficult. I think there's a pretty wide range of middle ground, ranging from C++ to Haskell, where you get the benefit of static types without making it really difficult to write working code.

Re: Why Python is Important for You

#190
post #133

Many years ago I've decided it was time to pick up a modern programming language. In the past I had written lots of (Turbo) Pascal code, some x86 (and more exotic) Assembler and a bit of C, but then for several years I only did shell/awk scripts and ported C software to IRIX and SINIX/RU. So I sat down and decided to find a nice general-purpose language that I would focus on learning. I wasn't quite sure what for yet…

Python does have the strength in all the powerful libraries it makes available to you, and that may be a determining factor in the relative popularity of Python v. Ruby in the future.

I've used Python for many years but recently took a serious look at Ruby to see what it has. I haven't looked back - I found Ruby to be less verbose and still easy to read, and very enjoyable to code in. Python was enjoyable too, but for me, Ruby much more so.

Post reply on HN