C++ or java

Discussion in 'Programming/Html' started by Shadowsoldier, Jan 26, 2011.

  1. Laykun

    Laykun Ancient Guru

    Messages:
    3,208
    Likes Received:
    0
    GPU:
    2 x EVGA GTX670 4GB
    It's really a matter of portability and ease of writing vs. speed and flexibility. You can actually use the JNI (Java native interface) to run performance critical code in C++ for your java application, but this obviously takes away from the portability aspect. I work the majority of my time with Java, but at the end of the day I prefer C++ due to it's flexibility.

    If ease of writing is something you're after and you're not particularly concerned about your code running on different machines then I might suggest C#. This language basically writes itself within Visual Studio and in my opinion is much more modernised than Java with some much smarter features (<3 delegates). It also comes with bindings to system APIs like DirectX. The only thing you have to deal with is making sure the user has the .NET runtimes installed to run your program. Under Linux you can use Mono to run C# code.

    http://www.mono-project.com/Main_Page
     
  2. gamerk2

    gamerk2 Ancient Guru

    Messages:
    2,108
    Likes Received:
    1
    GPU:
    NVIDIA 570 GTX 1.2 GB
    ^^ I LOVE C#, its a very clean and effective language. Makes MFC pale in comparision...

    Anyways, I'm still trying to figure out how C++ isn't portable; its not like you're forced to use MFC or Windows calls...[this will be farther enhanced when C++ FINALLY gets its own native threading API, instead of relying on OS calls...]
     
  3. Laykun

    Laykun Ancient Guru

    Messages:
    3,208
    Likes Received:
    0
    GPU:
    2 x EVGA GTX670 4GB
    Of course you can use something like MinGW, but when you compile the binary it's either for Windows, Mac or Linux. Also when using C++ window management can be a hassle and you'd probably have to use something third party and cross-platform like WxWidgets. With a Java 'binary' it only needs to be compiled once as the virtual machine that runs it is the same across all platforms with native window management functions. It's the small things.
     
  4. deathvirus

    deathvirus Ancient Guru

    Messages:
    4,502
    Likes Received:
    2
    GPU:
    RTX 2070 MaxQ 8GB
    If you are interested in multi platform compatible apps then go for Java, else for the best of windows go for C# or C++ .. At work i'm into JEE so my vote goes for this just for its simplicity once you know the basics .. plus the IDE's are catching up pretty quick. With things like annotations and stuff you focus more on the logic than configuration.

    Java 7.0 is on the horizon and its a pretty major release in term of feature and performance improvement.

    PS : Netbeans and Eclipse (through plugins) provide an UI for building the GUI for desktop applications just like Visual Studio. Netbeans even generates the majority of the code simply by right-click and add feature ..
     

  5. gamerk2

    gamerk2 Ancient Guru

    Messages:
    2,108
    Likes Received:
    1
    GPU:
    NVIDIA 570 GTX 1.2 GB
    Again, I see more developers using languages like Objective-C as opposed to Java for multi-platform development. And to be fair, Java has some of the same pitfalls C has (using = for asignment and == for equality being one of the more notable examples, using Integers for enumerators was another).

    And I also note that Cx0x will be released within a year or two, which will greatly enhance the C syntax (now with an acutal THREADING library! Took long enough...)

    Where I work, if an applications lists Java as being the primary language they know, we throw it out. Java hides so much from the programmer, we know from experiance that the minute they use any other language, the world blows up.
     
  6. allesclar

    allesclar Ancient Guru

    Messages:
    5,694
    Likes Received:
    110
    GPU:
    GeForce GTX 1070
  7. lmimmfn

    lmimmfn Ancient Guru

    Messages:
    10,450
    Likes Received:
    125
    GPU:
    AorusXtreme 1080Ti
    Objects should be compared using .equals() and for the problem with assignment over equality the correct form is if( constant==variable ), is you make a mistake it wont compile, i.e. if( null=x ).

    Enums are interchangeable with integers as the ordinals so i dont see what the issue is there.
     
  8. gamerk2

    gamerk2 Ancient Guru

    Messages:
    2,108
    Likes Received:
    1
    GPU:
    NVIDIA 570 GTX 1.2 GB
    For those interested:

    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

    As I said, Java is gradually slipping, and the scripting languages are picking up steam. Objective-C is doing well, partly because its one of the three languages Apple is currently supporting.

    Although, Assembly DID come in at 15th on the list; kinda thought it would at least be trailing Ada...
     
  9. TruMutton_200Hz

    TruMutton_200Hz Ancient Guru

    Messages:
    2,760
    Likes Received:
    0
    GPU:
    820M/2GB
    ^ As a matter of fact I already debunked that stereotypical amateur's remark (no pun intended) in my first reply lol. The real reason why the Java language appears to be slipping away on TIOBE is because the Java technology has been evolving in such way that people have been getting more and more occupied with configuration tasks than the actual writing of lines of Java code. The thing that's allowed this to happen is what's called code reuse, obviously.
     
  10. Exodite

    Exodite Ancient Guru

    Messages:
    2,008
    Likes Received:
    202
    GPU:
    Sapphire Vega 56
    With that attitude I'm impressed you're able to get applications at all.

    I could make a similarly "compelling" argument...

    If an application lists C being the primary language they know, it should be thrown out. C exposes so much to the programmer that the minute they're asked to write abstracted, re-usable and solid code we can safely assume the world blows up.

    Moreover, who lists programming languages known in a work application? If you have an actual degree in software engineering it's implied that you're able to learn every tool you'll need to work in that field anyway.

    That's the entire point of such a degree after all.
     

  11. gamerk2

    gamerk2 Ancient Guru

    Messages:
    2,108
    Likes Received:
    1
    GPU:
    NVIDIA 570 GTX 1.2 GB
    ^^ Funny, considering that you can apply that same logic to any other language on the list [sans assembly]. The only difference is instead of relying on a VM, you just need to recompile for the target platform.

    So...no.
     
  12. Exodite

    Exodite Ancient Guru

    Messages:
    2,008
    Likes Received:
    202
    GPU:
    Sapphire Vega 56
    Which would be my point, aside from using the word "logic" in the argument in question.

    Namely that your company's stance on this is nothing but a, poorly argued, ass-umption.

    Every language (well, almost) has its place. Making assumptions based on individual preference is just that, assumptions, and really says a lot more about the person making the assumptions than anything else.
     
  13. Laykun

    Laykun Ancient Guru

    Messages:
    3,208
    Likes Received:
    0
    GPU:
    2 x EVGA GTX670 4GB
    He is right though, if you have a degree in software engineering then you can basically learn any new language / API right off the bat as that's what you're taught to do.
     
  14. lmimmfn

    lmimmfn Ancient Guru

    Messages:
    10,450
    Likes Received:
    125
    GPU:
    AorusXtreme 1080Ti
    yep, pretty much what i said a while back, the language is just a tool, its the design that is important and the OO languages are better at learning design and java is the easiest to learn from the OO set.

    Wouldnt bother me if i had to implement a project in Java, C++ or C#, i know how to design so picking up a new language is just a matter of reading the docs and the differences in semantics and away you go. In fact it only took me 2-3 hours from installing C# to writing a program configure my multiple displays for gaming with softTH
     
  15. Laykun

    Laykun Ancient Guru

    Messages:
    3,208
    Likes Received:
    0
    GPU:
    2 x EVGA GTX670 4GB
    Heh, if you're using Visual Studio C# pretty much writes itself.
     

  16. allesclar

    allesclar Ancient Guru

    Messages:
    5,694
    Likes Received:
    110
    GPU:
    GeForce GTX 1070
    this, choosing to use a specific type of programming language is one thing, denying work because its not written in your "favourite" or "companies" language is stupid and narrow minded.

    being someone with a degree in programming, c++,c#,java, sql, xml, php, c, the list goes on, they are all similiar in many ways.
     
  17. lmimmfn

    lmimmfn Ancient Guru

    Messages:
    10,450
    Likes Received:
    125
    GPU:
    AorusXtreme 1080Ti
    not if youve the crappy free version and youre spending most of your time reading the libraries online, i agree though proper IDE would have made it a lot easier but i was too cheap as i just wanted it for 1 program.
     
  18. allesclar

    allesclar Ancient Guru

    Messages:
    5,694
    Likes Received:
    110
    GPU:
    GeForce GTX 1070
    tut tut, thats why it pays to be at uni sometimes, latest version :)
     
  19. lmimmfn

    lmimmfn Ancient Guru

    Messages:
    10,450
    Likes Received:
    125
    GPU:
    AorusXtreme 1080Ti
    lol, long time since i finished my BSc in Comp Science :), i could have actually got a copy cheap but ive no time recently to mess about at home so its on the back burner for a while until i can get some free time, more interested in doing a mobile game for fun tbh :)
     
  20. Laykun

    Laykun Ancient Guru

    Messages:
    3,208
    Likes Received:
    0
    GPU:
    2 x EVGA GTX670 4GB
    Haha, yep. I studied and now work at a University so we get it all for free under a enterprise license.
     

Share This Page