[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
C++ is Proven Garbage
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 122
Thread images: 10
File: java-still-champion.jpg (42 KB, 523x449) Image search: [Google]
java-still-champion.jpg
42 KB, 523x449
>1999+17
>C++ is still dogshit

Why are you not letting it go anon desu?

Citation:
https://www.google.com/search?q=c++%20is%20bad
>>
>>53597062
because we are addicted to poverty
>>
>>53597062
because c# is also shit
>>
Okay I'll bite. What should I be learning instead of C++?
>>
>>53597215
Java?
>>
>>53597215
C
>>
>>53597215
C then C++
>>
File: fuck this shit.png (399 KB, 699x546) Image search: [Google]
fuck this shit.png
399 KB, 699x546
>>53597246
>>53597262
>>53597645
fuck this shit
>>
>>53597215
Rust.
>>
>>53597693
>street sign in India
>>
>>53597215
>>53597262
>>53597645

* C: 0.8 seconds.
* C++: 2.3 seconds.
* OCaml: 0.6 seconds *interpreted*, 0.3 seconds fully compiled.
* Java: 1 minute 20 seconds.
* Python: over 5 minutes.

About a year later, testing a new JIT for Java, the Java time was down to 0.7 seconds to run the code, plus about 1 second for the JVM to start up.

Java. C and C++ aren't faster than the actual language anymore, just the startup of the JVM.
>>
>>53597062
Everyone knows Java is fast. That graph neglects memory consumption and GC overhead, where Java sucks for some applications.
>>
I hate Java with a passion though.
>>
>>53597976
>not ocaml, which is the fastest
Wow pleb!
>>
>>53597978
Java is slow, though. Typically 1.5x slower than C++ at best, around 3x slower on average.
>>
>>53598195
Why?
>>
>>53599178
Ocaml if you want to limit job opportunities
Java if you want to make sure you have a job
>>
>>53599192
read
>>53597976
>>
>>53599196
Probably because it's OO. If you're going to complain that a language is OO you shouldn't be in compsci.
>>
>>53599270
>random numbers
Here are more random numbers for you:
java: 99999 years
ats: 999999 millennia
C++: alpha(99999) fentoseconds
C#: blurry hours
C: tree fiddy seconds

Guess C++ wins after all!
>>
>>53599320
http://scienceblogs.com/goodmath/2006/11/02/the-c-is-efficient-language-fa/
Dickhead.
Try actually learning to program Java correctly instead of shilling your fucktardery.
>>
>>53599366
Haven't read such ignorant hogwash in yea- oh wait, you said something about as retarded 5 minutes ago!
>>
>>53599423
>Has no evidence to back his claims about 'muh C vs Java'
>Shitposting
>>
>>53599466
>no code posted
>blogpost amounts to "I literally don't even understand the first thing about C nor C++ therefore please believe that they're slow!"
>when the actual issue here isn't even aliasing but caching
>C++ being any slower than C at all for a simple dynamic programming application - a program that requires no inheritance and where using objects at all would be a stretch
99% chance the reason why his C and C++ programs are slow is because (beside the obvious fact he has no idea about compiler optimizations and C and C++ keywords) he probably does a ridiculous amount of allocation and deletion every iteration instead of using an arena. And again, caching.
>>
ITT: ignorants fueled by confusion caused by inability to comprehend C++'s concepts basing their arguments on 10 year old irrelevant articles.
>>
>>53599544
I'd post my own for comparison but it uses multiple files.

Saying Java is slow is a meme. If it was as slow today as it used to be no one would use it. Hell opendedupe - a filesystem - is built on Java.
>>
>>53599588
By this logic, nobody would be using python, ruby, javascript, or php, yet look where we are. There are filesystems written in python. There are even operating systems written in python.
>>
>>53599544
Btw multithreading is a nightmare in C++. It's hard in Java but at least manageable.
>>
>>53599613
>python, ruby, javascript, or php
JAVA IS NOT A WEB LANGUAGE. Fucking webdev.
>There are filesystems written in python.
Post proof, I don't believe that shit for a second.
>>
>>53599588
People use java for its portability and ease of use, not speed.
>>
>>53599613
>Python
Layer of abstraction above Java, C, and C++

>PHP, Ruby, Javascript
Web languages

>Java, C, C++
System languages, used for Server-side processing
>>
>>53599627
It's about the same. If you want painfree multithreading you'll end up using a library in any language except erlang and go. Ocaml is different because it doesn't come with a real standard library, and core (everyone's favorite standard library) has the fantastic async module. Some queers actually like Lwt though; but it's pretty much the same thing.
>>
>>53599682
>everything not in a browser is a system language
When will this meme end?
>>
>>53599672
https://benchmarksgame.alioth.debian.org/u64q/java.html
The difference between Java and C is only important in scientific applications, but then you shouldn't be using C for applications where speed is critical. Fortran is faster.
>>
>>53599644
https://peterodding.com/code/python/dedupfs
for example.
>>
>>53599704
>When will this meme end?
There's no meme to it, not everything outside of browser is a system language, but no browser language is a system language.
>>
>>53599716
The difference between C and java is important in any single application where performance is relevant, from high-performance networking applications (firewalls, packet filters, routers), to interactive media (games, modeling suites, CAD software, video players), to low-level and embedded systems (drivers, OSs, kernels).

