Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "object orientation"
Playing Warcraft and similar games prepared me for understanding Classes and Instances in Object Orientation later.5
If you need to learn/teach object orientation, these are my approaches (I hate that classic "car" example):
1) Keep in mind games like Warcraft, Starcraft, Civilization, Age of Empires (yes, I am old school). They are a good example of having classes to use, instantiating objects (creatures) and putting them to work together. As in a real system.
2) Think of your program as an office that has a job to do, or a factory that has something to deliver. Classes are the roles/jobs and objects are the workers/employees. They don't need to be complex, but their purpose must be really (really, really) well defined. Just like in a real office / factory.
3) Even better (or crazier), see your classes and objects as real beings, digital creatures in a abstract world, and yourself as a kind of god, who creates species (define classes) with wisdom. Give life when it is the time for them to come into the world (instantiate object) and kill them when they are done with their mission (dispose an object). Give them behavior, logic, conditions to work with, situations where they take action, and when they don't. Make them kinda "smart". Build them able to make decisions and take actions based on conditions. Give them life. Think on your program as an ecossystem. There must be balance, connection, species must be well defined and creatures must work together to achieve a common objective. Don't just throw code and pray for it to run. Plan it.
When I talk about my classes like they are real beings, and programs as mini-worlds, some people say I am crazy, some others say that's passion.
It is both! @__@3
The next wanker who copy-pastes instead of properly reusing existing code will be tarred and feathered.2
Some people just don't get object orientated programming. What kind of mental Frankenstein object is that you've created? It's part customer, part calculator and part tractor!2
I realized how overly complicated I wrote certain object oriented code a few months ago and now I have to work around it...
I over engineered it... I became the very developer I hate5
My C# developer friend Alfred getting a divorce because his feminist wife didn't like him treating her as "Object".
Now she's gonna "Dispose" him after "Using" him for her benefits.
"What is your project status? I need an update!"
So spoke the team leader. I was mildly hesitant about just rudely leaving work - which I was about to do, I was literally halfway out the building - without answering and delaying to Monday.
My project leader - the one that is supposed to look after me and my project every now and then - is on vacation. He's also the one, who is supposed to update the team leader.
It's not that we don't talk regularly, apart from his questions every two months or so, he is informed about my project on a bi-to-tri-weekly basis whether he wants it or not.
The team leader on the other hand seemed quite uninformed about my project.
Wouldn't it be nice if people would fucking talk to each other?!
Other than that, I'm learning C# for roughly six months now and today was the day it all started making sense. OO is a concept that is hard for me to grasp - I understand it, but I continuously failed to implement it. (That I have no regular code review right now isn't helping.)
Today, it just clicked.
I feel kind of stupid and in awe at the same time right now. :D2
I love functional programming but still insist that objective oriented is better for large project3
Object Orientation is not a feature, it is an unneeded layer of complexity over a dying paradigm, Imperative Programming7
I've always sucked at OOP and OOD, _in part_ because I have never encountered a good, common sense, relatable real-world example or analogy of why one would use protected or private variables/objects/functions over public. I watch tutorials and it all just sounds like static in my head and the explanations are just like "well, it's obvious you want to do blah blah blah because reasons."
Maybe it's just painfully obvious to everyone but me and my tiny brain just isn't capable of understanding. But if anyone has the example or analogy that made OOP click for you, please share.7
Everyone here seems to be hating java, but being a java dev I really like it! Java is a solid benchmark, sure there could be better languages and alternative ways to do stuff. But java will always be that complete package with a real sense of object orientation.7
I love C# but it almost seems to reward foreach abuse and object orientation overkill. (And that VS designer.cs files are auto generated and blow out any changes you make in them)3
I am just student looking for job, and got this pre interview test:
Develop an Android or iOS app with login and password input field, download button, place for image we prvided.
... reading further:
What we are looking for in the code ?
-consistent formatting of the source code
-clean, robust code without smells
-consistent abstractions and logical overall structure
-no cyclic dependencies
-code organized in meaningful layers
-low coupling and high cohesion
-descriptive and intention-revealing names of packages, classes, methods etc.
-single small functions that do one thing
-truly object-oriented design with proper encapsulation, sticking to DRY and SOLID principles, without procedural anti-patterns
-lots of bonus points for advanced techniques like design patterns, dependency injection, design by contract and especially unit (or even functional or integration) tests
-the app should be fully functional, with every state, user input, boundary condition etc. taken care of (although this app is indeed very small, treat it as a part of big production-ready project)
-the app should correctly handle screen orientation changes, device resources and permissions, incoming calls, network connection issues, being pushed to the background, signing deal with the devil :D and other platform intricacies and should recover from these events gracefully
-lowest API level is not defined - use what you think is reasonable in these days
-bonus points if the app interacts with the user in an informative and helpful way
-bonus points for nice looks - use a clean, simple yet effective layout and design
... I mean really ? and they give me like 2 days ?4
Has anyone actually ever seen evidence of SOLID principles being 100% adhered to, as opposed to people just saying they're using them correctly then you look at their code and they're clearly not.
I can count more than one responsibility here...1
Opinion | According to you, how impressive is it for a high schooler to submit a "general purpose scripting language that supports Object Orientation, closures, higher-order funcs." as a project for college admission given that the applicant implemented it from scratch and you know that hard work!!! ?9
There is a book or list of videos that you guys recommend to learn better practices in the world of OOP?2
So I’m taking a class on compilers (currently a college student) and as I get further into a coding project we have to do I can feel and see my code degrading into a giant mass of spaghetti. Although I know that I should refactor it because it is messy (currently trying to find a balance between refactoring and actually getting the assignment done) the scary thing is some students in my class think this is perfectly normal code and is what good code looks like. Scary thought that so many people graduating from university have no concept of object orientation, reusability, etc... but what’s even scarier is most professors could not give two shits about any of these notions. I guess this is the biggest reason why a computer science degree does not prepare you for a job in industry.
Facing some down - simultaneously somehow as dev and privately.
The dev part partly triggered by another burning project. Our team deep in shit up to the chin... And this unanswerable question: who is to blame? Everyone is working up their arses, but the result is still some sparkling firework ship wreck, that only held together for the demo to the board. It's not that we are stupid or lazy, yet we push some unmaintainable spaghetti, because this shit just gotta work.
Dunno, somehow this object orientation / pattern ideologies were also kind of depressing to me: partly because they smell like attempt to enlighten the inept by stupid receipts - and of course then deep down there's this nagging question if I'm not one of this inept not knowing the newest fashion template from the catalogue..
Then this Clean Code - Craftsmanship shit is bugging me similarly. Liked Robert C. Martin's book, but now I picked up some "Clean C++" and.. I kinda feel dumbed down if they try to sell the KISS principle to a 36 year-old physicist/engineer. Good for them that all our legacy shit und own fuck ups nourish this whole industry of well-meaning advisers. Argh, just fuck it, you priests, sell your obvious calendar mottos elsewhere, they are are just as useful as telling a griever that "rain follows sunshine". - As if they would not some time use the raw pointer that their coworker gave 'em, to ship shit tomorrow?