29 gennaio 2010
C++ Faq Lite… I was reading around to find out some nice resources about the nitty gritty details of the C++ … I think I know a bunch of stuff, but that’s never enough, so must keep reading and studying
… and at this url, there are a lot of useful answers… Mostly you can read them so you just keep ‘em popping in your mind while you code…. Only using them frequently can lead to a complete understanding of them
…
http://www.parashift.com/c++-faq-lite/index.html
More sites to come
Pubblicato in Programming Book | Nessun commento »
17 gennaio 2010
Time is ticking and I just started my mind trip through the industry to find out what I’ll do next…
That’s going to be an interesting moment in my life, changing purpouse and shape to my everyday life. I’m not shure what I’m going to do, but surely that’ll be fun :).
I’m pretty confident I’ll have more on Mathware that will come in the next days, and I’m searching through my 30+ HDs in order to look back at all I did.
I found that using SourceForge is a bit cumbersome, so probably that’s why I’m so lazy at pushing the code inside it. I’ll move to Google Code probably and I’m evaluating mercurial as opposed to SVN. That should boost things up a little bit in posting new pieces of code, and use this blog as the “frontpage” for the work, whereas the Google Code page should stay clean.
I’d love to have more custom pages for some of the material I have to post, but that’s just a matter of special links and some html/php coding (that bores me to hell).
I would probably add a couple of interesting things I found back in my HD, that’s going to build up my demos/source code from here…. That’s so fun
I always forget all the stuff I wrote in the last decade! I think that all that source code may be useful to people out there, especially for who’s gonna try out the hard path of the hard core game programmer
I always thought I was going to write a couple of books soon or later, but probably I’ll move this to short PDF docs that can be downloaded from this website. Writing an entire book takes too much time and I started and quited like one hundred times.
So, to make a long story short, here we are, I’ll put a deadly next weekend something up on Google Code! I still don’t know how to push things around to give a little bit of visibility, but I think I don’t care in the end, since that’s mostly for my own reference and introspection… Soooo cooool
Cya
Pubblicato in Senza categoria | Nessun commento »
8 dicembre 2009
Yes, that’s ages that I really code… Too much stuff that is pressing to make different things… That’s really like being a butterfly caught in the spider web. Well that’s december… everything rolled out as being the worst time in my life history. There are chances I can’t find relief in anything at all but sitting here at my PC and give birth to code…
Since it seems I failed to reach a reasonable way to make money out of it, well simply I’ll feel better making my part and giving out my creations to the community. So I’ll release all the source code that can come to my mind, and in an ordinate way now.
Perhaps this will give me back again the love for creativity, programming and science. I’ll set up everything for source forge distribution gathering from my old source code here and there, and organizing it like I wanted to do for ages. I have like 10 or 12 HD around with souce, studies and such. That’s better not to waste all of this. Not the code I mean, the experience.
Everytime I look back at my old code, I honestly think that’s just a waste of time. What matters is just the problem that I have to face at the moment. Sometimes I had to go back to old code to make it alive again into projects. Well if that’s the case, what’s best than releasing everything to the community so that mother internet will keep ideas and source for me right there for when I’ll be back to it? And if I’ll find people that will follow my works , learn from them and improve… well that’s exactly what I wanted to do, and now I may have the age and the right perspective to do it.
I’ll start from MathWare since that’s something I had to write dozens of time, a basic Math library to include in my projects…everytime, that’s not just the GL or DX you need to get started, but all that math stuff that nowadays programmers seem to forget. You need it and a lot of it if you want to move forward.
So I’ll daily blog about my progress here, not because I care that somebody may care, but just because I want to be concrete and make what I like. Living for food if necessary.. who cares? … back to coding… c u.
Pubblicato in Senza categoria | Nessun commento »
25 novembre 2009
Something often overlooked by programmers and that can save your life, is the task list in Visual Studio.
If not already shown you can bring it up by using : On the View menu, select Other Windows and choose Task List.
It will show a lot of useful hints while you progress as you use it. Of course at the beginning that’s plain empty.
To add a Task you have two ways. The first one is by adding comments in your code using in C++ comments that have a tag like: TODO, HACK, UNDONE. You can even add customs but they are already fine for the wide use.
The second one is to add it manually. In this way the task won’t be related to the current edited file.
So you can have a hierarchy of tasks that are marked bot locally at file level and globally at project level. That’s really helpful.
An example of Task in the code:
// TODO add a check to the return value
float value = getFloatValue();
// HACK this is really here just for quick prototype but remove quickly!
int value = mValues[x];
// UNDONE this is a stub function will just alwasy return -1
int getValue() {
return -1;
}
And they will simply pop up in you task list in the file they have been inserted to
I got addicted to this quickly. Enjoy!
Pubblicato in Programming Book | Nessun commento »
7 novembre 2009
That’s a strange question, but this is important to understand upfront. When trying to make something that can be browser enabled.. well that’s a possibility.
I think FLEX is the only solution for a programmer. There is a pretty good article about this, and the link to read and understand the differences at a glance is here:
http://theresidentalien.typepad.com/ginormous/2009/02/the-difference-between-flex-and-flash.html
I’m probably not going to be the smartest PHP developer ( argh.. I love you ARM asm), if you give me a language C / C++ style (yes doesn’t matter if that’s OO or not), I think I can make Unreal T.3 or Doom 3. That’s it :).
Something that looks like a promising Free way to start :
http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page
Another interesting tutorial from the ground up (for game development):
http://www.brighthub.com/internet/web-development/articles/11010.aspx
Pubblicato in Programming Book | Nessun commento »
6 novembre 2009
This can be another option. Since we all know C, this could be interesting to have a nice C++ real time scripting system like then one in QuakeC to make everything working and run smooth inside our code. This would improve productivity! More tests on this subject as well.
Pubblicato in Programming Book | Nessun commento »
6 novembre 2009
Google V8 is C++, and open source… so quick to install and get it running (?)… it deserves a test and comments (just have to see if really platform independent!)
Some links that can become useful:
http://code.google.com/intl/it-IT/apis/v8/embed.html
http://cplus.about.com/b/2009/01/26/using-javascript-in-your-c-applications.htm
An alternative can be:
http://flusspferd.org/
More on the topic soon
Pubblicato in Programming Book | Nessun commento »
4 novembre 2009
That’s really like we are driving a space rocket down the tunnel… stay tuned… by the way… I started the Cohesion… and I want storm and tempest …. beware … I’m coming guys
P.S. Thanks to Hackers, Gamers, and Kushner.
Pubblicato in Senza categoria | Nessun commento »
27 ottobre 2009
One of the misconceptions i’ve seen in early c++ programmers is the continuous vision of the operator[] as the old C counterpart.
When using an std::vector you have a powerful container with random access iterator. When you write something like
std::vector<int> mV;
mV.push_back(7);
int val = mV[0];
What you get is a call to the operator[] of the vector template. So you still have a function call penalty (that could or couldn’t be inlined). Of course this is costy, but what’s more costy if the lack of range check. So usually in real case scenarios (and only if you really can’t predict who’s gonna call something inside the vector otherwise there is no need for range check all the time… if you add it “just to be sure” have a revision at your code, since something is going wrong already).
Anyway if you need a range check, us the std::vector::at() function. This is going to provide you with range check automatically, so you write cleaner code in a single line. If for example you are refactoring some code, you can safely eliminate every block of code where you have a range check for the var with a call to the .at() function.
Of course in the case the range check was an assert, it would have been wiped away, but still try to consider if the function is called often or just seldomly, and evaluate the potential risk on unchecked access of vector values.
Pubblicato in Programming Book | Nessun commento »
24 ottobre 2009
Of course this is calling for troubles.
When you declare data members in an abstract base class (that is a class that has at least a pure virtual function in it), you get all the kind of results.
First of all, the constructor is not called on a hierarchy of classes, you still have to call it explicitly! Take as an example a three tier class hierarchy with single inheritance, this means that the most derived class will still have to call explicitly the constructor of the Base abstract class to initialize the data members.
What’s worse is that on same cases and some compilers you get directly a wrong sizeof of the class! And a memory fault when trying to access the data members inside the class.
You may think that is senseless as the new operator should anyway calculate the proper sizeof the class. Well that’s not properly true. At least not in XCode :). I will investigate if this is going to happen the same in the VC++ . But anyway that’s calling for troubles, so if you really need to declare an ABC for interface purpouses (like in Java), avoid inserting members inside it. Probably if you wanted base functionality in your class ( I hit this problem when making a hierarchy for an UI Elements group inside our game), you don’t really need an interface but some specialization. For example a BUTTON class could have position, and an image over it. If you want a BUTTONWITHTEXT inheritance can go straight, but don’t try to virtualize the behaviour of the POSITION inside an ABC (Abstract Base Class).
Pubblicato in Programming Book | Nessun commento »