• 0

Which Is Best C++ or Java?


Question

19 answers to this question

Recommended Posts

  • 0

If it is only a choice between the two and you are having a cold start from absolutely no code experience. Java.

 

Use something like BlueJ - https://www.bluej.org/ - as a learning aid and it will teach you basics plus object orientation concepts. There is a textbook you can use with it too

https://www.amazon.com/Objects-First-Java-Practical-Introduction-dp-1292159049/dp/1292159049?&linkCode=ll1&tag=camie06-20&linkId=0683199be58fe4b45e129ef3d84cc291&language=en_US&ref_=as_li_ss_tl

 

If you already understand O-O or have some language experience, BlueJ will be too basic for you, but in general Java will allow you to progress to C++, C# and others fairly easily if that is where you want to go. If you want to wind up as a web developer though, neither especially good starting points really.

  • Like 2
  • 0
On 18/07/2023 at 11:04, Ravikant said:

If you ask beginners to learn a programming language then what would you suggest?

C#, PowerShell, Python, Rust, or Julia... definitely not C++ or Java.

C# looks like Java but has real-world contextual uses.

Rust has been made to replace C and C++.

Edited by Fleet Command
  • 0
On 19/07/2023 at 04:56, Fleet Command said:

C#, PowerShell, Python, Rust, or Julia... definitely not C++ or Java.

C# looks like Java but has real-world contextual uses.

Rust has been made to replace C and C++.

But rust will never replace c and c++, specially in embedded devices. It can coexist though but I doubt it will ever replace it.

  • 0

Guys, come on, I think we can be a little bit more friendly with someone beginning the path.

 

On 18/07/2023 at 09:34, Ravikant said:

Hello,

If you ask beginners to learn a programming language then what would you suggest Java or C++?

 

Thanks

Ravikant, we would love to know what is your ultimate goal with learning a programming language:

  1. Is it to build a web app?
  2. Is it to work in AI, Data Science and Machine Learning?
  3. Is it to do some game development?
  4. Is it to make a desktop application?
  5. Is it to work on Internet of Things (IoT)
  6. Is it to work on hardware

 

Depending on what you want to do, there will be a programming language suited for the task.

Even though all of the most well-known will let you work on those things.

  • 0
On 19/07/2023 at 17:20, Arceles said:

But rust will never replace c and c++, specially in embedded devices. It can coexist though but I doubt it will ever replace it.

Device drivers and embedded devices are primary targets of Rust. It certainly can replace C and C++ there. Whether it does depends on our adoption.

  • 0
On 19/07/2023 at 10:37, Fleet Command said:

Device drivers and embedded devices are primary targets of Rust. It certainly can replace C and C++ there. Whether it does depends on our adoption.

Yeeaaaah no. I work a a very big comany regarding all sort of embedded and safety critical devices in automotive. They are not going to throw away years of testing and certification (ASIL) because of a languaje that at best is equal to c.

  • 0
On 19/07/2023 at 20:26, Arceles said:

Yeeaaaah no. I work a a very big comany regarding all sort of embedded and safety critical devices in automotive. They are not going to throw away years of testing and certification (ASIL) because of a languaje that at best is equal to c.

I worked in the auto industry too. That means I know that large company of yours if you name it. I know their procedures too. It's not up to them. They'll use whatever programming language IATF  mandates. IATF already has a migration plan to Rust, albeit their target is 2030. ASIL is the main reason for the move. C is not memory-safe. Rust is safe. ASIL concerns itself with safety.

Rust isn't equal to C; it is orders of magnitude superior.

  • 0
On 19/07/2023 at 12:28, Fleet Command said:

I worked in the auto industry too. That means I know that large company of yours if you name it. I know their procedures too. It's not up to them. They'll use whatever programming language IATF  mandates. IATF already has a migration plan to Rust, albeit their target is 2030. ASIL is the main reason for the move. C is not memory-safe. Rust is safe. ASIL concerns itself with safety.

Rust isn't equal to C; it is orders of magnitude superior.

Well that is for us to see in 2030 as you mention. Even if it is the case ASIL is just one example. 2023 and there are nowhere near the plans you menton on sight, not even for the 2029 projects already contemplated here. And I would like for you to point a document in which the IATF says that, as I cannot find one in the first google page at least using "IATF rust 2030".

  • 0
On 19/07/2023 at 22:04, Arceles said:

Well that is for us to see in 2030 as you mention. Even if it is the case ASIL is just one example. 2023 and there are nowhere near the plans you menton on sight, not even for the 2029 projects already contemplated here. And I would like for you to point a document in which the IATF says that, as I cannot find one in the first google page at least using "IATF rust 2030".

