Reply to post: Re: Almost all uninteresting...

Not an off-by-one error: Java 16 brings 17 enhancements to Oracle's JDK. We chat to Big Red about what's new

AndyJF

Re: Almost all uninteresting...

Totally agree there re: streams. They have their place, but sometimes people get obsessed with using them.

I once had a technical interview, where a piece of code I'd written used an enhanced for loop and it worked perfectly. However the interviewer was hell bent on using Java 8 features and asked me to convert the code segment to use a streams approach. Ok so I made it use a foreach loop. The resulting code was harder to read (IMO), and had to be hacked around to make it work.

Just because the language provides these features, doesn't mean you *have* to use them.

And yes, functional programming is the current fashion, so chaining stream methods together on one line is the popular style. Does it make code more, or less readable. And how do you debug that when it doesn't pop out the correct results?

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon