r/programming • • Jul 05 '15

Fast as C: How to write really terrible Java

https://vimeo.com/131394615
1.1k Upvotes

394 comments sorted by

View all comments

Show parent comments

-2

u/[deleted] Jul 05 '15

There is always a tradeoff. With Java you get amazing portability with slightly less speed.

-16

u/[deleted] Jul 05 '15

Slightly being of course an exaggeration. You see there's a problem with Java programmers (and C# programmers), they have never heard of such a thing as a profiler, nor do they use one on their own code.

Hands up? How many Java programmers fresh out of some shitty Comp-Sci school have heard of or used a profiler? The answer is virtually ZERO.

All JIT:ed languages requires that you use a profiler to fix your code. If you don't you're almost useless as a developer. You'll produce garbage code that runs 10 times slower than C and it will likely leak references to objects as well, especially if they are wrappers for system resources.

15

u/way2lazy2care Jul 05 '15

Hands up? How many Java programmers fresh out of some shitty Comp-Sci school have heard of or used a profiler? The answer is virtually ZERO.

How many C++ programmers fresh out of school have used a profiler? That's not a language problem. Profiling doesn't really come up that much in a standard BS in CS. People will talk about it, but almost nobody does it.

2

u/[deleted] Jul 05 '15

From what I understand profilers basically are diagnostics for all of your code. So could you write your own simple profiler with timers and console outputs for the times/memory?

2

u/s73v3r Jul 06 '15

You could. However, there are decent profilers that exist for most platforms already.

33

u/oconnellc Jul 05 '15

Plus, if you write native code, it means your penis is larger.

3

u/iama_copycat_ama Jul 05 '15

I'm glad someone finally pointed this out

4

u/dccorona Jul 05 '15

Just because someone works in Java doesn't mean they went to a school that taught them in Java.

Also just because a school used Java as its primary language doesn't mean it is shitty (though I do think it's better to teach on C/C++)

4

u/headius Jul 05 '15

Very few CS courses in any language ever enlist (or need to enlist) the help of a profiler. That's a failing of CS programs in general, not any specific language.

1

u/The_Doculope Jul 06 '15

That's a failing of CS programs in general

I feel that this is an expectations issue. CS != Software Engineering. Many students expect a CS degree to be more practical than it is, as do many employers. I don't think this is a failing of the programs themselves. Is it a failure of a Civil Engineering degree that a student doesn't learn how to weld, or the mechanical engineer doesn't learn how to check his car's oil?

Should there be more practical degrees available, like Software Engineering? Yes (and there are in many parts of the world), but it's not the fault of a CS degree that it isn't something it never claimed to be.