How do programmers write programs? (4 photos). Stay Legal: How to Write a Windows Program Without Spending a Dime

If you want to learn computer programming and are looking for a short guide explaining how to learn this art, this article is for you.

Here I will provide you with tips on how to learn how to write computer programs on your own.

Computer programming is one of the most exciting and highly paid areas to work in. Millions of lines of code are written every day, all over the world, resulting in new applications and software. If you like to think analytically and solve puzzles and problems of all kinds, programming is your thing. The key to learning programming is to master programming languages ​​and learn how to apply them to solve complex problems.

The standard way to learn to code is to go to college and get a degree in computer science. However, there are many people who have never studied in institutions, but despite this, have the skills and talent for analytical thinking. I wrote this article for those of you who have not studied to be a programmer, but have already discovered the beauty of programming and would like to master this science. The Internet has created a programming culture that can guide you through this process. With self-discipline and perseverance, you can learn to code and write your own software. It's not only a method to exercise your wits, but also a great way to make money selling your own software, or get a job with a specialist firm if you're really good at it.

How to learn to program?

Computer science is the main field to master, it will give you minimal knowledge and experience in programming. Here are some tips on how to become a programmer.

Learn programming languages

First, you need a desktop or laptop computer that allows you to read and run your programs. Programming is the ability to communicate with the hardware configuration of a computer to perform various computational tasks. The computer understands only machine language written in 1's and 0's. For us humans, to communicate with computers, programming languages ​​have been created whose code can be converted into a machine-readable form by compilers. There are a number of programming languages ​​that change in their applications. You will have to learn at least a dozen major programming languages ​​which includes C, C++, Java, Perl, Lisp and Python.

To learn the basics of programming, start learning C or Python at the beginning. Use online resources and programming books to get the basics. Install coding programs and run them on your computer. Work from the examples and tasks provided in books and e-tutorials to write your own code. One of the best books to start learning "C" is "". Another good book "".

Get a "C" skill and then get into object-oriented programming, made possible by C++. Then get the skills of Java, Perl and , which are widely used for web development. Learn HTML if you plan to work in the field of web development. As you can see, there is a lot of material to learn and it will take at least 5 - 6 years to become proficient in most languages.

Start writing code

This is the best way to practice what you have learned. Write your own code, make mistakes, learn, debug code. Take part in online coding competitions and test your programming skills. Get hold of open source software, read the code, and understand how good programs are written. Learn how master programmers achieve code economy and logical clarity. Get to know your computer and basic hardware. Learn how a computer works at basic levels with memory and processors.

Learn to run Linux or Unix

You cannot call yourself a programmer until you have mastered the Linux and Unix operating systems. Install the Ubuntu distribution on your computer and get familiar with it. This will give you all the programming tools you need, along with compilers.

Compiler - a program that performs compilation (translation of a program compiled on source code).

Student - Expert - Programmer

Find a good mentor to guide you on the path to becoming a master programmer. Listen to advice and learn from it.

Read the coding rules and keep improving

Keep writing your own computer code and think about how you could improve it. Join the open source movement and analyze the anatomy of good software. Create your own website and constantly deepen your knowledge. Remember that there is always room for improvement!

Let there be no illusion that programming is not an easy task. It will take ten to fifteen years at least to get to the point where you can start calling yourself a full time programmer. Your success in programming is directly proportional to the dedication and perseverance with which you conduct your studies.

The purpose of this article is to give you a push in the right direction. I hope that this goal has been achieved to some extent. Free your mind and enter the world of programming with pleasure!

So the ubiquitous fight against software piracy has reached our country, punishing everyone indiscriminately. Of course, this does not mean that it is necessary to urgently wipe all pirated software from home archives (fortunately, law enforcement agencies do not yet make house-to-house rounds in order to detect unlicensed software). But lone programmers who release their programs to the public need to seriously worry about their programs being made in accordance with the law.

For an average, small-scale, read - home, programmer, it is not possible to purchase for personal use such software building monsters as Visual C++, Borland Delphi. And in order to create a really beautiful design of the program interface (icons, pictures, sounds and animation), you will need a lot of money for Photoshop, Corel ...

