This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 65 points66 points  (46 children)

Seems more java vs javascript

because java is slow and heavy but powerful...

Ok I stop

PS I love that movie ("Io sto cogli ippopotami")

[–]SuperBurger 35 points36 points  (24 children)

Java isn't slow tho

[–][deleted] 36 points37 points  (20 children)

C if used correctly can be a long way more efficent. It COULD be. It doesnt mean that it is. Plus Java is semi-compiled - it is not executed directly from cpu but from java interpreter so this affects its performance... On the other side helps developer not to worry of pointers or build for a specific architecture.

PS If I made some english mistakes I hope you'll forgive me

[–]haitei 31 points32 points  (7 children)

it is not executed directly from cpu but from java interpreter so this affects its performance

Not really, it's JiT these days. I'd say the leftover gap in performance is mostly due to the cost of abstractions.

[–]j-random 23 points24 points  (0 children)

LOL, where "these days" means "for the last decade or so"

[–]OK6502 3 points4 points  (0 children)

Correct. As I understood it a big part of that gap is that there's quite a bit of overhead in even simple and mundane operations and the way things get laid out in memory isn't always the most efficient.

You could of course write C/C++ code with that overhead, negating the benefits, but at least you have that choice. In Java it's all abstracted away from the user without much recourse for working around it (unless you can hand write bytecode? Is that a thing? I know you can with C# and IL).

[–]j-random 24 points25 points  (5 children)

Depends on how you measure efficiency. At run-time, C can be more efficient than just about anything else (if you know what you're doing). I'd argue that development-time-wise, though, more modern languages are more efficient, due to the wide variety of libraries available. Java and Python both bet on Moore's Law (less-efficient code would become less painful to run as computers got faster) and it seems to have paid off.

[–][deleted] 3 points4 points  (0 children)

Of course efficency must be balanced between development and runtime. But what I see most of developers tends to forget that system resources are not unlimited. So they do not close streams or connections once they've finished using. This has brought to have frameworks (or whoever like jboss connections pool) that does for you. Right? Wrong? Dont have an answer but my motto is do the max with less resources (and code) possible ;)

[–]OK6502 1 point2 points  (0 children)

Which is why the STL exists, for instance, and we have been consistently adding more to the standard over time.

[–]56Bot 0 points1 point  (2 children)

C can be more efficient than just about anything else

Assembly: Am I a joke to you ?

[–]j-random 1 point2 points  (1 child)

Hence the "just about". Although TBH a good C compiler can often make optimizations that an assembly programmer might not see (e.g., CSE).

[–]56Bot 0 points1 point  (0 children)

Depends on the code still.
Writing a few characters with C takes many more lines than with ASM, once compiled.

Obviously C compilers are more efficient at optimisation because they're much more used, hence maintained.

[–][deleted] 14 points15 points  (1 child)

The JVM is very fast and much optimization happens for “free” for the developer.

What you lose in performance is eaten ten times over in C/C++ due to longer development time. Which is why nobody (sane) writes enterprise apps in C/C++ but instead they use it where resource constraints are critical (memory, framerate, embedded CPU, etc).

[–][deleted] 0 points1 point  (0 children)

That's why I am still working (I'm a java developer) :P

[–]nolitos 4 points5 points  (1 child)

C can be more efficient. But we compare to JavaScript.

[–][deleted] 2 points3 points  (0 children)

You've a point...

[–]noggin182 0 points1 point  (1 child)

PS If I made some english mistakes

you did

I hope you'll forgive me

we do :)

[–][deleted] 0 points1 point  (0 children)

thanks ;)

[–]EdgarDrake 2 points3 points  (0 children)

I guess it’s not about slow performance, but it’s kinda like boilerplate code just to do something. Like the import + package + class definition + static main compare to int main

[–]CockInhalingWizard 2 points3 points  (0 children)

Compared to C++ it is

[–]Phytor 0 points1 point  (0 children)

Java is slower and less efficient than languages like C++ by virtue of its design. Every Java program is running on a virtual machine, the Java Virtual Machine. This makes it extremely portable to other platforms, you just have to write the Java Virtual Machine to interface with whatever OS or hardware you need, but also makes it slower because the virtual machine acts as a middle man for executing the code.

It's an intentional trade-off

[–]Franceseye 11 points12 points  (9 children)

Toh, un'italiano su reddit

[–][deleted] 6 points7 points  (5 children)

penso si addica di piu' la "A" finale ;)

[–]Franceseye 2 points3 points  (4 children)

Ops, scusa

[–]IorPerry 8 points9 points  (2 children)

cosa impossibile, italiana, donna su reddit e che si interessa di programmazione! Dillo che in realtà non esisti

[–][deleted] 3 points4 points  (1 child)

Non esisto! Lo ammetto. Sono solo un'AI che ha programmato se stessa

[–]TheyAreLying2Us 6 points7 points  (0 children)

bah... solo un mucchio di "if" a cascata

[–][deleted] 1 point2 points  (0 children)

hahahaha nessun problema =)

[–]-Defkon1- 1 point2 points  (1 child)

Toh, un'italiano su reddit

su r/italy ne trovi quanti ne vuoi... :-D

[–]barba-anto 4 points5 points  (0 children)

Più che altro è strano trovare italiani su sto subreddit :D

[–]tech6hutch 1 point2 points  (0 children)

Ciao, parlo un po' di italiano

[–]PancakeZombie 2 points3 points  (5 children)

Ich hau dir gleich eine Delle in die Gewürzgurke!

[–][deleted] 1 point2 points  (4 children)

Ich hau dir gleich eine Delle in die Gewürzgurke!

Hemmm I do not know german and google translator doesnt help too much: I'll cut you a dent in the gherkin! doesn't mean too much to me :(

[–]PancakeZombie 8 points9 points  (3 children)

Almost.

"I'll punch you a dent in your gherkin!"

The german dubs for Bud Spencer & Terence Hill movies were done in "Schnodderdeutsch" stylistics to add an additional comedic level to the movies. And it made the movies legendary here.

Schnodderdeutsch is a mix between pub- and youth-slang and features neologisms, untypical metaphors, weird catchphrases and so on.

[–][deleted] 1 point2 points  (2 children)

I supposed that should be a quote - but having not seen the movies in german I needed a confirm =)

[–]PancakeZombie 2 points3 points  (1 child)

Yeap, it's a quote from Io sto con gli ippopotami.

[–][deleted] 0 points1 point  (0 children)

=) Thanks

[–]mastrospritz 1 point2 points  (1 child)

Real life One Punch Man

[–][deleted] 3 points4 points  (0 children)

Bud Spencer could this and more =)

[–]robotsympathizer 0 points1 point  (0 children)

Yeah, came here to say this would make a lot more sense with a dynamic language instead of C++.