Why is it difficult for developers to learn another programming language? [pdf]
nischalshrestha.me
nischalshrestha.me
Edit: after reading the paper I understand the emphasis is on conceptual mistakes people make when coming from one language into another - you assume things work like A and make mistakes when B works differently under the hood and you don’t realize it until banging your head against it for a while.
That experience does ring true, but I stand by my original comment, this is mostly only an issue for language #2, and with each language it gets easier as you begin to think more in universal terms and have fewer assumptions and gaps where you’ve been accustomed to something that “just works” in the environment you’re most familiar with.
There's other families of languages like Prolog, ML and lisp that are drastically different and I have found that many people find these languages hard to learn.
Moreover, you don't know if the parent also did functional programming.
But I think your remark is a fair one, I think it's about wrapping your head around programming paradigms that are quite far from each other.
Learn at least a half dozen programming languages. Include one language that emphasizes class abstractions (like Java or C++), one that emphasizes functional abstraction (like Lisp or ML or Haskell), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), and one that emphasizes parallelism (like Clojure or Go).
Ten years ago I learned C# and since then I've dabbled in other languages like Haskell or Lisp which were a little fun, but I keep getting drawn back to learning more about my stack. There's still decades of knowledge I lack about Azure/Entity Framework/Asp.Net/Xamarin/Sql Server/WPF/C# CMS/C# CRMS/C# e-commerce/Roslyn the opensource compiler/Blazor/Typescript/React/CSS. (Not to mention all of the useful soft skills, like sales/ marketing/negotiation/management)
And I'd rather be able to build out a desktop app, a web app, or a mobile app than be able to build out a web app in js-node/C#-mvc/ruby-rails/python-django.
Basically when I learn I want to be able build I couldn't before (like a mobile app) or get better at building(learn how to better optimize t-sql queries). And when I've spent time learning new languages I felt like it wasn't as useful at delivering on these two goals.
I also prefer to use FSX scripts over CSX in contexts where that is useful. I find my deeper knowledge of the .net infrastructure easier to leverage than having to learn powershell but FSX syntax also cleaner for scripting.
Your IDE should work with you to make it more useful. For sure your knowledge of another language isn't going to be as great as your first language, but I've personally always relied on tooling around that language to tell me where I'm wrong, then I can go find out why it is that my IDE is complaining and I'll then decide whether the IDEs error makes sense or not.
What I found was learning other languages provided value in the form of insight which changed how I wrote my primary language.
JavaScript taught me about the value of concurrency, C# taught me the value of types and DI, TypeScript showed me the complexity of C# wasn't necessary, Go taught me that I code too much and say too little.
I next learned PHP because it gave me superpowers on the web that VB couldn't. When Ruby on Rails became popular, then Node, I dabbled in learning those but I just couldn't get excited about them because it didn't give me any more capability than PHP already did.
I generally only tackle learning new things if it provides me immediate value to do so.
In general I agree with you, but I think this is taking it a bit too far. My journey was similar, except PHP was my starting language and I was doing frontend (so HTML+CSS+JS) at the same time.
But, now I'm doing Clojure full-time. But not until I spent 2-3 years on-off learning it. It wasn't until 1.5 year ago I actually sat down and started writing things in Clojure.
But if I had the "only if it provides me immediate value" mindset, I would never have learned Clojure. It's not until now I'm more productive than I ever been, but that required a bit of uphill fighting.
But I'm so glad I stuck with it, now I can't imagine programming in something else. Which has ruined me a bit, but I'm happy with that.
I also don't really get emotional over the language choice... I'd ditch PHP in a second if it made sense to, but IMO a good architecture can enable development speed FAR better than a good language can. The language choice mostly just comes down to syntax preferences.
To each their own.
Absolutely, I agree with that as well! I would not rewrite something to a different languages unless there is a damn good reason for it. I'm not a person who generally rewrite stuff "for fun", so I think you're spot on here.
And I agree with you on the architecture/language comment as well, it's way more important. But I do think that the common practices of a language either helps/slows you down as well, so doing the same thing in two different languages can be implemented in different speeds.
> The language choice mostly just comes down to syntax preferences
Here is where I kind of disagree, but not fully. Yes, Java and C# are basically the same, in the end. Details are different, but mostly the same. Same goes for all languages in the Algol-group of languages, which C, JavaScript, Java, Python and more belongs to.
Then we have the Lisp-family of languages. They are very similar, within the group, but compared Lisp-like languages with Algol-like languages, the differences become way larger. Add languages like Erlang, which are way different, and you get some more differences.
So yeah, most of the language choices people do today, mostly come down to things around the language (ecosystem etc) rather than the language itself, because most people limit their choice to Algol-like languages.
In the end, I could not care less about the language you use, I'm not trying to force anyone to use what I find most productive. We all have preferences that speaks for us. But I wish someone tried to get me to dive into Lisp/Clojure earlier, and I think there are others who will feel the same, but again, I don't really care what others use.
Your second language is hard because it's not the first, even though it's probably pretty similar. But the differences will catch you out. A second language challenges the mental models you built up with the first language -- you have to tear some of your understanding down and come up with a more generalized perspective.
Languages similar to the first two become easier to pick up after this point, because you're mostly looking for a handful of differences, not a total paradigm shift. But languages that are sufficiently different, like C and Haskell, require a lot more of the ground-up type of work you thought you'd left behind by now.
It gets easier and easier as you cover more of the conceptual landscape. But I'd be willing to bet that many developers haven't had to journey far from home.
For the record, my professional work includes languages as dissimilar as PHP, Java, and Common Lisp, while my hobby hour work includes Rust and Haskell. That’s a pretty wide range of the language space that exists today, IMO.
The learning strategies of successful language learners show this: Learning on their own, Just in time learning, Relating new language to old langue. I would say that the "Language interferences" are just a product of the learning method. Putting yourself in the deep end and trying to swim always results in a little water in you lungs ;-)
The fact that it is challenging does not imply that it isn't desired. In fact there is a whole branch of skill acquisition theory called "desirable difficulties". While I think their theories of what would make the process better are interesting, I don't actually agree with their conclusion - that we should proceed as if their theories are correct.
We should get better at creating mixed-ecosystems and cross-language libraries... the JVM was a step in the right direction but most new development completely forgot about that!
As for languages designed after Java, many of them are responding against it. They don't want users to require slow startup costs, for example.
You just do not know how to "Do things in the right way"
It’s all the frameworks, and their undocumented features, that sometimes doesn’t make sense, but it’s the way it is done, which is what makes learning new languages hard to master.
This is not even considering all the little "gotchas" each language will have. Although, Stackoverflow et al. help ease this a bit.
I can write python and understand the code, know some quirks but for large code base I would probably be lost because I don't know "python ways".
Some paths are easier than others so it really depends on the new language and where someone is coming from. I started with PHP/JS on a self taught basis. Then I started to develop interest in other languages. Python was a no-brainer, C++ looked quirky but okay, in Java most thing looks familiar. But functional languages get me. Rust is another beast, but totally looks tamable.
Haven't finished the article yet, but it has some great insights.
- What is even programming? What is a function? an argument? What is state? What are types? - JS itself - How browsers work - JQuery (do people still use that?) - NodeJs - How backends work - How databases work
Then, the subsequent language, Java, was only different in patterns, paradigms, keywords, and frameworks (at least, at the amateur level I was going at). Args were still args, strings were strings, sure we had classes instead of functions here and there, but for a beginner it was close enough. Java, the second language, was far easier to learn. And so forth, with each language becoming progressively simpler.
I've had the order switched. I'd argue that you had an easier time. Why? Chrome Dev tools and loosely typed (avoids some beginner questions that'll have easy answers when you have a bit more experience). Also, NodeJS encourages exploring the commandline, Eclipse doesn't.
So many concepts dumped on you all at once. Before you even know what a function is, you have the entire DOM API dumped on you and is available in the global scope.
If you try to learn OOP in it, you have the choice of trying to grapple with the leaky ES6 class keyword or you get prototypal inheritance and `this` will come up.
That said, from a learner's perspective it's great: you have the entire DOM available to you instead of having to learn how to take the car of the cdr of a list and wondering how that has anything to do with building the next Airbnb/Uber of this world...
At least with Python/Ruby they commit hard to terseness / fluent interfaces so you have less syntactic noise to deal with, and Haskell commits hard on equational reasoning so you can pick up computation if you've come from a mathsy background. Or Scheme which is as close as you can get to "no syntax" as you can (IMO)
Maybe because I like JS made me enjoy teaching it as well :)
I mean it's great because it makes programming more accessible to non devs. But man is it unfortunate that JS was the language that ended up being the language of the web.
The browser is the ultimate interactive development environment. You can literally play with the page in situ. Akin to CAD and Excel (...or Emacs[0])
I don't know what would have been a better choice, but JS is not bad for a browser language. It had a rough childhood, but turned out to be a decent adult.
I still remember VB Script supported in old IE, but then there was JS and I just focused on that. It really made no difference to me since I was able to build cool stuff I wanted to. That brought me joy of creation and that's what mattered, not "that's not OOP like god set in stone".
Whatever enables people to be more involved in programming, I consider it as a good thing.
When I code VBA macros, I pile up all of the "End If" and other compiler noise in column 80, with comments.
Because I'd really rather be coding Python.
I find the experience very useful for my software career. It helps me learn new programming languages quickly. When I see functional operators, I remember Haskell.
I'd recommend to master one language in different paradigms. It pays dividends.
https://en.wikipedia.org/wiki/Comparison_of_programming_para...
Your first language, you know you don't know much. So you try out and play with it. If you're unlucky, you get stuck, don't get the books, software or help that would make you proceed (ie. machine code for C64), so would need something else or give up altogether. For some experiences, you just need to know the right people, be in the right circumstances.
On your second language, you probably already seen program listings in several languages already. You expect to get up and running after a few hours. This might happen if the paradigms are the same. For a completely different paradigm, you could need to grind it over time or start over as a beginner in that paradigm again.
Also, for many, learning new languages, frameworks etc. are not the fun part anymore, so get less emphasis on playfulness and spending time with it. When preference is on being productive, one might miss many big opportunities.
Some Devs I work with want to dabble with many tools and solve problems by picking (or creating) a new tool rather than learning how to solve problem with existing tool. They learn, and are talking about (and trying to get team to adopt) other languages all the time.
Personally, I want to totally master a small number of tools. (perhaps just my inability to master many). So, it's not that I find it hard to learn new lang. It's I'm unwilling to waste effort on it unless there is advantage. And to overcome the mastery I have attained after 25 years of Python that advantage has to be large. [btw Past langs include VisualBasic, Pascal, PHP, C, C++, and PERL. But only PERL did I use long enough for mastery]
Neither is obviously better/correct. Like I said, it depends on how the developer best works.
For example, there are typical mistakes when a C or Java programmer uses Python for the first time, I can tell somebody's history just by looking at what idioms they try to force on Python which shouldn't.
Example for C programmer writing Python:
for i in range(len(mylist)):
print(mylist[i])
Example for Java programmer writing Python:
Starting hello world with "class HelloWorld:". LOL You don't need to start with classes and objects in Python!The only language/platform I'm having difficulty with is Swift and MacOS (Cocoa)! It's a pile of ancient junk and 5 versions of a new language with absolutely turd documentation from the platform and a gigantic pile of "meh works for me". It feels like trying to run in moving sands with your eyes closed and your hands tied.
I'm only saying this to make a point: sometimes it's not the developer having a hard time as much as the ecosystem making it a living hell.
I also think many developers use a single language for work and don't have much time after work to learn another one.
Most other stuff is very similar.