5 ms·
> At least for juniors, I'm pretty sure the problem for a lot of them is they remember how much effort went into learning their first programming language and
by aleph_minus_one 3y ago
>
At least for juniors, I'm pretty sure the problem for a lot of them is they remember how much effort went into learning their first programming language and are assuming the second one will be just as much effort. They haven't realized how much of that effort went into general concepts that do translate to other languages, making it easier to learn more.
Programming languages have become ecosystems/biotopes. In this sense, learning another programming languages is about thinking how things are done in (often subtly) different ways in the other programming language, learning about the whole culture surrounding the other programming language, etc. There aren't so many transferable principles.
Because many programmers are not willing to put this effort into transferring into a different language, so much bad code is written by programmers who "never properly learned the way of thinking in this language/framework" and thus write, say, "idiomatic Java code" in C++ or "idiomatic Go code" in JavaScript.
- Izkata 3y agoYou're having trouble thinking at the level I'm talking about: variables, conditionals, loops, functions, etc. All of these were new concepts to us at some point. I'm talking about people who are new enough to easily remember the effort that went into learning those basic concepts on top of learning the syntax for their first language.
- aleph_minus_one 3y ago> You're having trouble thinking at the level I'm talking about: variables, conditionals, loops, functions, etc. Exactly my point: just to give some examples concerning your keywords: - In many cases, for loops (with an index) became unidiomatic. Instead foreach or range-based loops became the idiomatic way - In C#, for many cases, the idiomatic way is to use LINQ. The old style to write LINQ queries was to use query expressions, but it became out of fashion. Now, you typically use the method-based query syntax instead. - conditionals: there actually do exist programmers who argue that if expressions are code smell when you do object-oriented programming (google "ifless programming" or "anti-if programming"), since the idiomatic way in (class-based) object-oriented programming when what should happen depends on some state is to write a method. This thought has not become mainstream, though. On the other hand: for a related reason in Smalltalk, a programming language that takes object-oriented programming much more seriously than most other languages, there exists no "if" as part of the language; see for example https://www.quora.com/If-if-is-an-object-in-Smalltalk-how-is-it-defined/answer/Richard-Kenneth-Eng https://www.quora.com/If-if-is-an-object-in-Smalltalk-how-is... - functions: functions now often have become stateful (coroutines, methods, polymethods, closures, ...). On the other side, there exist programmers (often from functional programming) who argue that functions as they exist in imperative languages are not "pure enough".
- Izkata 3y agoYou're still thinking at too high a level. I'm talking about "what is a function", not "all the ways functions can be used".
- aleph_minus_one 3y agoIf you do consider "what is a function?" not to be a not quite subtle question, you end up with something that basically everybody knows who paid a little bit of attention in the 7th grade math classes.
- Izkata 3y agoAnd this just reinforces what I'm talking about: People who have done this for a while have forgotten what it was like. I was a teacher's assistant in introductory programming classes for several years in college and I assure you people new to programming do have to put in effort for all the basic things I listed above, not just functions.