C++ vs java?

c++ vs java?
which one should i choose?
i have to choose between these two in my university.
protip: i hate games; i am interested in cryptography.

Other urls found in this thread:

media-giphy12.com.br/jvbvvvvieu9f.jpg
twitter.com/SFWRedditGifs

I've used both quite a bit. I will take C++ any day.

why would you choose it over java?

C++ is the better of the two but I'd go with Ada in a heartbeat

You learn one, you learn the other easily. What I think? Any programming experience at all? If no, start with Java.

Java is easier to learn and more portable. C++ is slightly nicer and has a nicer type system. Both are fast enough for most purposes. I would choose Java as a first language but if someone is going to _teach_ you C++ it is ok also

C++, it will teach you to basics of object oriented programming. I learned java on my own after C++ because they're very similar in concept. Think of C++ as the root language of a lot of other languages. I know C++ so I sort of know C sharp, java, python, etc.

C++ runs faster, more efficiently, and not as filled with autistic amounts of abstractions, you can also develop C++ in visual studio which, all memes aside, is really nice

C++ over java any day.
>C++ programmer.
Java over C++ any day.
>Java programmer.
Lol

>and more portable.

That would depend on what exactly you mean by portable. I wouldn't really consider not being able to run code except through some runtime virtual machine very portable.

Cryptography is most likely implemented in c++ than java. If you learn c++ first you can easily translate your knowledge to other languages.

Java would be an easier starting point though. My college taught c++ and I don't regret learning it as my first language

C++ is better

C++

don't forget
time to learn Java: 4 Moth.
time to learn C++: 3 Years.

None of them. Learn C. POOP is a meme.

If you study CS, it doesn't really matter. You have to/should learn both languages anyway. If you know assembly/C well or want to have an easy time, go for java, else C++ for understanding the underlying systems.

bullshit, I learned C++ in a year.

true, it depends on what we mean by portable. The java runtime is more common (and more reasonable to expect people to have) than the combination of a particular OS and compiler. Ofc, in principle C++ can be written platform-indepdendently using standard libraries, but it is hard and many libraries you want to depend on will be hard to make portable. On the other hand, Java is always "portable" because the VM is ubiquitous (and carefully standardized, there are competing implementations)

Unless you really want the Java luxury of easily portable code (including developing for mobile), I would say absolutely C++.

Just one thing mate. Dont use it to create any bullshit thread on /x/ about codes and what not. So sick of it

It takes more than 4 months to master any language whether it's a spoken language or programming language.
You can become fluent in a few months sure, but that's not even close to utilizing the full capability of a language.

C++ no question

what makes people hate c++ so much?

this x1000

also check em

People don't hat C++. It's just hard.

The right tool for the job is what this choice always boils down to. "Cryptography" is pretty general so it's impossible to pick a language based on that alone. If you really want to eventually do a little bit of everything related to cryptography, you need to learn both languages.

if you're a complete beginner, i'd say start with java since it's learning curve isn't as steep as C++. When you know a fair bit of java and understand the general concepts of coding, then move onto C++.

I would go with C++

I started with Java. There's much more you can do with C++. The new C++ standard is quite nice. If you do cryptography you can gain a lot of the performance C++ gives you. Also doing low-level stuff and shifting around bits is much easier. It's probably a bit harder to learn because of memory management but the new pointer types make things nearly as easy as with Java. If you one day want to make some web development stuff simply learn Python, Ruby or even Go.

>cryptography
>java
How could you even consider implementing a CBC cipher in java.

which's the best language to implement RSA/AES in?

you can do more with C++ sure, but that's not what you want when you're starting out.
Personally i started from Lego Mindstorms where you drag blocks of code, i did that at age 11 or 12, then moved onto java, then to C# and now C++, python and a lot of other languages.

Any, just do it correctly, that's the point, the language doesn't matter.

>How do you even consider Java.
FTFY

C.

Learn the good parts first. You can ignore Templates and shit. Use the new pointer types. Learning C++ today isn't hard. The new standard is quite nice. Simply buy a good book.

If you don't want to look like a filthy pajeet indian scrub use c++

i still say start with Java or C#, the simpler languages are best to start with in my opinion.
Same as i wouldn't start learning math by reading up on calculus.