What it doesn't matter for are scientific applications because if your scientific application is running on a CPU, you're just playing around in your middleschool class.
>>
>>53599735
>everything not in a browser is a system language

>not everything outside of browser is a system language,
>There's no meme to it
You may only choose one.
>>
>>53599753
l2english

Browser language != system language

Not browser language can be a system language but is not necessarily.

Fucking retard webdevs like to think their JS is a system language. If it can't be compiled to Assembly it is not a system language.
>>
Backend langs

>C
>micro controller and engineering language
>java
>enterprise application language
>c++
>gaymans
>c#
>has more feature buy doesnt work on loonigs and isnt free for enterprise. So its garbage
>ruby
>dead
>pearl
>sucks
>nodejs
>for servers that neednto go fast
>php
>wp and drupal
>python
>idk why you would do this

Pick the best too for the task. You can pound a nail in with a sludge hammer, a regular hammer or a piece of wood. One is objectivly better than others
>>
>>53599716
Um, are you actually trying to justify your point based on that link? Because it really only shows how C does everything significantly better in terms of speed, load, etc.
While I won't argue about Fortran, I do sincerely wish you good luck trying to do anything big with that thing.
>>
>>53599644
What is apache wicket. Dumbass ;) I also know wicket ama
>>
>>53599803
>1 second difference
>Declares significant
>>
>>53599804
What is Tomcat?
Java is used for the backend processing just like C++ can be.
>>
>>53599835
I do front end development with wicket running on tomcat. I knew what it is ;) the backend runs on java too, because obvious reasons
>>
>>53599817
>implying most of them didn't have 5+ second difference
Just check the page once again.
>>
>>53599879
If you're concerned about performance learn Fortran.
>>
>>53599879
Yeah learn fortran stupid. Or be a real programmer and write it in asym you faggot.
>>
how do i learn c++
folder structure, organization, real life projects, techniques...
>>
>>53599783
>I was j-just pretending to be retarded!
>>>/reddit/
>>
>>53599935
>Still doesn't understand english
We'll talk after you hit puberty.
>>
>>53599933
Use bleach, it helps free the mind. It'll do you a lot of good.
>>
Masturbating over execution time is nonsense. You should write in the language that best fits the project. Java for anything that has to be deployed on anything up to and including a toaster, C/C++ for anything that needs an anal level of control over memory and such, C# for anything that needs to integrate deep into Windows, etc.
>>
File: 1454200035369.jpg (8 KB, 265x265) Image search: [Google]
1454200035369.jpg
8 KB, 265x265
>>53599644
>python
>web language
>implying Java isn't one of the most popular web languages anyway
>>
>>53600160
>implying Java isn't one of the most popular web languages anyway
Java is not javascript.
>>
>>53600071
t. pajeet
>>
>>53597215
Scheme
>>
>>53600213
Java was invented for the Web dumbass. It allowed developers to make a single program that can be downloaded and ran on any computer.
>>
>>53599252
>Having a job
>not a business
Fucking Americucks
>>
>>53599627
But async is easy as fuck and amazing. The only problem is it's ugly.
>>
>>53599817
A one second difference is a million second difference for a million tasks.
>>
>citation
>google search
Yeah, nah, not going to take that. Provide an actual link to the site that did this benchmark. I'd like to see the source used in particular. Plenty of people who write benchmarks for C++ generally end up writing really shitty C++.

>>53599366

The central point of this article, written over 9 years ago, is that C is insufficient for scientific computing because the author doesn't know that the restrict keyword exists. For the record, Fortran and C performance is roughly equivalent these days. And so once again we have morons who don't know C or C++ writing crappy code and claiming it's inefficient.
>>
as someone who arrived just now in this thread and doesn't wanna open the links.

C/C++ is better than java only if the person who wrote the code knows what he's doing?

is that it?
>>
>>53600770
If it's meant to be downloaded and run on someone's computer how is that for the web?
>>
>>53601327

