• Forum
  • Lounge
  • Can anyone help explain how to use patte

 
Can anyone help explain how to use patterns and frameworks to write more efficecient code...for beginners

Especially with concurrency and networking

Yesterday a beginner was struggling with a switch statement for a text based game, I told him to use a main loop for the game and lots of little function called in the statement I was happy to get my first person to be genuinely satisfied with an answer and i remembered how easy it all became when one of you guys first explained it to me.

Lots of little organized easy thinky blocks, thats how I remembered it, but now my practice codes are bigger and more complex I was wondering if anyone could help with ideas for tottaly reusable classes and organizing systems for whacking everything together.

easy thinky blocks in easy thinky blocks.

I cant find much documentation for this for novices but actualy the sooner you learn this the faster I reckon you can learn

I want advice, and a fun idea for a practice code.

and if you can derail the thread in the direction of one of those fun my code solves the problem better I will be happy I love those threads

When im good I will write articles on this for beginners
Last edited on
Are you just asking how to write reusable code?
API Design for C++ is a nice book for this sort of thing.
@biscuit, yeah i guess but more so how to plan it with a certain system too.

@NGen, I always used APIs cos i didnt have access to things like graphics stuff, If i was to write an api in c+ how on earth can i use a keyword that would communicate with the graphics card? theres no c++ graphics keywords that iknow of, would you have to learn machine code to create an API??
closed account (3qX21hU5)
No you would learn one of the low levels graphics libraries like directX or openGL and then build you own layer of abstraction over it. Once I get home ill post a link to a good very beginner framework for directX that you can check out devon.
cool thanks :)
look at SFML for an example of an API. However I wouldn't waste too much time re-inventing the wheel. You could just grab an existing API and add a few libraries of your own to extent it to your needs.
closed account (3qX21hU5)
http://www.youtube.com/watch?v=0kpSiitk4eI here is a semi good video tutorial about learning the basics of C++ and directX (Skip father down to skip all the boring stuff). He uses his own framework (Abstraction layer over DirectX) and if you can get over his slow talking it is quite a good series. All the episodes are long and there is a lot of them. He also has 2 series now it looks like one for beginners (Both for directX and C++ I believe) and one for intermediate. I have not watched the intermediate ones but from his forum it seems like they go into good game programming steps like tilemaps and platformer games.

If you just want to look at his framework check out here http://www.planetchili.net/forum/viewtopic.php?f=3&t=961

There is much better frameworks out there but this gives a very basic on that you can build on. Hope that helps a bit devon
Last edited on
Topic archived. No new replies allowed.