The average income of an honest person in our country is very small, and for students even less. And the software is very expensive. How to be, you ask? There is only one way out - you need to use free development tools, free file formats. Fortunately, this good is not only under Linux, but also under Windows.

In view of the foregoing, we formulate the task: to write an application for the Windows operating system that has the following qualities - reliability, speed of work, relatively small size of the distribution kit, work without third-party libraries, it is necessary to have a beautiful and convenient graphical interface, naturally, without violating the law and without spending not a penny.

If you throw out compilers / interpreters like Java, PHP, Perl, as well as Visual Basic(which has a relatively low popularity in our country) and other one-oriented and narrowly focused programming heresy, we have at our disposal the following FREE universal software development tools for the Windows operating system:

  1. Visual C++ Express Edition;
  2. C++Builder Turbo Edition;
  3. Pelles C++ for Windows;
  4. Ports with Linux such as GCC, LCC and other CCs;
  5. Borland Delphi Turbo Edition;
  6. Compiler Wanderer "Modula-C-Pascal"(supports three languages ​​C, Pascal, Modula at once). By the way, it was developed by our compatriot.

Let's analyze the disadvantages and advantages of each of the presented development tools, and also determine how they are suitable for solving our task.

Something happened at Melkosoft about a year ago. The great giants of thought and lovers of squeezing a long dollar out of the pocket of gullible users decided to take mercy and gave us a free version of their famous "visual studio", although a little trimmed, but still working and impressive, and bearing the name Visual C++ Express Edition. Let's briefly see how this gesture / tin (underline as necessary) of goodwill will help a simple Russian coder. This compiler is free for home and family, as well as for more global distribution. Hym... But how many of you will limit yourself to creating console programs under Windows 98? The thing is that the Melkosoftovtsy, you see,
by misunderstanding, or maybe by malicious intent, they threw out all the header files related to visual programming from the express distribution kit. But they gave us their new CLR visual programming library, which, in terms of basic concepts, is suspiciously similar to the Delphi VCL. But the trouble is that the CLR requires .NET for its work, the distribution of which weighs 300 meters. Agree that carrying 300 meters in order to make a program weighing 10 meters work is too much respect for Melkosoft.
Outcome: C grade - only for a bold step.

Consider another heavyweight on the software front. Imagine that programming in C++ has become n times easier. Can't you say? Maybe:). In confirmation of this, we turn our attention to C++Builder Turbo Edition.But about this compiler, the opinion of the public radically diverges. On the one hand, the key development language is C / C ++ (which cannot but please the adherents of this language) and the visual convenience is at the highest level, and on the other hand, there is a reason to unleash HolyWar 🙂 - the builder is written in Delphi, and on the other - you can quickly rivet a cool interface for the program, and brag to your comrades that it's written in C :).
Outcome:
In principle, it will do, but the fact that the insides are written in Delphi still haunts me 🙂

Pelles C++ for Windows- A good free development tool. We can say that this is "free Visual C" since all the settings and interface are almost the same. Can compile Native. There is a built-in resource editor and compiler. Only there is no sense in this, visuality is no more than in Visual C ++ Express Edition, and writing a complex program in such conditions can be missed even before retirement.
Outcome: Life is short, you need to write quickly and efficiently - I'm afraid we won't have time.

Consider the gifts of guests from the "other universe". Ports from Linux like GCC, LCC and other CCs are zero visual, the convenience is the same as the previous compiler, in addition, LCC turned out to be a little inoperative, and in order to download GCC from the site and make it work, you need to be an academic. 🙂
Outcome: We do not take.

Borland Delphi Turbo Edition- free, there is a resource editor, allows you to write programs for Windows 32 that do not require any additional libraries. But there are also disadvantages - there is no command line compiler (in principle, not a big loss), it clogs memory over time and, most unpleasantly, the Turbo environment requires dotNET installed for its work. 🙁
Outcome: Fits

The Modula-C-Pascal Wanderer compiler is a domestic development, a promising compiler, but the disadvantages are the same as those of Pelles C ++ for Windows - extremely low visibility.
Outcome: Patriotic, but not cost-effective. We do not take.

