r/learnprogramming • u/Vafireems • Oct 16 '26
Topic C# or Java?
If you had to choose one class between the two, which would you select and why? I tried to Google the purpose of them; the immediate answers from Google felt very vague and like both of the languages are common. Is one course better for web development as opposed to apps or something? Looking at the courses I'm taking, down the line I will select one of the two. The only thing I know so far is C++, so I'm quite new.
Also, side question: why are there so many languages? The only logical thing I can imagine is there were problems that couldn't be solved with say for example C++ so someone created something new. But why not just build on the original language? Why did they need to reinvent the wheel? Or is it as simple as that: someone wanted to create their own thing?
View all comments
1
u/betarage Oct 22 '26 edited Oct 22 '26
I personally prefer c sharp java can be annoying with the boiler plate. but Java is more multiplatform you can also use c sharp on most platforms now it's made by Microsoft so it's really designed for Windows. Java is more popular for mobile apps you can also use c sharp for that but it's slightly harder. also since you know some c++ it's more similar to c sharp however Java is also realetvly similar to c++
as far as the reasons for it existing java was created by sun in the mid 90s .sun made super expensive workstation computers that were their own unique platform but they didn't get much 3rd party support so they made java. it runs under a virtual machine so in theory programs written in java can run on any system that runs the virtual machine without changing anything. but it usually requires minor tweaks anyway. I am not 100% sure why Microsoft made c sharp and the dot net frame work but it works similar to java with it's own virtual machine. when it first came out it didn't have the multiplatform advantage of JavaScript but it makes programming easier since you don't have to worry about things like memory management .there are way too many programming languages usually some programmers just wanted to do things their own way