📜 ⬆️ ⬇️

We are developing open source - we develop and show our software development skills to all.

Many novice developers are faced with the need to show the existing experience in software development. Even if the vacancy is called a “programmer with no work experience,” then without the Captain it is clear that preference will be given to the applicant, who has shown a more or less intelligible code, more or less confirming the presence of useful skills in the work.

What to do? To show the solution of the standard assignment from the early courses or graduation project? Perhaps this is not enough? Maybe write some impressive program and at the same time gain development experience? For example ... a calculator or a compiler, or what is usually written there to gain and show experience? And if you do not have enough strength to finish?

To these questions and doubts there is one almost universal answer - the refinement of open source projects. You get the opportunity to solve real problems of various levels of complexity, the result will not only work for hundreds or thousands of people all over the world, but it can also be shown. This opportunity is sometimes mentioned, but usually it does not stop there. This time - let's stop on it.

')
The idea to open source code for many people comes up against a variety of objections. Here are the most common.

The first objection is why to finish the “alien” instead of making “your own”. It is very common among people without software development experience and often caused by stories of older people who themselves also have no development experience. The plot is usually something like this:

1. "son / daughter, you graduate there is a wonderful university,
2. Become a TYZHPROGRAMMIST
3. write a cool program
four. ??????
5. PROFIT - success, money and in general all yours

Everything is wonderful here, except for one thing - the developers usually do not write code from scratch, most often they modify the existing one. Somewhere you need to figure out a ton of code and add another ton of code. Somewhere you need to debug a ton of code and then rearrange two lines in places (even the lines themselves do not need to be changed). The reason is simple: development from scratch is a very expensive pleasure and there are a lot of mistakes in the new code, so “not every day our brother gets to whiten the fence” entirely, usually - they paint over graffiti.

Therefore, if without experience you begin to develop something more or less complex from scratch, you may encounter the following problems:
1. it will not be possible to finish writing and debugging the code to the end, because it is difficult, and so far it is not enough strength, it may simply not be enough patience
2. if point 1 is passed, then a program with very limited capabilities has turned out, which almost no one will use, because ... SUDDENLY potential users already have the same or similar familiar and ready-made program, but they have not heard about your new one, and change it, you need to be thoroughly engaged in promotion
3. skilled developers who are ready to assess the quality of your code and give you feedback, very little or not at all, and this noticeably slows down your growth and may damage in the future - you will get used to writing code really badly and later bother your employers and bother yourself.

If you neglect these problems, you risk spending a lot of effort on work that will be doomed to oblivion (it is also “work at the table”). If you are aware of the scale of these problems and you are satisfied with everything or you are ready to solve them - do not read further, develop ... what did you want to develop there?

For comparison, when you finish the open source, you:

