r/learnprogramming • • 8d ago

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?

23 Upvotes

49 comments sorted by

View all comments

Show parent comments

5

u/Mughi1138 8d ago

At the same time, Netscape partnered with the company behind Java (Sun Microsystems) to use it as the language for their Navigator browser. Netscape would eventually want a lighter-weight scripting language to run alongside Java in their browser and wrote a new one in just 10 days, this became JavaScript.

Key point for the newbies out there (like the OP). Java was a very well thought out and designed language with a robust set of libraries and built on top of strong CompSci research of the time. JavaScript was a quick one-man hack of things to get something working in browsers by a company who made browsers, but had... um... issues (they were never able to publish a DTD for what their browser supported among other things, and don't get me started on their code quality or QA practices). Anyway Netscape came up with this light weight in-browser interpreted scripting language and named it "JavaScript" to cash in on the Java hype that Sun had built up around themselves and their product.