If you work in the auto industry, you must know the correct place to search is the LOC document system. I'm not surprised it didn't show on a Google search, though. It's not newsworthy. Barely any of our accords appear in the news.

Be that as it may, I answered the question, "What programming language do you suggest the beginners to learn?", not "What programming language pays the most in the auto industry."

  • 0
On 19/07/2023 at 12:51, Fleet Command said:

If you work in the auto industry, you must know the correct place to search is the LOC document system. I'm not surprised it didn't show on a Google search, though. It's not newsworthy. Barely any of our accords appear in the news.

Be that as it may, I answered the question, "What programming language do you suggest the beginners to learn?", not "What programming language pays the most in the auto industry."

Rust would be a big news and so much that it would appear on google. Even autosar results (albeit not for classic) appear. So no, there is no indication of rust being targetted for 2030.

  • 0
On 19/07/2023 at 23:14, Arceles said:

Rust would be a big news and so much that it would appear on google. Even autosar results (albeit not for classic) appear. So no, there is no indication of rust being targetted for 2030.

You claim to work for a large auto parts supplier but you don't even query our native LOC. What could possibly be the reason? I wonder...

What large company did you say you work for?

Edited by Fleet Command
  • 0
On 19/07/2023 at 13:56, Fleet Command said:

You claim to work for a large auto parts supplier but you don't even query our native LOC. What could possibly be the reason? I wonder...

What large company did you say you work for?

I do not have to tell you my credentials here, I however can tell you that I work for one of the IATF associate company. I do not have credentials to check said document but I can ask for them. Still, directly loking ant our product portfolio for 2029 and asking also my managers I can tell that there is no rust on sight.

  • 0

I think for super small apps C++ can be competitive with Java. But once the app gets bigger and starts using many threads you see that C++ apps usually cannot compete with Java apps in terms of performance and stability (bugs). So you see that Cassandra is many times faster, in realistic cases more than 25x faster than mongoDB. Cassandra is Java and mongoDB is mainly C++

Of all the languages I know, I notice that C++ apps often have the most bugs, usually significantly worse than C and Python apps. I think this has to do with the design and syntax of the language, which is one of the worst in existence. But further, it is also true that C++ programmers are often not the best programmers which exacerbates the problem.

If you want to know what are the best languages purely in terms of developer productivity, design of the language, features and performance, I would recommend the following languages

1. Haskell

2. Common Lisp (and similar languages like Clojure and Scheme)

3. Scala

4. Nim

5. Pascal

6. Zig

7. Julia

The reasons why Haskell is better than most other languages:
1. much higher productivity than e.g. Python and most other languages
2. far fewer bugs on average than e.g. Python and C
3. perfect for parallel processes and multi core processors
4. in reality Haskell apps often have similar performance to C apps, since you are usually limited in time. with Haskell you have many times more time to optimize performance
5. very powerful capabilities. for example, Julia's multiple dispatch is one of the best out there. But Haskell has something that is actually even more powerful than Julia's multiple dispatch. From a purely technical (not including libraries) point of view, there is nothing better suited for Data Science than Haskell.

  • 0

When I was in college the first programming course I took was c++ followed by java. C++ was significantly easier for me to learn although that was probably due to my Java professor not speaking any english.

Frankly I wouldn't recommend either of these languages to someone new to programming, I would recommend they take a look at https://codecademy.com and start with whatever looks like it does what you want it to.

 

I highly doubt the nuances of performance, memory management, etc. would be important to a new programmer who is still getting the hang of programming logic and syntax.

  • 0

When I was in engineering school (a little over 10 years ago), I spent a lot of time writing Java code.   I guess it's good for learning the depths of coding, but I don't use it in my professional life.  I also had a lot of embedded C classes, and I absolutely use that.  I highly recommend C, if you're interested in the embedded hardware route.
My software engineer colleagues use Python for scripting and also for simple PC apps.  Colleges seem to be focusing on Python more, which is great.  For more complex PC applications, C# and .NET are good choices.  For mobile app development, I guess you'll use whatever is convenient for iOS and/or Android.

Overall, it depends on what applications you want to get good at, whether it's hardware, software apps, mobile apps, etc.  I definitely don't recommend just focusing on Java though, if you even bother with Java at all.

If I was just beginning, here's what I'd start with:

