Live data from Hacker News

Why and how I write Java

stevewedig.com

1–10 of 67 posts

Re: Why and how I write Java

#2
> High efficiency languages include C, C++, Rust, D, etc. I would love one language to rule them all, but it seems that for now there is still a gap between what language to choose application programming and for high efficiency programming.

What is this supposed to mean?

Re: Why and how I write Java

#3

> High efficiency languages include C, C++, Rust, D, etc. I would love one language to rule them all, but it seems that for now there is still a gap between what language to choose application programming and for high efficiency programming. What is this supposed to mean?

For most programming, as long as your algorithms are not stupidly slow, clarity is more important than efficiency. In certain situations (video games, embedded devices with few resources) this is less true, and things like the ability to do manual memory management becomes a lot more important.

Re: Why and how I write Java

#5
post #4

>Diamond operator Wow. So instead of adding something like var in C# or auto in C++ they went the opposite way. Makes no sense to me.

I suspect this was because it was a smaller change. Inferring from the type of the variable to the type of the expression only has the inferred type flowing inwards to smaller scope. Inferring from the expression to the variable gets inferred types spreading out over the whole program.

That is possible, and is how many languages work, but it would have been a huge change for Java. For better or for worse, it's in the nature of Java to be conservative, and not make huge changes.

Re: Why and how I write Java

#6
post #4

>Diamond operator Wow. So instead of adding something like var in C# or auto in C++ they went the opposite way. Makes no sense to me.

The diamond operator isn't variable type inference, it's parameter type inference for generics.

It should have var/auto, for sure, but this is a different thing.

Re: Why and how I write Java

#9
A little surprised Spring is not mentioned. Composition in Java is a nightmare without Spring, and you can do some really interesting things in configuration that would take you days of writing initialization code in very little time.

If not for Spring, I'm not sure I would want to construct things in Java at all.

Re: Why and how I write Java

#10

> High efficiency languages include C, C++, Rust, D, etc. I would love one language to rule them all, but it seems that for now there is still a gap between what language to choose application programming and for high efficiency programming. What is this supposed to mean?

High efficiency is misleading. They should be called explicit resource management languages.
Post reply on HN