DEVFAG HERE
i'd go C++, mainly because I use it a lot more. sure syntax may be ugly but java tends to get repetitive. also cryptography is used a lot more in C/C++.

python

why not start with Malbolge then, let's get really complicated!

Learn c++ and if possible, assembly language.

you are going to the university, not to code camp with hamid.

sign up for a 10$ udemy course on Java if you feel you need to learn that shit after you learn c++

fuck off

Choose C#

why? i've implemented pretty much every popular cipher in python, wasn't that hard

c#

It really doesn't matter all that much. You're supposed to learn the principles of how to structure software to achieve whatever goals you have with it. Those principles will apply to just about every programming language you'll encounter. Knowing just one language will get you almost nowhere in the software development world.

All that said ... C or C++ are probably the best starting points, as they don't do too much by themselves behind the scenes, and they are structurally similar to lots of other popular languages.

media-giphy12.com.br/jvbvvvvieu9f.jpg

Cryptography? Sounds like x86 or C is more your line.

Why?

Lolcode

>choose proprietary fad rather than an actual transferable skill

fuck off with your esoteric languages you morons

Java is dead

If it is your first programming language you should choose java, simply because it's easier for a noob.

>easier
>massive amount of boilerplate

Depends what you want to do with it.

when I see said good book I will believe it. Many are a fucking disaster for first-time programmers

Lol it's like in the top 3 of the most popular languages right now

Neither.

First, you learn boolean logic operations
then, you learn transistor logic
then, you learn how to build functional units from logic gates
then, you learn CPU design
then, and only then, you learn assembly language
then, after you have mastered assembly language (not dabbled, but mastered it), you learn C
then, after you have mastered C, you may learn the higher-level languages of your choice, but you will always use C and assembly as your primary languages because everything else is unnecessary bloat.

>First, you learn boolean logic operations
>then, you learn transistor logic
>then, you learn how to build functional units from logic gates
>then, you learn CPU design

Do you really need to know all of this to do cryptology?

Lisp and C

Lmao, it's an offense to C++ to be compared to Java, Java is fucking shit.
No programmer that respects himself and has done anything worth of mentioning has/uses Jashit.


You could on the other hand compare C++ to C#, i'd take C++ because opensource.

Yes, and it could take you your whole life, even after death if you are stupid like yourself.

Why is it an offense to compare java and C++?

Why is java shit?

Why isn't it an offense to compare C++ and C#?

No you don't, he's trolling. Though they were by far the most interesting courses I ever took at uni. Even did my masters on cpu architecture. Good times

Because Java is slow, it's annoying to program in it (much like VS), the IDE is a pain in the cock, as someone stated before, it's autistic af.

On the other hand most C++ Ides are free, fast and easy to code in, like codeblocks for example, syntax is understable even tho some people find it hard.

C# is like C++ but more understable but it's under Microsoft ass... that's the only con (requires fucking .Net framework in order to run)

If you're serious about a long-term career, start with C++. You'll get better exposure to lower-level issues. C++ is unusual in how much it can span from the lowest level to the highest level.

But if you're just curious and want to try programming, then either language is fine.

>2016
>not programming in Ruby

So you're judging a language by the IDEs you've used in the past...

This is not true. Java won't teach you pointers. Pointers are enormously important to understand if you want to understand higher-level-concepts because higher-level-concepts are built upon pointers - you cannot argue for or against any high-level abstraction if you don't understand pointers (You can always come up with pros, but never with the cons!).

It is true the other way around. The only thing Java offers which C++ does not is reflection (I think). In most cases reflection is not important. If you understand C++ you understand Java.

I'm obviously gonna recommend C++. It is vastly superior in almost every way. I used to ride the parrot-train of repeating programmer jargons "languages serve different purposes" etcetc. This is true with the exception of Java. Java is not good for any purpose, except for getting employed at a company shitty enough to chose Java before good languages such as C, C++, Python, Erlang or Ada.

Use Java because in C++ has explicit pointers, dereferencing, pointer arithmetic which will make your life hard.
Java has pretty neat abstractions so you don't have to worry about allocating memory explicitly, memory leaks and even freeing the memory.
Yes, Java has a state of the art garbage collector so you won't have to worry about free-ing chunks of memory you allocated!

No idiot, i judge by performance.

Would you suggest learning C AND Java or only C++? Because there's no better language for learning pointers than C.

