473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,385 developers and data experts.

Class 1: So You Wanna Learn Programming... (In C++)

Banfa
9,065 Expert Mod 8TB
Posted by Ganon11

So, you want to learn how to program! Good for you! Programming is a very intruiging and fun activity to pick up, and it's also a great career choice if you like it! Finally, it can be a great brain teaser-type activity, as you challenge yourself with creative and difficult problems!

But there's a problem.

What I'm typing in right now is English. It's cool, it lets you understand what I'm saying, and we've spoken English all our lives. What I'm GOING to be writing in, however, could be called another language entirely. It's what I (rather uncreatively) call Computer-Talk. You would have no trouble understanding the sentence, "Today I took a walk in the park." But try your hand at understanding, "Access the value at position i of myArray to initialize your variable."

Huh?

Fortunately, we won't be dealing with anything this weird for a while. Until then, I'm going to be teaching you a little bit about the basics of Computer-Talk - easy things that you may have heard of before, like Variables, or Input. I'm also going to show you a few things that we see in English class or Math class, but mean completely different things when programming. So let's get started!

The very first vocabulary words we have to learn about are the basics of any language. You have to know what I'm talking about when I ask you to write some programs. Writing programs is called coding, since we are writing code that the computer will be able to understand. Once we finish our beautiful programs, we have to turn them into something the computer can understand. In order to do this, we use a compiler. A compiler can also be a program that helps you to code. For example, I use Bloodshed Dev C++. Not only does this let me compile and run my programs, but it will recognize certain keywords and highlight, change color, or embold them so that I can see important things more easily. This type of compiler is called an Integrated Design Environment, or IDE, because it is an environment that is friendly to us while we design our program. Cool, yeah?

All right, down to some hardcore programming terms. The most important thing to learn for a beginner is input and output. When you ask the user (that's whoever will be running your finished program) for some value that will change the way your program runs, that's called input. In other words, the user is inputting a value. For example, suppose you made a guessing game in which your program generates a random number and the user tries to guess it. Well, in order to do this, you need to be able to get the value, right? Right. That's input.

Output is even simpler. Any program you run has results. You click a button: something appears on the screen. You move: it plays a sound. The moniter and speakers are both output devices - they are a way for the computer to communicate with you. Our output will be very simple, consisting mainly of words appearing in a text box, but it is still vital. Output will help you to determine what your program does. For example, in the guessing game, your program needs to tell the user if they have guessed the number or not. It wouldn't be a very good program if you didn't let the user know if they won, would it? Output can also be used to determine where your program is NOT working (God forbid!). By placing output statements in critical points, you, the programmer, can say, "All right, I expected this value to be this, but instead it's this. This must have gone wrong," and so on.

The final word on our list of basics is syntax. In English, syntax means "the study of the patterns of formation of sentences and phrases from words." (http://dictionary.reference.com/browse/syntax) For example, I type in a very straightforward manner. But consider Yoda, who would say, "In a very straightforward manner type I." The difference in our speaking style is in syntax. Syntax has a similar meaning in programming. In order for the computer to understand what you type, you have to follow certain rules. These rules will become evident as we learn some real programming terms.

Well, now you know what I mean when I say, "Compile your program and tell me the output." You also know what I mean when I say, "Ask the user for input." But you still don't know any real programming! That will come next time, when I show you the most basic of all programs - Hello World!
Dec 5 '06 #1
7 5973
Banfa,
Nice article. Now i am looking forward little bit more. I know basics of C and C++(OOP). But i like to start professional projects using C and C++. Where from and how shall i start? Would you please help me to build my Dream. Be a C or C++ Professional Programmer. More specifically build myself as professional developer using C/C++.
Dec 25 '07 #2
please written the programmes to understand the listeners (freshers)
Dec 26 '07 #3
thank for resistration
Dec 26 '07 #4
please send reply to me sir............................................... ..
Dec 26 '07 #5
thyank u sir............................................... ................
any way good night sir.........................................
Dec 26 '07 #6
So far it is great. What I'm looking for however, is how to make the columns in the start/programs smaller. In my windows, the first one is so large, it won't let some of the others show in the screen.
Jan 4 '08 #7
Cam you tell me How to make the text color I alway make a mistake all time .
Can i have some form of c++? like syntax .
thank you
Jan 11 '08 #8

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

Similar topics

9
by: Eric | last post by:
I have a few questions: 1. Should I learn C first or VB? 2. Should I get a book or learn from websites? 3. What book or which website is best? 4. Or should I take a course?
7
by: | last post by:
1) Downloading sample code and playing with it? 2) Reading books and trying to follow them? Any other ideas? I have always wanted to learn programming, just don't know hot to go about it. ...
12
by: Harry | last post by:
Hi, I am a system administrator who wants to move to Web App. development. I have read quite a lot articles regarding .net framework and visual studio.net and feel comfortable to start learning...
14
by: GUSTAVO V. P. | last post by:
Hello, my name is Gustavo and I want to know: What one needs to be a good programmer of computers? Which your advice are to be a good programmer? How is the logic acquired? Is it true that...
0
by: pedaammulu | last post by:
Learn how to develop your own ACCOUNTING software. (Inventory Module Included) All professionals, Take Note. Start your own firm or quickly get a job in a MNC, and start earning from today. ...
1
by: cpaprogrammer | last post by:
I'm an accountant by trade and want to learn programming on my own time. I am interested in learning about databases and scripting so that I can utilize these skills in data collection for my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.