5 ms·
I'm a Java programmer so work with OOP every day. I think it has it's pro's and con's like everything else. My pet hate is how dogmatic some people get to the
by lmorris84 12y ago
I'm a Java programmer so work with OOP every day. I think it has it's pro's and con's like everything else.
My pet hate is how dogmatic some people get to the point where they get angry over the use of if/switch statements. "It's not good OOP, use polymorphism", well the goal isn't to pass an OOP exam, but rather to write clean maintainable code where possible. If an if/switch saves me writing 6 classes with 3 lines in each of them, then that's what I'll do.
- xeromal 12y agoYeah, it's often taken too far. I was on a project where they created a DTO, DAO, UI, and some other bullshit class for each screen/idea. Most had 10 lines or less and there were at least a few hundred projects. I can't even remember.
- radicalbyte 12y agoYou'll still have the DAO and the DTOs in a functional language - they're types which represent concepts outside of the bounds of your system (well, process). Consider a simple information system consisting of a database and a web service publishing a REST/JSON API. The web service will need a definition of the interface between itself and the database (the DAO) and a definition of the interface between itself and the outside world (the DTO). Defining both interfaces explicitly allows you to control change and accessibility of data. I.e. you don't have to expose your database to consumers of the web service. I'd love it if my OO language of choice (C#) could add a special non-polymorphic type to represent these concepts, because then you could do cool stuff like define the DTO in terms of the DAO. "The DTO is all properties of the DAO except propertyX and propertyY".
- goalieca 12y agoMy pet peeve is how these brilliant architects end up writing so much code that does nothing. These 1 line functions just end up calling another 1 line function. At some point someone actually has to write the code. You know, that thing that actually does the work. I always figured OOP programmers actually hate coding because they try so hard to avoid actually writing code that does work.
- nickbauman 12y agoI would consider myself lucky that someone with the word 'architect' in their job title on my team wrote code that did nothing. Careful what you wish for.
- slowmovintarget 12y agoThere are Marchitects, Tarchitects, and Farchitects (Market-oriented, Technology-oriented, and umm... "freaking" architects). Sounds like you have a team of Farchitects. I have the title "architect", and I write code. It's usually code that lets the other thirty programmers write one or two lines of code instead of 200 lines, 30 times, in 17 different ways. Because it is framework code, I'm often providing them the Lego blocks to build the rest of their system in... With unit tests... and examples... and at least one real implementation... and a Wiki page explaining it... and a Powerpoint session teaching them how I expect them to use it. I do get the occasional grumble ("Uhh... Can't I just use Doohickey V directly?" "Sure, take a look at the interface, and don't forget the externalized configuration." "Oh.") Just sayin'. There are architects and there are Architects.
- deleted 12y ago[deleted]
- pjmlp 12y agoI have seen architecture skyscrapers in Assembly, Clipper, C, C++, you name it. It is something that is part of enterprise culture, it has nothing to do with programming languages.
- nickbauman 12y agoJava is arguably not an OOP language. It's a class-oriented language. It became OO only since 1.8 JDK.
- tunesmith 12y agoIronically, they're guilty of an anti-pattern. The point of all these patterns is to only use them when they actually solve a code smell. If you introduce them early, then you have Needless Complexity, as they like to say.