Graphics and sound are illegal - unfortunately or fortunately, the DOS times are over, the era of programs with visual and colorful interface has come. Pictures, icons, animation and other tinsel, which is very convenient to hide the general wretchedness of the program. 🙂 Even in the days of DOS, primitive, by today's standards, graphics were made in special programs - ASCII editors. Ideal for creating beautiful icons, pictures Adobe Photoshop, but it is not affordable for an honest worker of the software front. We will look for an alternative. And we will find it in the camp of ported graphic editors from Linux, namely Gimp. Simple, a little uncomfortable after a pirated Photoshop, but you can get used to it. But as
same sound, you ask? The modern user is spoiled and not today - tomorrow he will want the program to respond to his every action with his voice. How to do it? WaveLab, Sound Forge and Adobe Audition demand payment for their abilities. Fortunately, there is a sound editor Audacity, written by graduate student Dominic Matsoni of Carnegie Mallon University.

Format is not a format or how not to make a mistake in choosing file formats - for successful and legally safe programming, it is not enough to choose a free compiler and a free multimedia editor. Imagine such a situation. You are making a program that, analyzing the system time, speaks in a pleasant female voice, how much has been ticking there. It is clear that in order to improve the quality of your voice, you will need to ask your mother, girlfriend, wife, mother-in-law, finally, to speak (in the case of a mother-in-law to hiss 🙂) all these numbers into the microphone. Recording, of course, you will do with Audacity. And now the question is: "In what format will you save these sound files?". in wav? Then you simply increase the distribution of your
programs. In mp3? But it is patented, that is, you also have to pay for its use. There is a way out - save in ogg format, download the header files to use it - and you will be happy.

Do you want to make animation? Thinking of using Gif? Start drying the crackers. It also has a patent. Your choice is Png.

Conclusion. In our difficult time, it is still possible and necessary to work honestly.

Take a look at the site http://www.aplusfreeware.com/ , there is a lot of useful stuff on our subject. There are a lot of free programs that are just as good as their paid counterparts. I have already embarked on the path of honest programmer work, and you?

Learning to program is not something you can do casually. But it doesn't take a lifetime to understand the basics. There are many ways to make learning easier for yourself.

It often happens that beginners start learning, already knowing something about programming. At first, everything goes well, but as you study further, problems begin. Why? Beginners quickly run through the introductory part, thinking that they already know everything, but in reality this is rarely the case. They know some of the material, but it's not enough to understand the basics well.

At the same time, you can't stop growing. You can move slowly or quickly, but don't skip a single topic. By mastering more materials, you create a foundation for yourself for the future.

1. Study Code Examples

When we talk about reading, we usually mean reading words on a page, but programming is about reading code. When you first learn to program, you should study and try to understand each example. You can even first read and try to understand the code examples, and only then read the text. This does not always work, but it teaches you to look at the code carefully and delve into every detail.

2. Don't just read code examples - run them!

When you're reading a tutorial or textbook, it's easy to look at an example and say, “I got it, I got it. Yes, that makes sense." Of course, you could understand it, but you don't know for sure if you really understood it correctly. There is only one way to find out - to do something with the code.

If you haven't already done so, install a development environment (IDE) that supports your programming language.

Then bring the example into the IDE - if you type it instead of just copy-pasting it, you'll really go through it from start to finish. Entering the code will force you to pay attention to the details of the syntax of the language, such as the semicolons that each line should end with.

Now compile and run the code. Make sure it does exactly what it's supposed to.

And finally, change it. The program is the most easily modified mechanism on Earth. You can experiment and see what happens. Changes will occur instantly, with no risk of death or injury. The easiest way to learn a programming language is to take working code and modify it.

3. Start writing your code as early as possible

Once you understand something about the language - even if it makes you dizzy already - start writing programs in it. Sometimes it's hard to come up with ideas for programs. This is normal, at the very beginning you do not need to come up with your own idea.

You can also reproduce exercises from a manual or a book you are reading without looking at the examples. It's not as easy as it seems. This technique also works well if you slightly change the code from the examples.

