• Post Reply Bookmark Topic Watch Topic
  • New Topic

Advice for the Java 6/7 programmers in the Java 8 era?

 
Chan Ag
Rancher
Posts: 1089
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kishori,

A lot of us are still coding in Java 6/7 at work though we have had a fair introduction to Java 8 and the new features off work.

Some day the migration to Java 8 will happen ( I hope ).

Do you have any advice ( besides asking them to switch to Java 8 of course ) for the programmers who still have to program in Java 6/7?

Should a Java 6/7 programmer start coding more of functional interfaces ( single method interfaces for the sort of static/utility methods that are stateless if that can be used for methods/functions ) for example?

What do you think?

Chan.

Edit : the subject was edited.
 
Kishori Sharan
Author
Greenhorn
Posts: 21
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Chan,
Your team will definitely benefit from moving to Java 8. I will highly suggest moving to Java 8 and start using Lambda Expressions and the Streams API.
 
Junilu Lacar
Sheriff
Posts: 9947
103
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chan Ag wrote:Should a Java 6/7 programmer start coding more of functional interfaces ( single method interfaces for the sort of static/utility methods that are stateless if that can be used for methods/functions ) for example?

Writing functional interfaces in Java 6/7 now can certainly help in migrating to use Java 8 lambda expressions later so it probably wouldn't hurt to start doing that where it is appropriate. But then again, I would not start breaking up any existing interfaces into functional interfaces "just in case" you might want to use lambda expressions with them later when you migrate to Java 8. I think the best guideline you have will be the Interface Segregation Principle. To paraphrase Einstein: make your interfaces as small as possible, but no smaller.

My $0.02
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kishori Sharan wrote:Hello Chan,
Your team will definitely benefit from moving to Java 8. I will highly suggest moving to Java 8 and start using Lambda Expressions and the Streams API.

Except when you will lose support if you upgrade. JBoss for instance will offer no support (yet) on their EAP if you move to Java 8. That's the foremost reason my employer hasn't switched to Java 8 yet (personally I switched over pretty quickly).
 
Junilu Lacar
Sheriff
Posts: 9947
103
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please, when you do move to Java 8 and start using lambdas and functional interfaces, default interface methods, etc. PLEASE make sure your developers are educated on the proper use of these features. Nowadays, I have to wade through Scala code that looks like and I blame not the language but those who too eagerly jumped on the bandwagon but didn't take time to learn how to use it properly.
 
Ivan Jozsef Balazs
Rancher
Posts: 992
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:and I blame not the language but those who too eagerly jumped on the bandwagon but didn't take time to learn how to use it properly.


They chose the "learning by doing" approach :-(
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!