Page 1 of 1
Software Engineering Philosophical Crisis
Posted: Fri Jun 21, 2013 2:20 pm
by Jazonxyz
After learning so much about object orient programming, and learning as much as I can about design patterns and what patterns are best for each situation, I feel like all the philosophy I've learned has collapsed upon itself. Instead of making things easier to program, 'elegant' solutions tend to over complicate development. At this point, I'm even considering returning to procedural programming using regular C.
I'm losing interest in inheritance and polymorphism. I would rather have a component-based system to give objects extra functionality. This way, I don't have to worry as much about having a bunch of source files. I could just have components and factories to string them together.
I do, however, like how you can make a Game class and have that take care of framerate, flipping the screen, etc. and all you have to do is overwrite the run and render method.
Also, it just seems that I could get much more done, and at a much faster pace, if I just use regular C.
Does anybody care to share your thoughts on the subject?
Re: Software Engineering Philosophical Crisis
Posted: Fri Jun 21, 2013 2:51 pm
by Rebornxeno
I haven't inherited or used polymorphism ever. I have used templates, but that's about as morphism as it is for me. It seems to me that those things limit, instead of enhance. I use c++ though I don't use a lot of those extra features it comes with. I might as well be using c.
I have a class that does a lot of the work for rendering, setting up displays, textures, buffers, and pretty much everything related to directx, though I don't have any methods I override or that stuff. It's just a way I group the related stuff together, pretty much like a namespace that doesn't have to mess with global variables.
Re: Software Engineering Philosophical Crisis
Posted: Fri Jun 21, 2013 5:49 pm
by TheBuzzSaw
You need to keep one thing in mind. Object-oriented programming is a set of tools to help you solve problems. If inheritance/polymorphism are frustrating you, that is not proof of faults in OOP. It just means you used those features in the wrong spot. You had bad design.
A component-oriented design is not suddenly NOT object-oriented. You still use classes/objects to achieve your goal. The world has a lot of goofy ideas about how OOP is "supposed" to be applied. I do find myself using inheritance less and less in my recent code, but there are a few spots where I cannot live without polymorphism.
Keep your eye on the ball. Write the code that needs to be written. Do not use OOP because you're supposed to. Use OOP where it solves the problem best.
Re: Software Engineering Philosophical Crisis
Posted: Sat Jun 22, 2013 8:51 pm
by MarauderIIC
If you have the time, I strongly recommend finding a copy of
http://www.amazon.com/exec/obidos/ASIN/0201309831 C++ FAQs. (The "Lite" version is here
http://www.parashift.com/c++-faq/ but having read a lot of the book, the book is definitely worthwhile, although some parts are out of date e.g. he uses exception specification)
One of the principles is how OOP enables reuse; it's easier to make
old code use
new code thanks to interfaces etc, without modifying old code.
BuzzSaw's got the overarching premise though.
Re: Software Engineering Philosophical Crisis
Posted: Thu Jun 27, 2013 7:53 am
by Falco Girgis
You have no idea how many times I see this kind of shit happen. It even happened to me. What you rarely see is someone who is as aware as you are as to what happened.
You just usually see people move further and further away from their programming goals and get less and less motivated to code in general as they wind up digging themselves up deeper into object oriented hell.
This is why I am a C fan. This is why I will always suggest learning C before C++. Rather than running around in circles, blindly adhering to some object-oriented philosophy, C promotes actually writing the goddamn code. You spend less time worrying about bullshit and more time achieving the task at hand. The success rate of beginners is higher with C than it is in C++, from my experience.
What you have to understand about C++ (and OO in general) is what has already been stated. It is merely one tool in your programmers' toolbag. If it were the only tool or always the right tool, procedural, functional, and other non-OO languages wouldn't exist. You use the object-oriented features of C++ to help you with code reusability and organization, not just to be a pompous fuck and say that you are being "proper."
Re: Software Engineering Philosophical Crisis
Posted: Thu Jun 27, 2013 11:59 am
by TheBuzzSaw
C# and Java can go die in a fire.
Re: Software Engineering Philosophical Crisis
Posted: Thu Jun 27, 2013 1:55 pm
by dandymcgee
TheBuzzSaw wrote:C# andJava can go die in a fire.
Fix'd. *Goes back to writing C# for a living*
Re: Software Engineering Philosophical Crisis
Posted: Thu Jun 27, 2013 2:04 pm
by Rapid Cube
Falco Girgis wrote:
This is why I am a C fan. This is why I will always suggest learning C before C++. Rather than running around in circles, blindly adhering to some object-oriented philosophy, C promotes actually writing the goddamn code. You spend less time worrying about bullshit and more time achieving the task at hand. The success rate of beginners is higher with C than it is in C++, from my experience.
Starting with C++ before C was easily the biggest mistake I've made learning how to program. There was a period of two years where I couldn't get anything done because I was trying to force OO where it didn't fit. Any time I came up with a design I liked, it usually took about an hour implementing it for me to start hating it. Then I would start over again and the process would repeat. It killed off nearly all my motivation. Now I tend to use a C with classes approach and its made programming much easier and my code much prettier.
Re: Software Engineering Philosophical Crisis
Posted: Fri Jun 28, 2013 3:17 pm
by TheBuzzSaw
dandymcgee wrote:Fix'd. *Goes back to writing C# for a living*
I write C# for a living too.
Re: Software Engineering Philosophical Crisis
Posted: Mon Jul 01, 2013 10:39 am
by eatcomics
TheBuzzSaw wrote:dandymcgee wrote:Fix'd. *Goes back to writing C# for a living*
I write C# for a living too.
I love C#
Re: Software Engineering Philosophical Crisis
Posted: Tue Jul 02, 2013 1:47 pm
by TheBuzzSaw
eatcomics wrote:I love C#
Trust me. I love C# as a language. I think the C# spec runs circles around the Java spec. I simply refuse to use either one for any personal projects. Garbage collection and virtual machines are for chumps.
Re: Software Engineering Philosophical Crisis
Posted: Wed Jul 03, 2013 8:51 am
by eatcomics
TheBuzzSaw wrote:eatcomics wrote:I love C#
Trust me. I love C# as a language. I think the C# spec runs circles around the Java spec. I simply refuse to use either one for any personal projects. Garbage collection and virtual machines are for chumps.
Oh okay, I thought you were just hating on C# in general.