So, I felt guilty about losing all the source files for my pong tutorial, and right now, I loathe rewriting it all with everything going on - SO I thought I might put up a little tidbit of mine that has helped me get to a propper, working and finished program with less frustration, the answer of course planning!
You may say that this is digital age - and we programmers have no place for the old pen & paper; that new RAD IDEs and libraries let you jump straight into the code and be done with your program in a flash - OK, I basically rehashed the last few Visual Studio adverts and microsofts new philosophy. Not to say Visual Studio is bad, just that the said approach may have some inherent 'disadvantages'...
I have no intention of making this long, its an unrelated tidbit - and to be completely honest its probably more aimed at beginners. To study this example I'll use Geoff.
Geoff is a software developper, and he's decided he needs a program to manage his data from his home server computer. He's tired of having to ssh into it, creating shares for one or two files. So he wants his program to do the following:
1.) Recognise that he is who he says he is with a username and password
2.) Be able to sent tty commands to his server and grab is files from one place as well as be able to use his server as a test server for his new platformer he is writing.
Geoff decides that thanks to his new RAD IDE he can get this done fast, so he sets about writing the server application. Sure enough, within a few hours, its on the server happily waiting for a client to connect to it... Chuga Chuga Chuga...
Meanwhile Geoff sets about writing his client. Just as he starts out he realises something - the socket he wrote on the server only accepts one client! No good if you want to have your new platformed connected and a client to monitor whats going on!
Disgruntled, Geoff pours himself a coffee, re-opens the source and tries to implement a way or routing sockets in his 850line server program... But no luck, after a further 150 lines he realizes he not only hard coded all his constants but adding this functionality would mean tearing up the main loop and rewriting it before starting to bug fix it. Geoff will have to rewrite his entire server.
vBulletin Message