Programming Blog

Hey guys, i have just started writing a blog for programmers where once can find different types of programs in various languages such as C++,Java and many more. It also contains an FAQ and much more will be included overtime.

http://programsplusplus.blogspot.com/

hope u like it. I really need your support...!!!
I'm a big fan of ambition however, those examples are demonstrating a lot of what not to do in C++...
can u enlighten us ???
I agree with moorecm here.
can u guys plz tellme whats wrng ??? it will really help me.
closed account (1vRz3TCk)
Your C++ looks to be pre-standard.
~~~Constructive Criticism~~~


This is the list of things that you could improve/change:
1. Please do not "fancy-format" the console using <conio.h>. In fact, please do not use <conio.h> when possible, as it varies hugely between compilers.
2. Please upgrade from Turbo C++ to something newer. There so much you're probably missing out on. :/
3. Either prefix all your calls to cout and cin with std:: or put using namespace std; at the top each of your functions. This is an error.
4. You might want to remove the redundant continue from your while loop in #6.
5. In #3, there is no standardized function random() or randomize() in <cstdlib>. Maybe Turbo C++ added it there. Use srand() and rand() instead, please. :)
6. C++ type casing is a lot richer than C-style casts. You might want to mention that?

Sorry, but you don't seem to be quite ready for teaching good C++ habits. This list may did grow longer. :/

-Albatross

EDIT: Four digits that could be misread as the first three digits of pi posts, and counting (3114).
Last edited on
well it does demonstrate the very basics of C++, more advanced programs will be added with time.
duly noted albatross...any other suggestions ??
closed account (1vRz3TCk)
If I took your code and put it in say, Visual C++ Express, it would not compile. It shows very out dated C++ not the very Basics of C++.

Edit: Why does 'Fatal1ty' ring bells?never-mind, its probably just a motherboard.
Last edited on
ok , thanx guys, umm any other suggestions are most welcome, i will apply the changes ASAP.
Don't take it the wrong way, like I said, I'm a big fan of ambition. I can appreciate the time that has been put into this!

Albatross's comments are exactly what I'm talking about, especially the C-style cast one. Basically, that should never be done in C++. Saying so would be a good idea, and possibly adding a citation (Effective C++ or C++ Coding Standards--I think both books covered this topic).

I wouldn't even teach jumps without a practical example. In the vast majority of cases goto should be avoided, as there are better alternatives. However, there are valid uses of goto. This might take a bit of research to find a good example. One benefit of goto is that you can jump out of nested scopes (something that exceptions can also do) cleanly.

My main complaint with each section is that they are not comprehensive. Pre vs. post increment, for example, which (if any) is better? Why (always provide explicit proof or citations to support this conclusion)?

Topic archived. No new replies allowed.