If you don't want to think about small programs, but want to write something bigger right away, like games, you need to start with small pieces that you can then use to create a game. Regardless of whether you use them or not, you will get the most valuable experience.

4. Learn to use the debugger

The debugger will let you step through the code line by line. You will be able to observe the values ​​of the variables and see if the condition has been met.

The debugger allows you to quickly answer questions about what the code is doing.

At first, fixing errors with the debugger will take a lot of time. But as the number of bugs in your code grows, the debugger will start saving you a lot of time. And the number of errors, believe me, will be measured in tens.

Beginners are often reluctant to use a debugger. In fact, they make life difficult for themselves by spending years correcting very simple mistakes. The sooner you learn the debugger, the sooner you will be rewarded.

5. Look for more sources

If you do not understand something, first of all look at alternative explanations - the Internet is full of information about programming. We all perceive new information differently: maybe you need pictures to understand, and someone else needs detailed instructions or many books with detailed explanations.

But if that doesn't work, then the best way to deal with the problem is to ask someone else. However, if you say “I don’t understand, please explain”, you will most likely get a link back to the same text that you didn’t understand. Instead, retell in your own words how you understood the text. The more the question reveals your thoughts, the easier it will be for a knowledgeable expert to answer it. Programmers sometimes seem irritable when answering questions. But the reason is rather that they want to move forward in the dialogue, and this requires effort from both sides. If you ask a smart, detailed question that shows what you think, you will get good results.

Many consider this craft so incomprehensible that there is no chance to understand the principles even theoretically.
I will try to explain how this happens, as they say, on the fingers.

To write programs, programming languages ​​are used, which are divided into low-level, high-level and super-high-level, and which one is which and how it differs will become clear a little later. But looking ahead, I will add that each language is created for certain tasks and it is not always possible to implement the same task in different languages.
For clarity, I will give examples on household appliances and tasks that we face every day.
So, the task is to cut bread for dinner. For a person, the simplest task - why cut it there, took it and cut it, right?
The most important skill of a programmer, without which nothing will work out, is the ability to divide a task into a sequence of actions. The lower the level of the programming language, the more detailed it is necessary to describe this sequence.

I will give an example of what a program for cutting bread for our body would look like

The task of "cutting bread" in a high-level programming language

1. Open the bread box with your right hand;
__2. Take a loaf of bread with your right hand;
__3. Put the bread on a cutting board; (assuming the board was already on the table)
__4. Open the top drawer of the table with your right hand;
__5. Find a shiny knife, 20 cm long, with a black handle;
__6. Take a knife in your right hand;
__7. Bring the knife to the bread;
__8. Fix the bread with your left hand, holding the left edge of the roll;
__9. Place the knife strictly over the right edge of the loaf of bread;
__10.Repeat the following steps 5 times:
____10.1. Step back to the left by a centimeter;
____10.2. Repeat the following steps until the knife blade touches the board:
________ 10.2.1. Press the knife to the bread;
________ 10.2.2. Make a reciprocating forward and backward movement with the knife;
____10.3. Raise the knife up;
__11. Put the knife in the box;
__12. Release the bread with your left hand.
That's it, the program for cutting bread in the amount of five pieces is ready, you can continue it by describing the erasing of crumbs from the table, placing the sliced ​​\u200b\u200bpieces on a plate, etc.

Program debugging

Run the program and see how it works:
Oh ... along with the fifth piece, he cut off his finger ...
crap! stop the program!
I didn’t write exactly how to fix the bread with my left hand, I grabbed it haphazardly and my thumb stuck out to the side ...
We return to the line "Fix the bread with your left hand, holding the left edge of the roll;"
After it we write:
"Squeeze the thumb of the left hand to the left, to the palm;"
We start the program
Oops... on the line "Put the knife in the drawer;" the knife fell to the floor...
Damn! It turns out that the table is slightly tilted and the drawer closed itself...
We return to the code and before the line "Put the knife in the box;" we write "Open the top drawer of the table with your right hand;"
Noticed an error? Not?!
How can we open the box with the right hand if there is a knife in that hand? So, first you need to put the knife on the table, then open the drawer, take the knife again, etc.
And we do this until the bread is cut properly, without damaging the furniture and fingers.
This is how debugging works
With experience, you begin to write programs that work the first time, allowing a minimum of errors, and checking whether the box is open before putting something into it becomes a habit.