It is very easy to write bad C++ code, especially if you're an academic. Nonetheless, it is also a lot easier to write fast C++ than it is to write fast Java, and ultimately, based on a number of limitations of the JVM, C++ will, in general, be faster than Java. It is possible for the JVM to make some assumptions about a target architecture that C++ would not be able to if it is compiled generically (i.e. not all x86-64 CPUs support AVX instructions, but Java can JIT to use them), but C++ can also do so if the compiler is told to, for example, target a specific CPU. If you're writing an application for a supercomputer, you probably want to use C++ over Java.
>>
>>53599793
>>c#
>>has more feature buy doesnt work on loonigs and isnt free for enterprise. So its garbage
Isn't MS in the middle of bringing .Net to Linux?
>>
>>53601455
senpai wa very knowlageable desu

java was the first language I was taught when I entered college, but the professors always said that if you need performance you should always go to C/C++.
>>
>>53601333
Java programs were distributed primarily on the Web. Java programs would display as part of the website. You never saw a CD or floppy disk with a Java program on it.
>>
>>53597215
D
>>
cout << "hello world" << endl
>>
>>53601563
there's already mono, which is a (slow as fuck) free implementation of .NET
M$ just bought the guys that made it so expect it to either become shitter or less free in the imminent future
>>
>>53601003
this. async in c++11 beats javas crap multi-threading.
>>
>>53601607

>if you need performance you should always go to C/C++
Now, as much as I like to be an advocate for C and C++, I should note they are not the only languages capable of attaining good performance. Fortran IS a real contender, and you can get similar performance from Ada, Rust, Haskell, and other more... type-strong languages as well. C and C++ may be prime examples of languages that AOT compile to native code, but they're not the only ones.

That said, C and C++ are popular for a reason. They give you control, and lots of it. C could be best described as a domain specific language for manipulating memory. In many ways, it can almost be thought of as a portable, high level assembly. C++ in turn is C with object orientation and a turing complete metaprogramming system bolted on. Aside from issuing a few ISA-specific control instructions, C and C++ give you almost complete control over most of what your computer does. Which is why they both are used in every major operating system used in the real world, the drivers for those operating systems, and nearly every program that needs to sit very close to that operating system for performance purposes. Web servers? Web browsers? Virtual Machines? All C and C++. It also sees use in embedded systems where a fine level of control is somewhat needed to achieve decent performance. Your router? Probably in C or C++. And why would you accept anything less? Every high level application you use runs on top of a C or C++ program or framework. If the elements at the lower level were allowed to be slowed down for needless abstractions, everything above it would slow down as well.
>>
>>53599627
>multithreading is a nightmare in C++
Source: Your ass.
>>
>>53601563
>>53602437

The official, non-Mono, Microsoft implementation of the .NET Core Runtime and Framework Class Library are Free as in Freedom, and they run on Linux.

Oh, and so's the C# compiler.
>>
>>53602596
too bad its only serverside .net.
wish somebody had made a portable version of wpf.
>>
>>53602365
>using the std namespace
I can tell you suck at C++
>>
>>53602637

You can use the Microsoft CoreCLR with the Mono implementation of System.Windows.Forms if you want to use it in desktop applications. WPF hasn't been made portable supposedly due to lack of demand.
>>
>>53602768
how do you know he didn't just using namespace std::cout?
Even if someone else writes a cout program, the compiler would tell you.
>>
File: 1428741181274.png (463 KB, 785x678) Image search: [Google]
1428741181274.png
463 KB, 785x678
>C++
Into the trash it goes.
>>
>>53597645
>being this retarded
>>
File: graph.jpg (102 KB, 967x1080) Image search: [Google]
graph.jpg
102 KB, 967x1080
>>53597062
>>
File: java.jpg (50 KB, 540x507) Image search: [Google]
java.jpg
50 KB, 540x507
>>
>>53597062
Depedns you negro on what you want to specialize into:

If you want to be a desktop / system / hardware programmer and be useful to society:

Learn c++ then c.

If you want to program shitty phone apps for shitty humans that provide 0 benefits go with

Java or w/e.
>>
>>53603676
Also if you focus on Windows also learn C#

and since you also want to be useful learn R.

For now knowing these languages is enough.
>>
>>53599627
>Btw multithreading is a nightmare in C++
not anymore, keep up with the times senpai
>>
>>53603687
>R
>useful
LMAO
>>
>>53597215
cython
>>
>>53599933
First understand how software runs on a cpu, then learn basic syntax structure of c like languages, then watch cppcon15 to learn how you're supposed to write sepples
>>
>>53597062
>performance
>bigger is better
>>
>>53601607
>java was the first language I was taught when I entered college
What the actual fuck?

I'm not even a CS but Engineering course graduate, but I was taught first C++ then assembly. Why would anyone start teaching java?
>>
>>53605361
pre-modern schooling used java. Now it's either js or python. No really. js and python for general programming.
>>
>>53605423
no wonder js shit has been invading everything. it's just the extension of javashits shitting up every code base with ObjectFactoryWorker all over again
>>
http://www.radford.edu/ibarland/Manifestoes/whyC++isBad-printable.shtml