>what makes people hate c++ so much?

C++ has some things in it that are unsafe for a beginning user.

For example, if you start using C++ pointers, then chances are good that you'll make a bunch of mistakes in your first few programs. Those mistakes will cause the program to crash, or to consume memory without limit, or -- especially bad -- to get occasional flaky behavior that's not easily reproducible, and can very difficult to debug.

The thing is though, that once you make all those mistakes and learn from them, you will emerge a lot stronger in the end. But while people are going through all those mistakes, they curse the language for giving them so much dangerous power. But unfortunately, danger goes hand-in-hand with power. It takes a bunch of years to learn that fact, and until a programmer does, they will often whine and bitch about C++.

Why did you feel it was necessary to call him an idiot

I agree with this user.

C/C++ is hard, that's why it's so powerful, prolific, and complicated.

You have to do everything yourself, which means you understand it better when another language does it for you.

But once you know what you're doing, you're a fucking programming Ninja.

Java is basically C++ for retards

Yeah but there are some things that you can do in Java but can't do in C++.
Like handling huge integers using the BigInteger class or making Interfaces, which are non existent.
Basically Java is Turing complete which C++ isn't. This is not that big of a deal for a beginner but as you try to build complex algorithms and programs, you'll realise that C++ just isn't enough.

I'm not the author of first reply but I don't think it's a troll post. It's exactly how my university teaches programming to software engineers, in precisely that order, along with two classes in Java. You will be equipped with a bottom-up understanding of programs and hence will be well prepared for making precise arguments when developing software.

I don't think it's necessary to learn in this order if you want to get into cryptography (I only have experience with RSA from a mathematical point of view so my opinion can probably be disregarded), you should be fine knowing how it's done from a high-level point of view. Im not sure if cryptography need to consider possible exploits in hardware.

d language is c++ without all those things that make people hate c++

Master number theory and abstract algebra

C++, because I know C++ and therefore hate everything else!

C++ is still mostly proprietary though... It's a complete fucking mess in many cases if you want to make a good cross platform program. Many times you have to work with system calls that are proprietary to the OS you're on...

C++, there is now cool crypto shit there since c++11

They should rename the language to C+=11 now since the ++ makes no sense if you put 11 after it.

by the way hating games != hating game development.
Game programming for me is really neat as it gives math and physics a hands on purpose (especially when trying to model the real world).

Just learn Python
There must be packages / libraries for that shit
You could just do

import crypto

xD

How many years are you willing to devote to learn a language? If less than 2, just go with Java.

I would probably suggest learning only C++ and not bother with classes (ie, sloppily, the C++ part of C) until you have well motivated reasons to dwell into classes. That way I cleverly circumvent your condition on NOT learning C if you chose to roll with C++ ;). In the long run it is good to learn all three programming languages. You should try Java for yourself and form an opinion of your own. I strongly suggest Java to be last in the order such that you can critically asses it for yourself.

You have interfaces in C++. An interface in Java is really just syntactic sugar for a class in C++ with only pure virtual methods. C++ is turing complete. Even C++ templates are turing complete.

C++ is better for games and old fags
Java is better for almost every thing else.

I love python, it's an easy and beautiful language, specialy for beginners. I also write a lot of C and C++, mostly for microcontrollers (C) and embedded devices (C++).

I would recommend you to you a good book, like the C++ Primer... Read all the basics, then use the rest as reference. Try to write simple Programs, like a basic text-based calc which asks you for integes and mathematical operations, you want use. Keep it simple and read every day the next few sites.

Sure you can learn java in less than two years. But can you learn how to write clean, reusable code and the ecosystem. I am not sure

However I think the ecosystem (e.g. some huge frameworks) is the biggest advantage of java. The language itself is a bit outdated

