Software Engineering Philosophical Crisis

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
Jazonxyz
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 10
Joined: Mon Sep 29, 2008 8:37 pm

Software Engineering Philosophical Crisis

Post 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?
Rebornxeno
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 85
Joined: Thu Jun 23, 2011 11:12 am

Re: Software Engineering Philosophical Crisis

Post 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.
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Software Engineering Philosophical Crisis

Post 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.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Software Engineering Philosophical Crisis

Post 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.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Software Engineering Philosophical Crisis

Post 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."
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Software Engineering Philosophical Crisis

Post by TheBuzzSaw »

C# and Java can go die in a fire. :nono:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Software Engineering Philosophical Crisis

Post by dandymcgee »

TheBuzzSaw wrote:C# andJava can go die in a fire. :nono:
Fix'd. *Goes back to writing C# for a living*
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Rapid Cube
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 22
Joined: Mon Mar 14, 2011 11:43 pm
Programming Language of Choice: C++

Re: Software Engineering Philosophical Crisis

Post 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.
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Software Engineering Philosophical Crisis

Post by TheBuzzSaw »

dandymcgee wrote:Fix'd. *Goes back to writing C# for a living*
I write C# for a living too.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Software Engineering Philosophical Crisis

Post 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# :(
Image
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Software Engineering Philosophical Crisis

Post 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.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Software Engineering Philosophical Crisis

Post 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.
Image
Post Reply