Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Am I the only one that finds OSG's code disgusting?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 metsfan   Members   -  Reputation: 654

Like
1Likes
Like

Posted 03 April 2013 - 10:28 AM

So I've decided that as an exercise to learn more about engine development that I would develop a platform-independent scene graph with the ability to have renderers for multiple rendering systems.  I have heard much praise from OpenSceneGraph, so I decided to have a look at their code for ideas and inspiration.  

 

What I found instead was a sea of bad code.  In particular my gripes were:

 

1) Tons of protected member state.  This opens a HUGE potential for problems later on, and would require massive refactoring if the underlying base classes ever changed.

 

2) Every object extends from a "base object" (similar to Java), and supports only manual reference counting.  I once considered a system like this, and came to realize (with the help of others) it causes nothing but problems in the long run.  Why OSG?

 

3) Exposing getters and setters for properties that have no business being exposed.  Literally every bit of internal state can be modified through a setter, and in some cases it's extremely inappropriate.  The idea of private state is practically nonexistent in OSG.

 

4) I was expecting an abstraction of OpenGL, and found only a thin wrapper.  The idea that OSG could ever support another rendering library is basically impossible at this point.

 

Now this isn't to say I didn't take away anything positive from my dive into their code.  In fact there were several things I liked.   But overall, wow what a disappointment that was.  Is this the feeling most people get when they look at OSG's code, or am I just being too critical?



Sponsor:

#2 JTippetts   Moderators   -  Reputation: 8581

Like
3Likes
Like

Posted 03 April 2013 - 10:38 AM

OSG started in 1998. That's 15 years of advancement that has occurred in computer science since it began. A lot of what OSG does was "standard procedure" in 1998. You see this kind of problem in lots of aging codebases, not just OSG. Look at the various other open-source rendering libraries and rendering API abstractions. What once was considered correct no longer is in many cases, and programmers as a whole are generally more well-rounded with a wealth of experience to tap via the internet, experience that just didn't exist in 1998.

#3 metsfan   Members   -  Reputation: 654

Like
0Likes
Like

Posted 03 April 2013 - 10:42 AM

OSG started in 1998. That's 15 years of advancement that has occurred in computer science since it began. A lot of what OSG does was "standard procedure" in 1998. You see this kind of problem in lots of aging codebases, not just OSG. Look at the various other open-source rendering libraries and rendering API abstractions. What once was considered correct no longer is in many cases, and programmers as a whole are generally more well-rounded with a wealth of experience to tap via the internet, experience that just didn't exist in 1998.

 

This does make a lot of sense...are there other, more modern projects that you would recommend?



#4 schupf   Members   -  Reputation: 216

Like
1Likes
Like

Posted 05 April 2013 - 05:57 PM

I agree, OSGs code is a mess. But its the lack of documentation that really makes working with OSG such a pain in the ass...






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS