Hacker News new | ask | show | jobs
by AnimalMuppet 2953 days ago
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.

2 comments

>But also, learn some other things well enough to be able to use them. Use them when they make the job easier.

I've found that even if I don't need to use a language after I've learned it, the skills and experiences I pick up while learning it improve my code as a programmer.

I've learned how to write fast code in C; learned how to write flexible template code in C++; appreciated the "batteries included" standard libraries of Python; wrote concurrent code in Go; used sum types and functional programming in OCaml.

My friend wrote an article[1] that says there is still no silver bullet for programming, and I agree with her.

Perhaps even if you think it is better to master a single programming language, you might better master it by seeing how other languages approach the same problem.

[1]: https://chameleon.kingdomofmysteries.xyz/articles/harmful/st...

> 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.