Live data from Hacker News

Ask HN: Learning multiple languages vs. mastering one

news.ycombinator.com

121–130 of 137 posts

Re: Ask HN: Learning multiple languages vs. mastering one

#121
post #84

Earlier quoted context omitted.

Hey, someone found a golden hammer! Better throw out all those other tools, who needs 'em.

Programming is not carpentry. The best programming languages (IMO) are general-purpose, and the gains from being able to know a single language in depth and reuse the same tools and techniques across different domains outweigh those from using different languages in different domains.

Depends. Yes, learn a general-purpose language, and learn it well. But also, learn some other things well enough to be able to use them. Use them when they make the job easier.

For example, my main language is C++, and my second language is Java. But when the problem I have is picking snippets of text out of a text file, I reach for Perl, because Perl is far better at that than either C++ or Java. I don't want to "reuse the same [C++/Java] tools and techniques" in that domain - it's considerably more painful than using Perl to do it.

Re: Ask HN: Learning multiple languages vs. mastering one

#122
post #74

It's inevitable you will have multiple languages / platforms comprising your stack. Bash scripts for admin. Golang to write servers. Data science in Python. JS / D3 on the frontend. C# / Unity 3D modelling and scripting. Even low level C / Assembly if you need performance optimizations. I think mastery of cloud development and deployment is crucial going forward. Start experimenting locally right on your laptop with…

> It's inevitable you will have multiple languages / platforms comprising your stack. Bash scripts for admin. Golang to write servers. Data science in Python. JS / D3 on the frontend. C# / Unity 3D modelling and scripting. Even low level C / Assembly if you need performance optimizations. It's not at all inevitable. I would - indeed do - use Scala for all of the use cases you listed.

Data science?!

Re: Ask HN: Learning multiple languages vs. mastering one

#123
post #88

Earlier quoted context omitted.

I'll throw out my $0.02, which is C is a terrible language to learn. Much of writing "good" C revolves around knowing all the pitfalls to check for, then dealing with the archaic error handling mechanisms. Tomes have been written on the subject of proper error handing in C. > fundamentals of things like memory allocation, data types, call stacks, etc. remain a mystery to them. I don't think C is especially good at te…

Yeah I just disagree. I actually think Java is a terrible teaching language. Folks for whom Java is the closest they come to the hardware tend not to understand the internals of how computers actually work well enough to do things like understand where bits fit into bytes or what happens if you recast an int into a double without converting the underlying data. Many times that doesn't matter, but to me it's important…

Your argument seems more in the vein of "C programmers are smarter java programmers" while ignoring the actual discussion, which is C is not a good teaching language. Yeah, you'll learn some stuff by virtue of blindly running over the language's landmines. I don't consider trial by fire to be a great way to learn.

> It's things like understanding how an array of ints is laid out in memory and what happens when you treat it as an array of chars instead.

This is one of said landmines, as the size of both is architecture/compiler specific. The only thing you learn by stepping on this one is, "use fixed-width integers when you care about exactly how many bytes the value is."

Re: Ask HN: Learning multiple languages vs. mastering one

#124
As others have said, going "T-shaped" where you master a small number of languages and learn the basics on a much larger number is probably the way to go.

For language recommendations, it depends a little on what you're ready for, what cognitive load you can take on. If you need to pace yourself, focus on one or two paradigm differences at a time.

Want to "dip your toes" without giving yourself a ton of cognitive load? Try doing some work in C# - being familiar with Java, you should be pretty comfortable with its idioms, and can ease yourself into functional thinking if you're not comfortable yet. JavaScript and Python are good choices if you need practice with dynamically typed, interpreted languages. JavaScript is pretty much necessary at this point. If you're dealing with Big Data(TM) you may want to look into a functional language. Haskell is probably a good choice there, but F# may be worth experimenting with as well.

As for evaluating the languages, Project Euler is good, but I've personally found Advent Of Code more helpful for learning. Advent gives you sample input/output that is perfect for setting up unit tests, and the problems are less math intensive so you can really focus on the new language and what idiomatic code and architecture looks like.

Good luck!

Re: Ask HN: Learning multiple languages vs. mastering one

#125
In a multi core future only Java (C#) and C (C++) make sense because they share memory between threads. You can learn to dabble in JavaScript for single threaded web gimmicks. C++ only gives you streams, everything beyond that is over engineered.

So I would say: learn C!

All other languages should be avoided. Let the down voting begin.

Re: Ask HN: Learning multiple languages vs. mastering one

#126
post #84

Earlier quoted context omitted.

Programming is not carpentry. The best programming languages (IMO) are general-purpose, and the gains from being able to know a single language in depth and reuse the same tools and techniques across different domains outweigh those from using different languages in different domains.

Depends. Yes, learn a general-purpose language, and learn it well. But also, learn some other things well enough to be able to use them. Use them when they make the job easier. For example, my main language is C++, and my second language is Java. But when the problem I have is picking snippets of text out of a text file, I reach for Perl, because Perl is far better at that than either C++ or Java. I don't want to "re…

> For example, my main language is C++, and my second language is Java. But when the problem I have is picking snippets of text out of a text file, I reach for Perl, because Perl is far better at that than either C++ or Java. I don't want to "reuse the same [C++/Java] tools and techniques" in that domain - it's considerably more painful than using Perl to do it.

Not convinced. I used to work in a similar way (indeed I would've made a similar argument), using Java for a primary codebase and Python for lightweight scripting around it. But I found that it was possible to adopt a general-purpose language that did both of those well.

Re: Ask HN: Learning multiple languages vs. mastering one

#128
I don't know what you want to master with Java, it's pretty trivial language. So if you don't know something about Java, you definitely should learn it. The JVM and surrounding libraries are a thing, though. But Kotlin, Scala, Clojure for example all running on JVM. So you can learn new languages while learning JVM and improving your overall Java platform knowledge as well.

If you want to learn something, Scala is awesome. It's a very complex language, so learning it will make you a better programmer, even if you won't use it.

For practical purposes I like Kotlin. But Scala is good here too. Kotlin just clicked for me, I like almost everything about it.

Clojure is a good introduction into Lisp family. I think it's worth to learn it too.

Re: Ask HN: Learning multiple languages vs. mastering one

#129
post #122
post #74

Earlier quoted context omitted.

> It's inevitable you will have multiple languages / platforms comprising your stack. Bash scripts for admin. Golang to write servers. Data science in Python. JS / D3 on the frontend. C# / Unity 3D modelling and scripting. Even low level C / Assembly if you need performance optimizations. It's not at all inevitable. I would - indeed do - use Scala for all of the use cases you listed.

Data science?!

Oh yeah. Spark has lots of good aspects (though also some bad ones), and personally I find it much easier to think in terms of code with map/filter/aggregate/... than in terms of tables.

Re: Ask HN: Learning multiple languages vs. mastering one

#130
post #6

On a diffrent topic, I wrote a bit on depth vs. breadth (but it was more of a book topic than language): https://news.ycombinator.com/item?id=17128854 For programming languages it boils down to: know the abstract stuff across most/many languages, but drill down on a small amount of languages/frameworks to be more productive. I'd say: get to know Java and Python in-depth, select a few frameworks to know well (as langu…

When you want to "do Java without doing Java", it's good to use alternatives that have some present or like future adoption, such as Scala and Kotlin. You won't get that with Apache Groovy and Grails -- virtually no-one's upgraded to Grails 3 or started new projects in it, and the Grails 2 plugin ecosystem has almost died.
Post reply on HN