When some operations are performed constantly, such as cutting bread, washing dishes, etc., programmers describe them as procedures.
A procedure is a set of specific actions hidden under a single command.
Thus, the text of the program that I cited above can be placed in a procedure called Cut Bread (parameter), where we will specify the number of pieces as a parameter

as a result, the program using procedures will look like this:
__GotoKitchen();
__CutBread(5);
__PutBreadOnTable();
__To wash the dishes();
and there is no limit to perfection

Now about the low level language

it would have to describe this task in even more detail, down to which fingers and with what effort you need to hold the knife, that “opening the box” is to perform a sequence of actions with the same hand using the hand, fingers, forearm muscles, efforts in kilograms per centimeter, etc. I would even have to describe what the right hand is, where it is located and do not forget to check if it is available at all ...
But once, there were no low-level programming languages ​​and it was written in machine codes, i.e. the program looked like sequences of ones and zeros, these were dark times.

It is worth telling a little about what a high-level language is and why a low-level language is needed, if it is easier to write in a high-level one?
The high-level language was written in a low-level one, and commands were embedded in it, in the form of procedures, implying a sequence of actions, such as "open a box", "take a knife in hand", etc. but if for some reason it is necessary to take the knife with only two fingers, because the handle is broken or missing, for example, then this will not be possible, because the command to "take the knife in hand" implies the use of all five fingers. For such situations, high-level languages ​​have the ability to insert code in a low-level language, and instead of the standard "take a knife in hand" command, low-level code is written under a knife with a broken handle.
A person does all these operations without thinking, but a machine does not know how, it needs to be explained in detail what, how and in what sequence.
Super-high-level languages ​​are narrowly focused on certain tasks, for example, for working in the kitchen, they include a set of special commands and the code in them would look something like a program using the procedures described above.

You must have come across the fact that some programs work only under Windows, for example, and they don’t work under Android or vice versa, although the functions seem to be ordinary, and why can’t Android be installed on a Windows Phone?
I will explain using the example of the same program for the kitchen: the text of the program says "Find a shiny knife, 20 cm long, with a black handle in the top drawer of the table", for example, this is for Windows. However, there is no top drawer in the androyd, the knives are stored there in a wall cabinet, i.e. the procedure for opening the drawer should be replaced by the procedure for opening the cabinet, you must admit - they are different! But the knife there is not 20 cm long, but 25 cm long, it is not at all shiny and its handle is not black, but blue. Therefore, to cut bread, you need to significantly rewrite the program, although the result will be the same. To do this, there are cross-platform programs that can work under different systems, i.e. in different kitchens, because programmers have provided for both options. This, of course, is great, but they also have disadvantages: if you always use only a kitchen with drawers in the tables, then why do you need code that can work with cabinets? And he takes his place. It's like buying a microwave that comes with two doors, one designed to open to the left and the other to the right, and this stove also has a niche in which you can put an unnecessary door, but because of this niche, the microwave is 10 ms higher . You put the right door, and the niche will take up space.

Programming is a creative and interesting process. It is not always necessary to know languages ​​in order to create programs. What tool is needed to create programs? You need a programming environment. With its help, your commands are translated into binary code understandable to the computer. But there are a lot of languages, and even more programming environments. We will consider a list of programs for creating programs.

PascalABC.NET is a simple free development environment for the Pascal language. It is it that is most often used in schools and universities for teaching. This program in Russian will allow you to create projects of any complexity. The code editor will prompt and help you, and the compiler will point out errors. It has a high speed of program execution.

The advantage of using the Pascal language is that it is object-oriented programming. OOP is much more convenient than procedural programming, although it is more voluminous.

Unfortunately, PascalABC.NET is a little demanding on computer resources and may freeze on older machines.

Free Pascal