https://www.coursera.org/specializations/coding-for-everyone
https://www.coursera.org/specializations/python

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • WhatsApp slams Isreali firm, NSO Group, for trying to spy on its users by David Uzondu WhatsApp has come out accusing Israeli cyber-intelligence firm, NSO Group, of deploying a fresh wave of highly targeted "spear phishing" attacks against users, which its security teams successfully thwarted. The Israeli firm, according to WhatsApp, ran this operation like its usual one-click phishing campaigns, trying to get people to click malicious links that lead them to external sites. To coordinate the campaign, the spyware vendor created fake test accounts and groups on the messaging app. WhatsApp said it is sharing the specific malicious domains, ikhwancast[.]com, ghazacast[.]com, and fr24cast[.]com, because potential victims need this data to check if they were targeted across other messaging systems or email platforms. The NSO Group is infamous for creating and selling Pegasus, a military-grade commercial spyware capable of silently compromising smartphones simply by sending a message or placing a missed call via apps like WhatsApp or iMessage. Users do not even have to interact with the incoming notification before the infection takes hold. Once Pegasus manages to break in, the spyware harvests private data, letting operators read private messages, emails, photos, and documents. It also tracks precise GPS locations, records keystrokes, activates the device's camera, and monitors live microphone audio. Independent investigations by cybersecurity watchdogs like The Citizen Lab and human rights organizations like Amnesty International have proven that governments use this software to track humanitarian workers, journalists, diplomats, and political dissidents. These findings directly contradict NSO Group claims that clients use the technology to spy on criminals and terrorists only. In late 2021, the U.S. Department of Commerce added the firm to its Entity List, effectively banning the vendor from buying hardware and software from American tech companies. WhatsApp said in its blog post that the spyware vendor violated a permanent court injunction with this new spear-phishing campaign. This injunction, which took effect in 2025, strictly prohibited NSO Group from targeting WhatsApp and its users. The platform is now asking a federal court to hold the firm in contempt.
    • It would be surprising if even 3 year old Apple Watches (and not SE models at that) cannot run watchOS 27. Granted, it doesn't mean it would work as well. We'll see.
    • Apple launches new website for parents and a revamped Screen Time experience by Aditya Tiwari At WWDC 2026, Apple announced new parental control features for iOS 27, iPadOS 27, and macOS 27 to keep kids' device usage in check and keep them safe online. As a parent, you'll get access to a simpler setup experience, Ask to Browse, Time Allowances, and a redesigned Screen Time. You'll be able to pick exactly which apps your child can access on their device, choosing from just a few essential apps, a curated set, or the apps you feel are appropriate. There will be an option to gradually add more apps. Ask to Browse is a new feature that requires kids to request permission before visiting a new website in Safari on iPhone, iPad, or Mac. You can also turn on a setting that requires your kid to ask for approval before connecting with an unknown contact via Messages, FaceTime, or the Phone app. You can manage your child's screen time more effectively with Time Allowances that work across categories, including Games, Entertainment, and Social Media. You can set time limits based on your kid's age and get suggestions informed by expert research. Speaking of expert guidance, Apple added that it's working with the American Academy of Pediatrics (AAP) to adapt its Family Media Plan to create a guide parents can refer to when using Apple products. Moreover, the company has also set up a new dedicated website, where you can find tools, resources, and answers to common questions around parental controls and child safety. Apple also allows parents to set daily schedules to manage screen time, configuring access to different apps at different times of the day and across the week. Overall, the Screen Time section has been revamped and provides a bird's-eye view of your kid's average device usage and most-used apps. "For example, to help protect important family moments, parents can quickly limit access during meals, outdoor play, and other times that deserve full attention. If kids need a little extra time to finish something in an app, parents can also easily extend access," Apple said. Apart from these, Communication Safety has been updated to block gore or violent content when detected in shared images or videos. The feature already blurs nudity in Messages and FaceTime calls, and is enabled by default for users under 18.
    • They already threw the Ultra 1st gen under the bus? It really feels like someone screwed up, and that advanced AI features will only be available on the list above but someone screwed up and said that Watch OS 27 in general will only be available for those models. I think they will pull it back. I did see someone also put a snap shot of their series 9 watch being offered the watch os 27 beta. As the backlash online is already in full swing.
  • Recent Achievements

    • Very Popular
      Captain_Eric earned a badge
      Very Popular
    • One Month Later
      amusc earned a badge
      One Month Later
    • One Month Later
      DJC50PLUS earned a badge
      One Month Later
    • Week One Done
      DJC50PLUS earned a badge
      Week One Done
    • Proficient
      Eric Biran went up a rank
      Proficient
  • Popular Contributors

    1. 1
      +primortal
      513
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      ATLien_0
      87
    4. 4
      +Edouard
      84
    5. 5
      Steven P.
      80
  • Tell a friend

    Love Neowin? Tell a friend!