Change the way you think about programming problems: Haskell
Enterprise Development: Java. Maybe Scala?
Apple Ecosystem: Swift (and actually, it seems like a kind-of pleasant language for general server-side use).
Low-level: C++. Or maybe Rust (although not yet given that a serious whirl)
Edit: oh, if you're broadly happy with JS, Typescript is worth a look and might (depending on your circumstances) be something you can start using day-to-day fairly easily.
I personally think, given Node and PHP proficiency, a static functional language may provide more growth in skill. It's a new paradigm as well as typing discipline.
If you're a pragmatist it's still a good choice. You can bring FP concepts to C, Java, whatever later on too.
Curious what these are. The only thing I retain back in dynamically-typed land is "argh I wish this was statically typed!"
I thought this was the way of the world until I got deeper into typed languages, where you learn why not doing that is good. Type envy still stings though.
This is just polymorphism, isn't it? Why is this not a good thing?
The great thing about statically-typed languages is that they help you write your software instead of giving you a blowtorch and saying "have fun". I know a lot of people find that a bit patronizing, but I'm not one to turn down help (especially from a bot that won't call me on it later).
I'm also not against static typing, but I am against thinking it's a silver bullet. Consider this: `function inc(x: number): number { return x - 1; }`. It passes the type checker, but the blow torch still burned you.
I'm presently trying to make this a little better in my own team's codebase by trying to introduce Flow [0]. There are a lack of definitions for the monadic libraries we use which I'm presently remedying. It's not pretty -- and my kingdom for OCaml or GHC! -- but it's better than not having it.
Knowing the fundamentals will help you learn to structure code and think clearly about abstractions. It's the difference between merely using something and understanding how it works. In the latter case you have the power to exploit it.
C / C++ if you're looking for something with wide applicability to learning other languages more quickly.
I came here looking for this. I learned C as my first language [1]. And I learned an immense amount about how things like memory management and type casting and things like that work. It is a foundation that has helped me learn other languages much more quickly.
Although the question is for learning "only one" and I'm not sure C or C++ is a great "only" static typed language.
[1] using "Sams Teach Yourself C in 24 Hours" which I got in an actual bookstore and came with a copy of the Borland C compiler :)... ah the memories.
Nowadays most of my work is PHP and Node.js, but if you know C, you will have no problems learning PHP.
1. https://www.amazon.com/All-One-Desk-Reference-Dummies/dp/076...
If you want to focus on backend technologies, I suggest Java.
If you have other goals, I think there are a lot of other great answers. :)
Plus, speaking from personal experience, learning Java first and then learning C# is probably going to be a positive experience, whereas doing it the other way around feels like going back ten years in time.
For back-end development I would orient towards Golang. Its approach to concurrency makes efficiently utilizing multiple cores a breeze; something that is not quite so simple in Node/PHP. As well, it's common that you'll find yourself able to get more out of individual machines - this will allow you to get more money out of said machines and, as a second-order effect, can delay the onset of scaling concerns. As an aside, as a primarily JavaScript developer, I do have to admit Go has a very impressive stdlib.
For taming your tools but not changing ecosystems I would recommend looking into TypeScript. It just being a superset of JavaScript means you can do incremental adoption while still enjoying all of the JS knowledge you've built to date.
For learning new paradigms I would either recommend Haskell for a "strict functional" path or Rust for an "immutable/non-racy" approach. Both languages take the concepts to a pretty extreme level and may feel overwhelming at first, but they can be brought back to your existing back-end development skills to help enhance the maintainability of your code.
For something between concurrency and functional programming I would recommend Erlang/Elixir - though I do so only from recommendations and not from any meaningful experience with either. Might be up your alley and definitely worth at least considering for your "one language".
If your goal is getting a job, looking around in your technical and geographical area and see which languages are used most, which pay the most, which will result in the most interesting jobs.
If your goal is purely educational, try Haskell: you'll learn about functional programming and use a much more powerful typing system than most languages provide.
C.
C is high level assembler and manipulating assembly is the foundation of computer science.
What C provides over assembly is...type safety. Why is type safety useful and important? Bad assembly.
Why is a compiler useful and how do you use a compiler to prevent bugs? C compilers make understandable and idiomatic assembly and strong types make it easy to prevent lots of defects that are caused by imprecision and ambiguity.
From an employment perspective, data structures and many algorithms are easiest to grok and express with pointers. Most of the major programming companies will ask whiteboard questions in interviews and many of those questions test for proficiency with pointers.
Much of the key open source systems works are implemented in...C.
The other languages may give you a temporary advantage but I think only C gives a coder the foundational work for a long and successful programming career.
C# because I love it after experimenting with a lot of languages ( VB.net the first and c# second though, I'm a bit biased) and typescript because it will improve your current nodejs writing.
Both are closely aligned and I think it's perfect in your case. Start the next project with typescript and change to c# later for another project.
Also, there are a ton of projects to learn from. But other than that ( a lot of languages have great examples), there is a lot of employment in c# and it seems to be a sure bet future-wise.
Ps. CMS -> Umbraco. Webshop -> Merchello. It's like woocommerce and WordPress but easier and cleaner
Are you planning on making an IOS app?
Do you want to make a back end server?
I picked up Go for my side project for the server side, and it has been a great learning experience.
I think if I were to do a mobile app, I might try Swift.
Java requires a whole app server which is more of a pain to setup. (generally speaking for web dev, think Tomcat, JBoss). It's way more verbose and you really need to rely on the power of an IDE to help code for you, importing class libraries, etc.
Spend a few hours with each, they're very different. Coming from Node/PHP you should be able to pickup Golang faster.
Spring Boot and Dropwizard makes this dead simple, a single .jar file with everything you need to run your app.
I'd also submit that few concurrency libraries are as battle-hardened as java.util.concurrent.* at this point.
If you want to pick up a language as quick as possible then C# or Java. Either choice is fine.
C# has a lot of potential in the future now Microsoft are making it more open with multi-platform .NET but it is still a way off IMHO.
Java is used everywhere and while it isn't all that "cool" it does work well, is easy to write, debug and maintain. Plus I actually quite like JavaFX. It allows me to make a nice looking UI very easily. As great as C#/.NET is you can't use C# for any decent GUI stuff outside of Windows just yet.
If you want to get a job then look at what jobs in your area are using.
Useful for writing back-ends? Java. (Maybe Go.)
Useful for learning about type theory? Haskell.
Great language that has stood the test of time and runs on Windows, Linux, OSX, and sometimes Android and IOS.
There are many other languages that will teach you valuable things; buy if you're asking about one, or at least the first one, C# is definetly the best choice. When you'll come from it to Haskell or Rust, you will already be equipped with a habit for OOP and static typing, and will not face a frustrating cognitive overload.
If you want to stay in the computer science realm, I would recommend C#, C++, or Go. All three have the critical mass to be dominant languages in the next decade.
If you mean the engineering practice of turning specifications into machines then there are definitely better languages for that.
F# is similar to oCalm, still can do the things C# do, still you can use C#, still you are using .NET.
That is a lot of plus!
The main downside is the smaller job market.
----
BTW if you use PHP/JS, C# will not teach you much. Is also "OO" and much code around, specially old or coming from the corporate world is not eye opener.
PHP/Js are less well designed languages, that encourage and celebrate bad practices... but most decent developers learn to workaround that and coming to other languages will look at first like "same".
Require some study and effort to see how much C# is better.
In contrast, F#, Pascal, oCalm, Haskell, Rust, etc will open your mind and increase your skills, because will move you out the comfort zone.
Kotlin comes in second place if you like Android and their mobile ecosystem.
If you don't want some of those attributes, then Rust probably isn't the best answer for you.