• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java 8 - Does adding functional support mean it's no longer object oriented?  RSS feed

 
Aditya Gore
Greenhorn
Posts: 1
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir,
Well i am still a beginner in java but i have a question about java 8 ,
as java 8 supports functional programming does that mean its object orientation has been compromised?
if so, can java 8 be used for writing programs for hardware interactions such as device drivers etc?
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it remains an object language, with functional features added. I would still not like to write device drivers because Java is still not designed for such low‑level access.
 
Richard Warburton
Author
Greenhorn
Posts: 22
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aditya Gore wrote:hello sir,
Well i am still a beginner in java but i have a question about java 8 ,
as java 8 supports functional programming does that mean its object orientation has been compromised?
if so, can java 8 be used for writing programs for hardware interactions such as device drivers etc?


Hi Aditya,

I hope that you're having fun learning about Java.

Adding some concepts from functional programming doesn't mean that Java has in any way compromised its Object Orientation. People like to think of functional programming and object oriented programming as being diametrically opposed world views - like communism and capitalism. Its often stated that you're either one or the other. I can't hold to such a rigid viewpoint in my code. Things like lambdas let you write fluent and simple code and basic functional principles like immutability can be a good thing. On the other hand, I like the domain modelling aspect of object orientation and sometimes you do need to mutate state.

To me these programming paradigms are more like tools at your disposal - a fork and a spoon. If someone gives me soup and all I've got is a fork then I'm not going to have a very fun time! On the other hand forks are definitely useful. Sometimes I write functional style code and sometimes I write object oriented code.

I'm not really an expert on device drivers so I'll refrain from giving a definitive answer to that. As far as I know nearly all device drivers in commonly used operating systems are written in C/C++ or assembly. Though I'm sure there are more esoteric systems which write them in other programming languages.

regards,

Richard
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!