> Why is C++ even around?
> Second, these people exhibit a form of programmer machismo: “Other people might need the computer to make safety checks as their program runs, but not me! I'm smarter and better than all those thousands of other (more experienced) programmers who've shipped bugs in their products.”

i kek'd, because this sentence describes the people on /g/ in a nutshell
>>
>>53606042
Definitely (with the exception that /g/fags go one step further and resort to C wherever they should be using C++ at worst)
>>
Aren't Go and Rust faster than C and Java, though? Seems like it'd be smart to start learning those languages.
>>
>>53606224
Top fucking kek no.
>>
File: 1458554557647.png (2 MB, 1080x1920) Image search: [Google]
1458554557647.png
2 MB, 1080x1920
>>53606224
any cheap and seems to work than their current flagship smartphone is a meme
>>
>>53606290

>smartphone

Wrong thread.

>>53606280
Let me see if I can find that article. It was interesting; the guy benchmarked a program written in several different languages.
>>
>>53605361
At my school all engineers learn matlab or java. Electrical engineers and similar often have some classes in C. Scientists generally learn python.
>>
>>53597062
You could have also used :

https://google.com/?q=C%2B%2B+is+SHIT&t=ffsb
>>
>>53606224
>Aren't Go and Rust faster than C and Java, though?
No, not even sure if they're aiming to be faster than them, afaik devs want them to be safe and fast not faster than language X
>>
>>53606431
They're both supposed to be systems programming language except only rust has a chance to be that and go is borderline unusable given how fucking retarded its design is.

Now, rust tries to be "as fast as possible" while being safe and high-level. Just like ATS is typically just as fast as C and sometimes faster, so can Rust be; because of uniqueness types, which ensure safe memory operations without any garbage collection or reference counting.

It's also important to realize a truth that might not be intuitive to all: the higher-level the abstractions are on your language, the better you can optimize a program, because you know a lot more about what the person is actually trying to do when they write a piece of code from high-level segments, as opposed to low-level primitives. A very simple example of this: you can tell someone is operating on an array if you have an actual array type, and you can tell in which direction if you have high-level looping procedures. This allows you to optimize the storage of elements in the array for the kinds of operations which are done on that array. If you only had pointers and jumps, this wouldn't be possible.
>>
>>53604895
>/g/ knowing shit about anything
>>
>>53603594
Is that comparison supposed to paint java in a negative light?
>>
>>53599627
threads in C++11 is ez pz

C++17 will make vectorization streamlined as well
>>
>not using D, haskell, or Ada
>>
>>53612905
>D
Unsupported

>Haskell
Slow, GC

>Ada
Deprecated
>>
>>53612905
>not using ocaml, clean or ats
>>
>>53599627
Multithreading in C11 is not even that hard anymore let alone C++11.
>>
>>53613003
>responding to a joke
>being wrong about the joke
Wew, lad.

>>53613007
10/10
>>
>>53597215

Python :^)
>>
>>53599544
>this is probably because
Well why don't you post some evidence towards your claims like the other guy did instead of memeposting like a reddit moron?
>>
>>53602289
>Java programs were distributed primarily on the Web.
>this means it's a web language
I swear /g/ gets stupider each day.

Hey guys, people store ASM files on github, Assembly is a web language.
>>
>>53614758
>doesn't post any code
>"why don't you prove it?????"
Congrats, you're clinically retarded.
>>
>>53599793
>ruby dead
>no rust
agreed on python, it's basically the new java - everyone's doing it and saying it's awesome while it's just a (far more) shittier version of something else (for java this was c/c++, for python this is ruby) and it's slow as fucking shit.

i'm doing a shitton of stuff in python right now and in all honesty, i want to go back to the beautiful syntax and constructs ruby has. other than that, i also love c and rust (the little i know of it as of right now).

by the way, saying that ruby is a web language is entirely based on a ten years old opinion as well.
>>
>>53602910
because he's also using endl without std.
>>
>>53597976
How does a JIT'd language have better performance than a fully compiled language?
I blame it on the people writing the C code, it was probably unoptimized.
>>
>>53602768
Why does everyone keep repeating this meme?

I'm in a Comp Sci graduate program now, and literally everyone uses the std namespace. I also did an Internship at Bloomberg in New York last summer and they did as well.
>>
File: 1452901556243.png (27 KB, 580x276) Image search: [Google]
1452901556243.png
27 KB, 580x276
>>53597062
>bigger is better
>no units on the graph
fuck i love this spicey new meme
>>
File: wandys.png (8 KB, 755x518) Image search: [Google]
wandys.png
8 KB, 755x518
>>53616498
CHECKMATE MICROSHILLS
>>
File: WHAT COULD IT MEAN.jpg (73 KB, 868x272) Image search: [Google]
WHAT COULD IT MEAN.jpg
73 KB, 868x272
>>53616498
Thread replies: 122
Thread images: 10

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.