Close

15/12/2017

Programming basics for dummies Part 1

“I always dreamed that my computer could be used as easily as a telephone; my wish has come true: I can’t figure out how to use my phone.”

The Bjarne Stroustrup, programmer, author of the C++programming language.

More and more people nowadays want to learn how to program. I think nobody needs to be convinced that in our age of information technology, every person with a technical background should know the fundamentals of programming, even at the level of the “for dummies”. Of course, this article does not claim to be a comprehensive description of the various nuances of creating programs, but I think a generalization of “computer tricks” will be useful. For those who are just going to learn programming, it is important to start with learning the basics of programming for dummies – this will help save time and effort.

A fragment of the first lecture course of the young fighter. The principles that apply when writing programs, formulated in the form of short theses that explain on what “whales” is based on modern programming languages.

Use knowledge of mathematics

The first and most basic principle of programming for dummies – the widest use of knowledge from various areas of mathematics, to write programs. Of course, to thoroughly understand all the intricacies of higher mathematics You often do not need (unless for programming complex mathematical calculations), but at least the basics of algebra and the ability to read mathematical formulas required. A key concept in programming is a variable – a literal symbol for any number, which have migrated to programming from mathematics.

Each of You was ever solved algebra lessons equations or build the graph of the function. Take, for example, is known to all schedule straight:

And in programming and in algebra the result of the expression means the same thing: in a variable y will be written the expression 2x + 1. However, the value of the variable x is a mathematician and programmer will determine differently.

Remember what math formulas are different you’ll be programmed

The second main problem of programming for dummies to write a program you need not only knowledge of mathematics but also an understanding of the difference between the entry of mathematical formulas in programming from that of classical algebra. The answer is that it would be necessary to bring in “the Bible of programming for dummies” – distinction practical work with variables. A well known example illustrating the basic based programming for dummies:

x = x + 1

From the point of view of classical algebra written here the equation which has as solution meaning: unknown, marked with the letter x can’t be greater than itself by one. For the programmer variable at each moment of time has a certain value. The programmer’s expression say that the variable is written to its previous value incremented by one. Well, from the programmer’s point of view everything is correct and logical.

Image result for Programming basics for dummies

Even the most novice programmer only mastering the basics of programming for dummies knows that some mathematical expressions for writing at least as serious programs is not enough. The program must be able to respond to external conditions and change their behavior depending on them. Here comes to the aid of the basic design of any programming language: IF. Not everyone knows that term is used in the preparation of any algorithm whether it be human behavior or the operation of the machine. An example of the conditions of real life:

IF it’s snowing, WE should take an umbrella

After the word IF is always a condition under which comes the action of standing after the FACT. This design is simply irreplaceable and is the basis for all programming: dummies and hackers. Let’s provide some “coding” example: conditions: make sure when evaluating the expression c = a ÷ b, a divisor b not equal to 0 and compute the quotient.

Leave a Reply

Your email address will not be published. Required fields are marked *