•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Software Development category of DaniWeb, a massive community of 374,042 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,905 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Software Development advertiser:
Feb 24th, 2007, 11:36 pm
The internet gives us a wealth of information, and programming is no exception. You can literally find learn about any language just through a broadband internet connection. And since 90% of the tutorials out there are free, what better way to learn programming than if it doesn't cost us a penny? Unfortunately, many programming newbies do not realize the hidden gotchas behind using these tutorials. Too many simply do not teach us what we should not be doing, or worse yet, not teaching us what we should be doing.
Let me give some C/C++ examples, since that is the language I write software in. Look through the majority of the "starting C/C++" tutorials out there. How many actually teach you that:
Perhaps a better method would be to teach safest methods, even though a bit more complicated, and then introduce other practices once the user knows how to handle them. Like teaching usage of fgets() and getline() instead of cin >> and scanf(). It's harder, yes. But the typical problem is this: a user learns the easy method by using one of the aforementioned techniques that leaves a newline in the input buffer. That's all fine until they realize that they need to input a string that has a space in it.
A smart newbie might quickly Google it, see that getline() reads an entire line, inserts it into his/her program, and then wonder why it doesn't work. That's when the friendly folk at DaniWeb has to help them out.
This problem isn't isolated in online tutorials. There are horrible university teachers that teach us crap too, and there are books that use incorrect practices. Heck, even Microsoft's MSDN uses
Regardless, it would be nice to see fresh new "Starting C/C++" tutorials that explain techniques that can be used in the future too, not simple makeshift code that will break the minute you try to use it in a real-life application. Sure, it may not be popular among newbies, but I say "no pain, no gain". Programming isn't going to be easy, so you might as well get used to it.
Let me give some C/C++ examples, since that is the language I write software in. Look through the majority of the "starting C/C++" tutorials out there. How many actually teach you that:
void mainis wrongfflush(stdin)is undefined behaviourgetsis unbuffered- scanf() and cin >> leave trailing newlines in the input buffer
Perhaps a better method would be to teach safest methods, even though a bit more complicated, and then introduce other practices once the user knows how to handle them. Like teaching usage of fgets() and getline() instead of cin >> and scanf(). It's harder, yes. But the typical problem is this: a user learns the easy method by using one of the aforementioned techniques that leaves a newline in the input buffer. That's all fine until they realize that they need to input a string that has a space in it.
A smart newbie might quickly Google it, see that getline() reads an entire line, inserts it into his/her program, and then wonder why it doesn't work. That's when the friendly folk at DaniWeb has to help them out.

This problem isn't isolated in online tutorials. There are horrible university teachers that teach us crap too, and there are books that use incorrect practices. Heck, even Microsoft's MSDN uses
void main in all their console examples!Regardless, it would be nice to see fresh new "Starting C/C++" tutorials that explain techniques that can be used in the future too, not simple makeshift code that will break the minute you try to use it in a real-life application. Sure, it may not be popular among newbies, but I say "no pain, no gain". Programming isn't going to be easy, so you might as well get used to it.
This blog entry was written by John Altenmueller, staff writer aka John A. It has received 1,095 views, 0 comments, and 0 linkbacks. 1 voter has rated this entry 5 out of 5 stars.
•
•
•
•
bbc broadcast c c++ ccna code coding compiler computer customers desktop developers development economy funds google high-performance holiday internet investments java jobs linux mcse microsoft microsystems networking online pc planning platform portfolio practices programmers programming rebate retail shopping software stocks study sun tutorials video web windows xbox 360 xbox live youtube
All Recent Tags Post Comment
•
•
•
•
Only community members can start a blog or comment on blog entries. You must register or log in to contribute.
•
•
•
•
•
•
•
•
DaniWeb Software Development Marketplace
Related Blog Entries
- SF Password Hijack Highlights Importance of Process in City, State IT (1 Day Ago)
- Security Holes Spring Up in Java Framework (8 Days Ago)
- iPhone 3G: It Was All Yellow (9 Days Ago)
- iPhone App Store to open Friday, Jailbreakers could care less (16 Days Ago)
- Cross-Platform RealBasic 3 IDE Ships Today (16 Days Ago)
- Coders Can be Frugal When They Use Krugle (17 Days Ago)
- Microsoft Publishes File Format Specs, 'Open Connections' (18 Days Ago)
- FreeRunner Linux Phone Liberated on July 4 (21 Days Ago)
- Apple Leopard changes spots (23 Days Ago)
- With ‘Ganymede’ Release, Eclipse Community Gets it Done (24 Days Ago)
Related Forum Threads
- Online video tutorial of C++ !!! (C++)
- any tutorials on algorithms for beginners (Computer Science and Software Design)
- any easy online tutorials on oops? (Java)
- javascript -- tutorials and exercises (JavaScript / DHTML / AJAX)
- C++ (C++)
- Learning JavaScript (JavaScript / DHTML / AJAX)
- i need help (C++)
- recommendations for JavaScript learning resources? (JavaScript / DHTML / AJAX)
- how to use DirectX in VC++ (Game Development)