Free Pascal is a cross-platform compiler, not a programming environment. With it, you can check the program for correct spelling, as well as run it. But you won't be able to compile it to .exe. Free Pascal has a fast execution speed and a clean and simple interface.

Just like in many similar programs, the Free Pascal code editor can help the programmer by completing the writing of commands for him.

Its disadvantage is that the compiler can only determine whether there are errors or not. It does not highlight the line where the error is made, so the user has to look for it himself.

TurboPascal

Almost the first tool for creating programs on a computer is Turbo Pascal. This programming environment was created for the DOS operating system and in order to run it on Windows, you need to install additional software. The Russian language is supported, it has a high speed of execution and compilation.

Turbo Pascal has such an interesting feature as tracing. In trace mode, you can watch the program work step by step and follow the data changes. This will help to detect errors, which are the hardest to find - logical errors.

Although Turbo Pascal is simple and reliable to use, it is still slightly outdated: created in 1996, Turbo Pascal is only relevant for one OS - DOS.

This is a visual programming environment in Pascal. Its convenient, intuitive interface makes it easy to create programs with minimal knowledge of the language. Lazarus is almost completely compatible with the Delphi programming language.

Unlike Algorithm and HiAsm, Lazarus still assumes knowledge of the language, in our case Pascal. Here you not only assemble the program piece by piece with the mouse, but also write the code for each element. This allows you to better understand the processes taking place in the program.

Lazarus allows you to use a graphic module with which you can work with images as well as create games.

Unfortunately, if you have any questions, you will have to look for answers on the Internet, since Lazarus does not have documentation.

HiAsm

HiAsm is a free constructor that is available in Russian. You do not need to know the language to create programs - here you just assemble it piece by piece, like a designer. There are many components available here, but you can expand their range by installing add-ons.

Unlike the Algorithm, this is a graphical programming environment. Everything that you will create will be displayed on the screen in the form of a picture and a diagram, not a code. This is quite convenient, although some people like the text entry more.

HiAsm is quite powerful and has a high program execution speed. This is especially important when creating games, when a graphics module is used, which significantly slows down the work. But for HiAsm this is not a problem.

The algorithm is an environment for creating programs in Russian, one of the few. Its peculiarity is that it uses text-based visual programming. This means that you can create a program without knowing the language. An algorithm is a constructor that has a large set of components. You can find information about each component in the program documentation.

Also, the Algorithm allows you to work with the graphics module, but applications using graphics will take quite a long time to run.

In the free version, you can compile a project from .alg to .exe only on the developer's site and only 3 times a day. This is one of the main disadvantages. You can purchase a licensed version and compile projects right in the program.

IntelliJ IDEA is one of the most popular cross-platform IDEs. This environment has a free version, a slightly limited version, and a paid version. For most programmers, the free version is enough. It has a powerful code editor that will fix errors and complete the code for you. If you make a mistake, the environment informs you about it and offers possible solutions. It's an intelligent development environment that anticipates your actions.

Another handy feature in InteliiJ IDEA is automatic memory management. The so-called "garbage collector" constantly monitors the memory that is allocated for the program, and, in the case when the memory is no longer needed, the collector frees it.

But everything has downsides. A slightly confusing interface is one of the problems that beginner programmers face. And it is also obvious that such a powerful environment has rather high system requirements for correct operation.

Most often, Eclipse is used to work with the Java programming language, but it also supports other languages. It is one of the main competitors of IntelliJ IDEA. The difference between Eclipse and similar programs is that you can install various add-ons to it and you can completely customize it for yourself.

Eclipse also has a high compilation and execution speed. You can run every program created in this environment on any operating system, since Java is a cross-platform language.

The difference between Eclipse and IntelliJ IDEA is the interface. In Eclipse, it is much simpler and clearer, which makes it more convenient for beginners.

But also, like all IDEs for Java, Eclipse still has its own system requirements, so it will not work on every computer. Although not such perishing these requirements and high.

It is impossible to say with certainty which program for creating programs is the best. You must select a language and then try each environment for it. After all, each IDE is different and has its own characteristics. Who knows which one you'll like more.