1. You can not develop from scratch, but modify already working (yes, it's buggy, but you are about to fix it), and the refinement can be either trivial (fixing a simple error), or very complex (some impressive new feature or accelerating the generation of machine code by the compiler by 15 percent), you can start simple and move higher
2. if your edits are accepted, they fall into the long-existing distribution channel of the program that you have finalized, and you get the results of your work automatically promoted
3. your edits appear to be the general ridicule of the relatively large number of developers who may, for example, point out unobvious errors and ask them to complete the revision
4. you get experience with the existing code, its non-damaging refinement and communication with people who need to explain the essence of edits and, perhaps, answer the questions that have arisen, these skills are very important for the developer - assessment of the riskiness of edits, assessment of the importance of correcting one or another errors, explanation to all those interested in the first and second help all participants of the development to make intelligent decisions.

So, modifying the "alien" open source, you get rid of a number of significant obstacles. It’s easier to get started, it’s easier to get feedback, the result of your work may well get into the next release of the program and gradually end up with hundreds of thousands of millions of users, plus it will lie in a repository open for reading and you will be able to show it to everyone. The path becomes much less thorny.

The second objection is that it is necessary to have already developed skills and many knowledge, thousands of them, but there is no knowledge yet, therefore there is not enough strength, there is no way to begin.

Let's look at this piece of code here (a simplified version of the code of one desired multithreaded library)

DWORD waitTime; DWORD secondsInMilliseconds; DWORD millisecondss; /*...............................*/ /*    */ secondsInMilliseconds = (DWORD)interval->seconds * 1000; /*       */ milliseconds = (interval->nanoseconds + 999999) / 1000000; /* *     "   ", *     ,    - . */ if (0 > (waitTime = secondsInMilliseconds + milliseconds)) { return EINVAL; } 


You see, there is even a comment that many compilers issue a warning to this code, but the code is “for some reason needed.” Indeed, VC ++, gcc and clang issue a warning to this code, they say that checking something is meaningless.

Spoiler: the authors wanted to check that addition does not overflow, in the case of iconic integers this trick gives unspecified behavior, but on most platforms it “works”, and here the numbers are unsigned, the behavior of the Standard is defined, but the check does not check anything. Correctly so:

  if (secondsInMilliseconds > UINT_MAX - milliseconds) { return EINVAL; } waitTime = secondsInMilliseconds + milliseconds; 


Above, in the same code, multiplication and addition with a constant are present, but there they did not even try to check the overflow.

What qualifications are needed to understand what this code should have done and at least approximately how to correct it? Five years of experience? Ten? Maybe jvadtsat?

Enough interested second-third year student of a specialized university. For example, there is one university where, in the fourth semester, students use textbook prompts to write and debug a program that stores the entered data in a simply linked list, whose links are created in dynamic memory, with all code, including a simple memory allocator, written in assembler x86 Enough power to understand the memory allocator, but not enough to deal with the code above? Oh really.

Anyway too hard? Then simpler - also based on the real code.

 void* impl_calloc(size_t numberOfObjects, size_t objectSize) { unsigned int totalSize = numberOfObjects * objectSize; void *p; p = malloc( totalSize ); /* WHATEVER */ 


Here it was necessary to use size_t and check that there is no overflow during multiplication. What qualifications are needed to fix this?

Is it too hard? Even simpler - somewhere in the depths of a rather neat code of a very necessary program right in the middle of the function is the following announcement:

  std::stack<const Token*> f; 


Yes, of course, everything is clear. Obviously, f is f . Here, “everything works,” but the developer, who will debug the surrounding code, will be puzzled for a while what this is and why, and why these particular pointers are then added to this particular std :: stack object. It is not at all harmful to understand what a variable is for, to come up with a short meaningful name, consistent with other names in the surrounding code, and to correct it. Perhaps you need to call the fields or functions variable. What qualifications are needed to fix this?

In the open source is full of a variety of defects of very different complexity, many do not even need to look, they are in a prominent place for many years, jump and squeak "comb us, well, please."

The third objection - the edits may not accept. Indeed they can. Project owners may decide that the proposed revision is not suitable for some reason (for example, a new feature is not needed). It helps to first look at the change history to see if there is life on Mars, and then send a small revision so that it is not so offensive. As an option - there may be mandatory conditions in the form of waiver of copyright ( for example, in SQLite ), which are technically difficult to accomplish, this happens rarely, but it is better to know about it in advance. In most cases, all special conditions are negotiated immediately and in a prominent place (for example, there is a contributors section). Not all projects accept edits equally easily, but finding the right project is easy.

The fourth objection - there is a dump, not for this you have studied for so many years. Not such a cesspool, all the more all the same, developers usually modify the existing code, in which there are different defects in larger or smaller quantities. Look at it from the other side - you will be able to understand the complex incomprehensible (sometimes very complicated and very incomprehensible) code and improve it. Adding ten lines of code to a widely used multithreaded library can be much more valuable than a whole calculator per thousand lines.

Fifth objection - one must do something difficult to “join” to the appropriate project. No, no longer needed. Systems like Github allow you to suggest edits with a few mouse clicks. You can find defects in the list of project errors, by viewing the code, with a static analyzer (for example, a completely free Cppcheck, the code of which is also open and lying on Github ) or by compiler warnings. You can choose the project yourself - for example, look briefly inside the library that you used to work with XML in your term paper.

You can come up with any number of objections or start to finish the open source code.

Dmitry Mescheryakov,
product department for developers

Source: https://habr.com/ru/post/267631/


All Articles