Live data from Hacker News

Learning Curves for Different Programming Languages

github.com

161–170 of 221 posts

Re: Learning Curves for Different Programming Languages

#161

Say what you want but PHP is one of the most Rambo-bad-ass languages I've ever used. You toss everything to the wind if you want and you will still get a working product. Few languages have that sheer "Survive" feel to it. For that alone I think PHP should be celebrated. Note: I'm not a PHP developer.

> You toss everything to the wind if you want and you will still get a working product.

This is actually the reason that I recommend Haskell for startups. As another commenter said in this thread it gives you a line of technical credit so to speak. This is mainly because the type system and referential transparency (pure functions) makes it so easy to refactor and be confident that your code is still working.

Re: Learning Curves for Different Programming Languages

#162

Earlier quoted context omitted.

I'll take another tack and suggest that productivity today is more a function of what libraries might be available rather than language choice. A language like Python has a massive number of really good libraries spanning a range of disciplines. Is it the "best" language (whatever that means)? Don't know. Don't care. You can get the job done and the ecosystem is huge. I am not comparing Python to Haskell or anything…

The graphs are not productivity vs language choice. They are productivity vs experience in a given language. In languages with strong libraries, I'd expect a diminished benefit from experience. 10 years python experience doesn't make you much more productive in standing up a django application vs someone with 1 year of experience. Thus, the curve for python might very well be quite flat (since you start fairly high t…

Libraries can only take you so far.

A python developer with limited experience is likely to use too many 3rd party libraries in simple cases where they are really not needed. As the application grows this turns into a maintenance and/or performance nightmare.

Not to mention the fact that it takes experience to understand/troubleshoot/fix third party code. When things go wrong the dev with 10 years experience is going to be vastly more productive than one with less experience.

I am a python dev with >10 years experience and I manage numerous junior devs with limited experience, so I see this kind of thing all the time.

Re: Learning Curves for Different Programming Languages

#163

Earlier quoted context omitted.

>I just don't find Haskell ... to be as productive as many would suggest >I have ... very little experience with Haskell So, how would you know?

I don't know with 100% certainity, but it's a moderately confident conclusion from my little experience.

The point of graphs like these (aside from making a joke) is to describe the learning curve. These graphs admit that the beginning of haskell is a nightmare, but claim that eventually you have "unbounded" productivity.

It seems rather hard to evaluate the tail end from "little experience".

Re: Learning Curves for Different Programming Languages

#164

Earlier quoted context omitted.

The graphs are not productivity vs language choice. They are productivity vs experience in a given language. In languages with strong libraries, I'd expect a diminished benefit from experience. 10 years python experience doesn't make you much more productive in standing up a django application vs someone with 1 year of experience. Thus, the curve for python might very well be quite flat (since you start fairly high t…

Libraries can only take you so far. A python developer with limited experience is likely to use too many 3rd party libraries in simple cases where they are really not needed. As the application grows this turns into a maintenance and/or performance nightmare. Not to mention the fact that it takes experience to understand/troubleshoot/fix third party code. When things go wrong the dev with 10 years experience is going…

But are you actually gaining productivity when fixing third party code? Or are you losing productivity? I would say you are paying back the gains you got from using the library in the first place and therefore losing productivity. Granted, you generally come out ahead.

I think that's the plateau in most languages. You get to a point where you are fighting the language/ecosystem as much as it's helping you and so productivity plateaus.

Re: Learning Curves for Different Programming Languages

#165

Earlier quoted context omitted.

It's funny that we feel PHP doesn't make you more productive, yet most of the web was running PHP apps until a few years ago when better languages gained momentum and we saw new web sites not built in PHP. Wordpress, phpBB, Drupal, IPB, Joomla, vBulletin, Facebook, Yahoo!, DeviantArt, etc... Now PHP making you a better programmer... that's a different matter.

The decision to use PHP is not represented in the graphs. What the graphs say is that as you gain more experience with PHP you don't necessarily become more productive. 1 yr PHP experience == 10 year PHP experience.

I think your parent is referring to the fact that the Productivity graphed for PHP is the worst of all the languages, even at t=0 (except Haskell, which is shown as starting out with 0 productivity for a while.)

I also strongly disagreed with that for the same reason your parent comment did. The self-assessment bar is funny, but hte blue (productivity) graph needs to be way higher.

Re: Learning Curves for Different Programming Languages

#167

Would learning Monads really come before learning Category Theory in Haskell?

Yes. Continuing beyond monads to learn about category theory is mostly because it is interesting. It is definitely not a prerequisite.

The historical relationship is that Eugenio Moggi wrote a paper in 1988 "Computational lambda-calculus and monads" http://bit.ly/1x9uUHQ that used ideas from category theory to handle the semantics of programming language features. His problem was that the lambda calculus itself failed to adequately handle certain "notions of computation" such as side effects and non-determinism. This inadequacy goes way back to the origins of programming language semantics, starting with Peter Landin's 1964 paper "Mechanical evaluation of expressions" http://bit.ly/1rrBit3. He described a virtual machine (SECD) for evaluating lambda expressions, but had to add special constructs for handling assignment and jumps. In case you don't know what semantics is about, imagine that you had two small programs written in two different languages. How would you determine if they were the same? One way would be to demonstrate their equivalence to a common, mathematically sound, language. That's what Landin used the lambda calculus for. But it's only good for a subset of what we understand computation to be (particalurly what a Von Neumann computer is capable of doing).

That's what prompted Moggi to look to a more encompassing branch of mathematics -- category theory -- to describe semantics. In 1991, he wrote "Notions of computation and monads" http://bit.ly/1viXT6z, which is much shorter and more accessible, but essentially the same as the previous paper. Philip Wadler, one of the original authors of Haskell and long-time functional programming researcher and educator, was inspired by Moggi's work to write (several times) a tutorial showing how Moggi's "monads" could be applied to the restrictions of functional purity. For example, to simulate the incrementing of a global variable representing a counter (of some operation), one could use a "state" monad.

The monad of Wadler (and Moggi) is really pretty simple. First, you need a way of representing one of these notions of computation. In a programming language, this is done with types. Or to be more precise, a 'type constructor' since you will want the computation to be general. For instance, if your computation changes state (eg the counter above), you might want to construct a function type that given a value, takes a state (eg integer representing the counter variable) and returns a tuple consisting of the value and some new state. I should point out that my last sentence is what makes monads so confusing and challenging in languages other than Haskell. They don't have a nice way to represent what I just said. To use Wadler's notation:

type T x = S -> (x, S)

The second component of a monad is a function that takes a value and returns a "computation" (ie, the type described above). And the third component is a function that takes one of the computations and a function from a value to a computation and returns a computation. That's a mouthful, and it requires the language to support polymorphic types and higher-order functions. If your language does not or doesn't provide good syntax for them, then monads will be an elusive and difficult concept. But as you can see, a monad is just a pattern made up of these three things. That's all ... almost.

Because of the relationship to category theory, a monad (consisting of the three components) must also obey certain rules for how these operations are expected to behave when combined in certain ways.

In fact, monads are pretty cumbersome to implement, especially when there isn't good syntactical support in a language. But they provide a general solution to certain kinds of problems which is functional in nature.

Re: Learning Curves for Different Programming Languages

#168
post #25

It seems that it interchanges "productive" with "writing clean code". PHP is ugly but can be productive. Haskell is beautiful, but well, I know a lot of people encharmed by it, but no-one productive (i.e. delivering products quickly; it's not the same as solving pure, mathematical problems).

>I know a lot of people encharmed by it, but no-one productive (i.e. delivering products quickly; it's not the same as solving pure, mathematical problems). Is this actually true, or is it "true in your heart"? Very few people use haskell for solving "pure mathematical problems". People use it for things like developing the fastest microkernel in existence, doing high volume trading, making games, and writing boring…

It would be interesting to define product as "dollars produced" or something of that sort. Then rank languages by net product and then by net productivity (net product over time).

I would expect it all to be heavily skewed towards high volume trading.

Re: Learning Curves for Different Programming Languages

#169

Earlier quoted context omitted.

The decision to use PHP is not represented in the graphs. What the graphs say is that as you gain more experience with PHP you don't necessarily become more productive. 1 yr PHP experience == 10 year PHP experience.

I think your parent is referring to the fact that the Productivity graphed for PHP is the worst of all the languages, even at t=0 (except Haskell, which is shown as starting out with 0 productivity for a while.) I also strongly disagreed with that for the same reason your parent comment did. The self-assessment bar is funny, but hte blue (productivity) graph needs to be way higher.

There's no absolute scale, so you can't make comparisons between the graphs. The only conclusions you can make from the PHP scale is 1) that (according to the author) PHP developers think they are a lot more productive than they actually are and 2) experience doesn't increase productivity substantially in PHP.

Re: Learning Curves for Different Programming Languages

#170

Would learning Monads really come before learning Category Theory in Haskell?

I'm productive in Haskell and I don't know category theory. I didn't "learn" monads specifically, I used them in my projects and gained an intuition for monads followed by memorizing the 3 monad laws.

What distinction are you making between "learning monads" and "gaining an intuition for monads and memorizing the 3 monad laws"?
Post reply on HN