By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,268 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,268 IT Pros & Developers. It's quick & easy.

how can i be a good programmer in c and c++?

P: 7
How should i learn programming and what is the best way of learning c and c++? which is the best book of c and c++ programming language?

I have been studying from the book " the complete c++ reference" written by "Mr. Herbert Schildt".
May 10 '10 #1
Share this Question
Share on Google+
9 Replies

Expert Mod 5K+
P: 9,731
Go to school and become a software developer.
There are a lot of things that you can learn from a book but school will give you a more hands on approach.

PS arrays are just blocks of memory that is accessible in sequence...there's not much logic to them.
May 13 '10 #2

Expert Mod 100+
P: 931
To become a good programmer, I think various aspects should be taken care of:

1. One should be strong logically. Start with small small code snippets and understand the logic behind them.
2. Run the same code under various input and identify the reasons behind the outputs.
3. Write a code with proper coding convention, so you yourself don't get confused and code program quality improves.
4. Write a code with minimum bugs. Take care of memory allocation and exception handling while using pointers in C/C++.
5. There are various sites discussing technology interview puzzles. Solve them.
6. Do continuous practice.

Complete c++ reference is a good book to start with. Arrays are very well explained in there. Ask if you don't understand anything in our C/C++ forum.
May 31 '10 #3

P: 1
I'm quite sure of your skill level, purpose for learning and age but here's my best advice:

1) Write your code knowing someone else will read it. This means using comments to explain what you want your code to do so they can understand your though process. Even if no one else reads it, if you need to come back to it and if you've forgotten, your comments will save you. Write your code like an english paper. A little known secret is that english majors actually make the best coders. They understand the importance of formatting, style and readability. Understanding code is more important that just getting it to work.

2) Don't code without a plan or design. Use flowcharts and block diagrams before you start coding. Write a document that describes what you plan on doing. Write pseudo code in your .c or .cpp files to provide an outline of sorts. This will keep your code on track and prevent your code/functions from doing too much.

3) Write modular code. Modular code is efficient, small and easy to implement. It also helps you follow your design by abstracting/separating features and functions.

4) Know your target. For a PC, memory is abundant and CPU power is 'infinite'. You should still be aware of memory leaks (malloc/free, new/delete) but it's not completely critical. For an embedded system, ie, Atmel, MSP430, etc. you REALLY need to pay attention to your array sizes, heap, etc.

5) Learn from the masters. Anyone who codes well in C knows about K&R ( Buy it. Seriously. Anyone who codes well in C++ knows about the gang of four ( and Scott Meyers' Effective C++. Again, seriously. Buy these books. If you're trying to become a professional SW engineer, try to get a job at a telecom company. They are known for their coding prowess, process, standards, etc. Remember C and C++ were both created by engineers at Bell Labs (now Lucent/Alcatel). Personally, I'd stay away from learning from open-source code, ie, Linux and they underlying frameworks. Community projects typically don't have people that are as invested as you'll find at private organizations. Also, if you're thinking about the embedded route, Jack Ganssle always has helpful tips. Or you can contact me as well :)

6) Constant learning. Formal education helps, but writing code on your own is the best teacher. Also read coding magazines such as Dr. Dobbs Journal. A little bit about myself: I have a degree in Electrical Engineering but my SW experience started 20 yrs ago when I learned BASIC, Forth, Pascal, then C. I work professionally, predominantly in C and C++, but have dabbled in Java, C#, html and so on. I subscribe to many industry journals, attend seminars and webinars and trade shows to stay fresh.

Personally, I believe C and C++ are the best languages to learn. C#, ruby, python, VB (ugh) and the scores of scripting languages and object-oriented languages may not last 10-15 years from now, but C and C++ will. They are the closest to human readable microcode you can get and virtually every single intelligent electronic device was developed in C. They have matured well and there are plenty of frameworks out there that keep them viable.

Good luck on your journeys!!
Jul 8 '10 #4

Expert 100+
P: 983
First, ask your self what you want to do with your life.

Then, go study under the masters in the field.

C and C++ are great languages, with a rich history behind them. I started with Basic on a Data General system 35 years ago. I learned C in college, and picked up C++ as the language was developing. I also program in a dozen other languages, depending on the task I have to accomplish. Still, C++ with in-line assembly code is probably my favorite for embedded systems, which is my favorite domain.

I've read a lot of good code over the years, and a lot more junk code. The masters still amaze me with their expressional prowess. Still, the reason I get to read junk code is because I'm often called to form it into a robust product after someone beats a prototype together.

But ... back to my first thought ... what do you want to do? Embedded systems? Image processing? Database? Web sites?

Each programming domain has evolved its own use of C/C++, and its own idioms to solve problems. Pick a domain, go have fun writing programs and read lots of other folks' code. You'll pretty quickly learn to recognize the work of the masters. Study what they do, learn why they do things a particular way, and then apply that knowledge to your own programs.

Jul 8 '10 #5

Expert Mod 100+
P: 2,330
Another good approach to learn is intern with an experienced development team. You will learn hands on, in the field skills that even schools or books won't teach you.

If you can't intern, start out volunteering with a good open source project with experienced developers. You can probably find some good local ones so that you get some face to face time.
Jul 13 '10 #6

P: 115
if you don't want to attend schools as such go through some text books on C. The best book for you would be the one which makes you most comfortable and learning an interesting experience instead of a mundane task. You could also go through MIT's open courseware which is free and very informative. At the end of the session you could take quizzes and work on codes.
Jul 23 '10 #7

P: 115
@zodilla58 - what do you have to do to get that "expert" written under your username?
Jul 23 '10 #8

P: 1
Ah,learning it...
Jul 25 '10 #9

P: 45
C++ is d stepping stone to d wide world of coding
Jul 25 '10 #10

Post your reply

Sign in to post your reply or Sign up for a free account.