C++ because preprocessor directives (#define's) and operator overloading.
I have no idea how someone can code without killing themselves without these two features.

EVERY language skill is "transferrable", even goddamn fuckin HTML.
If you cant adapt to a new work envionment and use your current skills to your advantage ... well .... you might as well quit and start cleaning toilets or something, its a basic job feature.

Pure .asm without c calling conventions

But seriously, c++ you scrub.

HERETIC!

javascript, because the cool kids use it. Here is a crypto library implemented in javascript, just run this in your developer console to test:
pastebin com PXz4UqtS

wow, i'm actually impressed

Haskell

As somebody who is interested in making games is python any good?

This should be c++ vs C# to be fair

what the fuck is this?

fuck you this crashed my browser!!!

>Java is slow
Dude this argument hasn't been valid for over 10 years. Java caught up to C++ in terms of runtime performance a long time ago.

java is dying, go for c++

>java is dying
I'm seeing this a lot ITT. I sure hope you fucks are just trolling.

lack of garbage collector, pointers and memory management require much more skill than running code on virtual machine

more skill requuired = people getting buthurt over it = hate

At the top of that list should be "undefined behavior." There is far too much undefined behavior written into the C and C++ specs. If code contains a mistake that launches it into undefined behavior land, which is very easy to do, you typically end up with a seg fault far from the actual error in the code. These cases can be extremely difficult to debug.

all done - that's how my studie looked like

Ocaml

>If code contains a mistake that launches it into undefined behavior land
>mistake

thats .... not what "undefined behaviour" means ...
Yes, UB is ugly and maybe even unnecessary BUT thats just how the language rolls, bitch! No time for double-checks, sanity checks and such, bitch! We got assembly-level performance to achieve and actual results to deliver, bitch!
You go ahead and write your little scripts for your virtual machine-thingies and let the adults do their jawbs, mmkay?

I'm also interested in some takes on python. What is it useful for? What are the downsides?

UB is always a mistake. If you make a habit of using UB in your code, intentionally or not, I feel sorry for the fuck who has to fix and maintain your code when you inevitably get fired.

how does this work?

Knock, knock. Who's there.......

....30 second pause....

Java

um ... the creators of the most successful and most important language in the world did that. And instead of getting fired they became millionaires.

So ... about that "mistake"-part ...

>2010+6
>still using ruby
Node.js is the flavor of the month now.

Java

Depend on the specification of your program that you gonna build. They both have pros and cons.

Pointers are a low level concept, and modern idiomatic C++ usually wraps raw pointers in a container to save the programmer from headaches. Unless you're going to do systems programming, you don't need to know pointers beyond understanding the difference between a reference and a value.

C++ without a doubt. Java is terribly slow and lacks optimization, it's really only useful for small projects. The only benefit is ease of learning, that's why it's popular for coding boot camps and low-wage web programmer tasks. If you're planning to write any serious software then go with C++.

How about the good old plain c?

depends... What will you be doing?

Personally I hate Java and I'm not that comfortable with C++. Java is an horrible language and I won't lose my time to talk about it. Regarding C++, I've the feeling the no one in the whole earth knows all features of the language because it's becoming way too big, with a lot of unnecessary features that confuses me. I like C, it's a small and compact language that allow you to do everything with total control over what you are doing.

This hasn't been true for over a decade now. Today the recommendation is to use Java for large projects, C/C++ for small projects and small sections of code with extremely high performance requirements.

You are correct - you don't _need_ to know pointers. But I strongly recommend everyone to know pointers since without knowledge of pointers you cannot make solid arguments about software (your arguments will likely rely on "principles" rather than reason). Pointers are an absolute must if you want to know how things work under the hood. You will find pointers under the hood. I seldom use raw pointers nor smart pointers. Both are dangerous to use. I have yet to encounter a scenario, except when programming embedded systems or datastructures, where I actually must resort to pointers as opposed to some more appropriate feature of C++. Again, you are right - you don't need to use pointers and they can for most part be easily replaced by something nicer. Unless you don't care about motivating your software you need to know about pointers.

C++ is definitely worth more to learn, and more professional. Java is like NetBSD. People only use Java because you can run it on anything.

Oh, and I forgot to mention, C++ is definitely easier to learn and makes more sense. Anyway, if you're going to develop software for anything other than mobile devices, use C++. It's the most widely used programming language for a reason.

Java, like Go, Swift, Python, GW-Basic, was made to get code-monkeys (and gays) work done.

C++, like Rust, C, Haskell, Elixir, OCaml, Erlang, was made for people sporting a fully working human brain (and a fully functional penis).

I'd better go with Rust.

Go for C++, but don't do that ugly mix of C and C++ paradigms. Use C++ with its C++ standard library.

Bump?!

kek

>the IDE is a pain in the cock
>the IDE
>I used Java in one IDE and so therefore C++ is a better language
Sure bro