News for hackers. Stuff that matters.
Re:PHP is worth learning and using by echelon on Thursday November 18, 2021 @02:08AM (#29262858)
Here's a choose your own adventure for people new to the field. Pick something you want to build, then see which languages are the best suited. If you want to build several things, see which languages are the most recurring and versatile:

- Web frontend: Javascript/TypeScript

- Web backend: Javascript/TypeScript, Python

- Performant backend (where you manage threads and queues): Go, Java, Rust

- Machine learning: Python

- Command line scripting: Python

- Command line tools (binaries, eg 'ripgrep'): Rust, Go

- Mobile: Kotlin, Swift

- Systems/bare metal: Rust (discourage C/C++)

- Desktop games: C#, C++, GLSL, Rust (in ten years)

Mix and match.

The safest three to learn that give you the most flexibility are probably Javascript/TypeScript, Python, and Rust. You can build almost anything with those three.

Re:PHP is worth learning and using by herbst on Thursday November 18, 2021 @06:04AM (#29264145)
You can build almost anything with any language.

I've done shell scripts in PHP. Mobile development in Ruby, JS and haxe. Web development with Go. Nothing is stopping you, and if you know the language it is usually not to weird either.

Re:PHP is worth learning and using by pjmlp on Thursday November 18, 2021 @05:21AM (#29263947)
Rust is great, but if one is looking for a job in systems programming, C and C++ is what gets one hired, regardless of their flaws.

Recent example, while Android has adopted Rust for replacing their bluetooth stack, the newly introduced Android Games Development SDK focus on C and C++.

Or Microsoft, despite all their security speech, Azure Sphere OS and RTOS only support C on the official SDK, and the new WinUI components are all based on C++.

And naturally anyone wanting to contribute to the Rust compilers, most likely will need to brush up their C++ skills if they intend to mess with GCC or LLVM internals.

Re:PHP is worth learning and using by nicoburns on Thursday November 18, 2021 @05:47AM (#29264067)
> Rust is great, but if one is looking for a job in systems programming, C and C++ is what gets one hired, regardless of their flaws.

That's true, but as a beginner I feel like starting with Rust is a lot more accessible, and could help someone switch into C++ later.

Re:PHP is worth learning and using by pjmlp on Thursday November 18, 2021 @05:51AM (#29264092)
That I can fully agree on, after all it was learning systems programming via BASIC and Turbo Pascal, that made me adopt best practices in C and C++ from the get go.

So from that point of view, learning about lifetimes, modular code, and that bounds checking isn't evil are already good education stepping stones.

Re:PHP is worth learning and using by asddubs on Thursday November 18, 2021 @05:38AM (#29264029)
And even moreso for the embedded space
Re:PHP is worth learning and using by 3np on Thursday November 18, 2021 @08:56AM (#29265378)
I really would not discourage C, at all. Even encourage it, especially for embedded. It really makes you grok the lower levels in a way few other languages do, and it's still widely used.

C++, though, agreed.

Re:PHP is worth learning and using by BuckRogers on Thursday November 18, 2021 @03:26PM (#29270049)
I'll take anything on that list with static typing, and discard the rest. I've certainly enjoyed many of those languages but I wouldn't build anything with dynamically typed language unless I were forced to.
Re:PHP is worth learning and using by CyberFoxar on Thursday November 18, 2021 @03:53AM (#29263484)
You might also want to know a few languages were you're sure to get a job, and right now, it seems that Ruby on Rails and PHP are some really safe bets, compared to Python.

Sure, Rust is _fun_ but there's little demand for it right now in the market.

Re:PHP is worth learning and using by marcus_cemes on Thursday November 18, 2021 @06:47AM (#29264402)
Shoutout to Elixir/Phoenix for a (performant) backend.
Re:PHP is worth learning and using by cf100clunk on Thursday November 18, 2021 @04:17PM (#29270693)
This would ba a great Ask HN