News for hackers. Stuff that matters.
Re:Ask HN: Best programming language or theory to learn befo... by hsivonen on Wednesday July 04, 2018 @03:28PM (#17459021)
As with natural languages, if you want to learn language X, go learn language X and don't try to learn Y first. So if you want to learn Rust, learn Rust.

In my experience, particular theory as in CS papers isn't needed for learning Rust. Understanding the runtime stack, RAII from C++ and malloc/free from C helps, but if you haven't already programmed in C and C++, it doesn't make sense to learn them in order to learn Rust. Any introductionary lecture on how the runtime stack works combined with the abstact idea of pointers to heap should be enough (no need to know how heap allocation works in detail).

Re:Ask HN: Best programming language or theory to learn befo... by TJSomething on Wednesday July 04, 2018 @05:24PM (#17459511)
I can't find it right now, but I've read a study that showed that teaching Python and then another language yields better understanding then just jumping into the harder language.

I was able to find the article "What About a Simple Language? Analyzing the Difficulties in Learning to Program" by Mannila, et al., which found that first time programmers found it easier to write bug-free programs in Python than Java and subsequently had a lot less trouble with the details of Java after learning Python, as they did not have to use the mental bandwidth to learn the most basic concepts of programming while also learning static typing and the incantations required to use Java.

Re:Ask HN: Best programming language or theory to learn befo... by hsivonen on Thursday July 05, 2018 @01:19AM (#17461024)
As the very first language Python may be a good choice compared to Rust in the sense that one can learn to _program_ with a smaller risk of such up-front frustration as to give up altogether.

However, after getting to the point of feeling “I can do this programming thing”, I don't think Python provides any specific help for learning Rust more efficiently than learning a given thing in Rust directly.

Re:Ask HN: Best programming language or theory to learn befo... by kungtotte on Thursday July 05, 2018 @02:36AM (#17461263)
I think it's sometimes difficult for those that already know how to program to look back and realise what it feels like to not now anything about programming. When you're starting out you're really learning three things at once:

General problem solving, the vernacular and methodology of programming (what's a variable, a function, control structures, how is a program run, what are expressions and statements, etc.), and finally the actual language itself.

The first two are universal across languages, but the third is very different depending on what you pick. A language like Python makes that part much simpler than a language like Rust. There's fewer hoops to jump through, less to keep track of, and you can dive in applying your newfound knowledge of the first two topics.

Re:Ask HN: Best programming language or theory to learn befo... by mic47 on Thursday July 05, 2018 @07:48AM (#17462493)
Unless the target language is functional language. Actually, prior experience in imperative languages makes it harder for you to move into functional programming language, as you have to unlearn some things.
Re:Ask HN: Best programming language or theory to learn befo... by AnimalMuppet on Thursday July 05, 2018 @02:34PM (#17465635)
I wonder if the same isn't true going the opposite direction, too - learning functional, then moving to imperative. But it's much less common to do it in that order, so we may not see it happen enough to notice it as a pattern.
Re:Ask HN: Best programming language or theory to learn befo... by firethief on Wednesday July 04, 2018 @05:22PM (#17459501)
That's an interesting choice of analogy; there's some evidence that's not necessarily the best approach: https://en.wikipedia.org/wiki/Propaedeutic_value_of_Esperant...
Re:Ask HN: Best programming language or theory to learn befo... by yorwba on Thursday July 05, 2018 @01:35AM (#17461072)
No, there isn't, at least not in that article. If you actually read the studies referenced, you'll notice that none of them actually support the claim that learning Esperanto first is better than just starting with your actual target language directly. Learning Esperanto can speed up learning another language with shared vocabulary, but not so much that it offsets the initial time investment of learning Esperanto.

Given how often it seems to be used to perpetuate dubious claims about Esperanto's almost-magical benefits, I'll need to find some time to completely rewrite that Wikipedia article. For now I'll just link to a review of one of the studies I wrote up a while ago: https://news.ycombinator.com/item?id=14848019

Re:Ask HN: Best programming language or theory to learn befo... by nazka on Thursday July 05, 2018 @05:42AM (#17461959)
I agree with hsivonen that knowing about "the runtime stack, RAII from C++ and malloc/free from C helps". Maybe learning common problems with pointers and what they are will be good to do. After that you are good to learn Rust.
Re:Ask HN: Best programming language or theory to learn befo... by giancarlostoro on Wednesday July 04, 2018 @04:47PM (#17459382)
Idk having learned Python for 4 months it helped when I transitioned to JavaScript. A lot of things I knew how to do in Python I tried in JS and they seemed to work. It certainly helps to learn similar languages, and in my opinion it never hurts to know more programming languages. :)
Re:Ask HN: Best programming language or theory to learn befo... by undseg on Wednesday July 04, 2018 @05:21PM (#17459496)
While everything you said is true, imagine your final goal was to learn Javascript: going through Python wouldn't help significantly. I feel that was the point of parent. Certainly, learning your first language (or first language in a certain paradigm) is a whole different matter than picking up a bunch of other similar-looking ones.