103 karma · joined July 3, 2009
3. for (int i = 0; i < iteration; i++) {
4. testSwitchFinite(i);
5. }
Once i > 5, testSwitchFinite will always skip to default. This function doesn't even test the switch properly.
Something like testSwitchFinite(i%5+1) would have made more sense (for the finite switch and if-else.)
I'd like to hear some thoughts on this.
I remember feeling really happy after finishing up a program that I had been working on for a long time. Just seeing it work so perfectly gave me an incredible sense of satisfaction. It was far better from the satisfaction/pleasure I got from doing things like watching TV/movies, going on dates, eating at nice restaurants, etc.
Developing the program was definitely not play either. It involved things (like fixing bugs, coming up with algorithms) for which I had to expend a considerable amount of intellectual energy. It was work, but it was work worth working on.
Later I was able to get my program to compile on Visual C++ with absolutely no modification.
I find this statement to be rather untrue because I think most modern compilers when forced to be ISO/ANSI compliant (i do: g++ -ansi -pedantic) ensure your code is portable across systems.