Jump to content
  • Advertisement
  • entries
    109
  • comments
    175
  • views
    117320

I am sold to the Devil !

Sign in to follow this  
Emmanuel Deloget

283 views

Yesterday, I had to change the code of the project I work on at Alpine GmbH - and I realized that my initial idea to use a std::set was really not a Good Idea. A std::set is a nice thing, but it just doesn't do what I need.

A better idea was to use a std::list of std::list. But then an issue arise: this is an embedded platform (Windows CE), and the way we manage memory in the software is horrible (I didn't wrote that part. Someone believed that having memory pools which are created by memory pool managers which are managed by a higher level memory pool manager manager was the way to go; of course, it's slow, and you have no control on memory allocation. But hey, that's a The Memory Manager). Writing an allocator was my first idea (so I did it). Suprise, the code was awfully slow.

No optimization (allocatiopn strategies) of the memory manager helped. Oops.

Finally, after I spent two days on that issue, I decided to go the Old Way: I did my own n-ary tree class, without using the STL. Me. A fervent supporter of the SC++L. I did code something that looks like a linked list of a linked list (and, to help readability, I didn't even followed the SC++L idiom).

I feel ashamed.



Better news: "SOMETHING" goes better and better, here is another excerpt.

Quote:
When listing responsibilities, avoid using verbs whose meaning is unclear and too general. Such verbs encompass "to manage", "to handle" and many more. The obvious reason is that since their meaning is unclear, they won't express a real semantic in your design and you're likely to face problems due to this. Avoiding these verbs has also a neat consequence: there is no more Manager classes in your design, something which turns out to be quite positive. What does a manager do anyway? Does it create or destroy things? Does it store things? Does it cache them? It's often easy to find a better verb to describe what you want to accomplish.


Cookies to the one who can tell me what all this is about.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!