1
C-sucks
2y

Java vs C++
which one is most secure?

Comments
  • 20
    Depends on the dev
  • 9
    Judging security just based on the language would be quite naïve, I'd say that if both projects were written as secure as possible, C++ would give you a slight edge due to not relying on a VM to run on.
    But as @Voxera said, the biggest security hazard is the dev.
  • 5
    Define secure
  • 4
    What is this question even about ?

    You now ask the same thing as : Apple vs Orange, which one taste like a cherry ?

    Java has memory management, C++ you as dev have to manage it manually.

    Java is only object-oriented programming, C++ supports both procedural and object-oriented programming.

    What security are you talking about ?
  • 0
    @PonySlaystation you can configure SecurityManager to protect jvm from tempering. Noone does that tho... But still, you have an option to
  • 0
  • 11
    Java makes it hard to shoot yourself in the foot.

    C++ happily lets you shoot in your foot - but with minimal runtime overhead!
  • 2
    Practically, you will never have to choose between C++ and Java.
    The framework/engine/platform will determine that.
    But if you would actually have to choose for a new project and you want to be as secure as possible, then the question would rather be "Kotlin or Rust?".
  • 2
    Either can be insecure if you fuck up
  • 1
    @Ranchonyx There are differences in languages in how easy it is to fuck something up, how catastrophic the fuck ups can be and how well the fuckup can be identified in advance.

    That is what security in a language means for me.
  • 1
    @Lensflare You don't say
  • 3
    The dumbass writing the code > the languages insecurities
  • 3
    The only secure languages are non-Turing-complete because they don’t allow you to do anything.

    The only secure code is code that doesn’t run.
  • 3
    @Root Regarding turing-completeness, isn't there a lamguage implementation where they use only the "mov" instruction?
  • 2
    @Ranchonyx more or less, its a move and bit change in one op if I remember correctly.

    https://en.m.wikipedia.org/wiki/...
  • 1
    What @Voxera said.

    It’s crazy how little you need to make it all work.
  • 2
    @Voxera it seems like there is more work involved in making something not turing complete rather then complete.
  • 1
    @Lensflare Makes you wonder about the nature of the universe. Maybe it’s designed to produce complexity from simple rules. It would certainly be more interesting that way.

    I do hope we’re in a simulation. Sorta. Maybe.
Add Comment