10/24/2018

10 small tips for better code readabilty

I can’t stop to write about the importance of code quality and code readability. I think this is one of the most important point at coding. On the other hand I have been already working for several companies and I sadly realised, that the code quality is really poor at most of the companies, even at the famous ones.
In this article I collected 10 small points. It is not so difficult to follow them and if you are following them your code will be much more readable. I added some examples in C++, but all these points can be easily adapted to any other object oriented programming language.
It can be that some of you will be against my points. First of all there are some mostly old-fashioned coding styles which are contradicting with my points. On the other hand some of these points can be a bit against performance. Of course there are special cases when not all of these points should be blindly followed. But I think these 10 small points can make your code quality much better. I hope you will like the points.

1. Use the right variable/function names


The rule in principle is pretty easy, in practise it is not always so easy: you should call everything based on that what it is. So avoid variables like i, j, x, y, value, return_value etc. Name your variables and functions well. I present it with an example:

vector<vector<int>> getThem()
{
  vector<vector<int>> vector1;
  for (vector<?int> x : theList)
  {
    if (x[0] == 4)
    {
      vector1.add(x);
    }
  }
  return vector1;
}
 


Do you understand not what is this function doing now? I’m sure, you have no real idea. Now I changed the names in the function, is it more clear now?



vector<vector<int>> getSelectedCells()
{
  vector<vector<int> selectedCells;
  for (vector int> cell : gameBoard)
  {
    if (cell[CELL_VALUES::STATUS_VALUE] == STATUS::SELECTED)
    {
      selectedCells.push_back(cell);
    }
  }
  return selectedCells;
}



What about now? Now it looks it is collecting the selected cells of a game board. Nothing changed, just the naming. That’s why naming is pretty important.


  1. Use constants instead of magic numbers 

    Try to avoid the usage of magic numbers in your code, it is making it unreadable. Let me have an example:
    
    int t = x * 24 * 3600 * 365;
    

    Where are these numbers coming from, what does it mean? It’s a bit unclean.
    int t = x * hours_per_day * seconds_per_hour * days_per_year;


    Is it easier to understand now?
    And let’s use what we already learnt in the first point:


    int seconds = years * hours_per_day * seconds_per_hour * days_per_year;
    

    Reorganise a bit:
    
    int seconds = years * days_per_year * hours_per_day * seconds_per_hour;
    
    

    Now it’s much more clear what is it, isn’t?


    1. Use enums instead of magic numbers
    In the code of inexperienced programmers I meet quite often with similar solutions:


    
    switch (status)
    {
      case 1:
        //do something
        break;
      case 2:
        //do something
       break;
    …
    }
    
    
    Ok, but what is the meaning of status = 2? Who knows. Use rather an enum for status like:

    Enum class Status { InProgress, NowAnswer, Error, Ok };

    It will make your code much more readable.


    1. Give a name to complicated conditions

      In most code there are a lot of complicated conditions, like:


      If (line > 5 && line < 100 && feature_enabled && !error_found && value == 5)
      


      In such case it is really complicated to figure out what is the condition about. It is a good idea to name the condition and/or the sub conditions. For that you can either use lambda functions or booleans, like:


      bool isLineInRange = line > 5 && line < 100;
      bool featureActived = feature_enabled && !error_found;
      if (isLineInRange && featureActivated && value == 5)
      


      Now it is much easier the figure out the meaning of the condition.



      1. Split up your function to smaller ones

        OK, this point is maybe trivial: if you have a function which is too long and/or is doing multiple things just create smaller functions which are decoupling a part of your function and call them from your function.

        1. Do one only one thing in your functions/methods

          This is connecting from the previous point. So for example if you call a function as SaveToFile I’m expecting from the function that it is saving something to a file and not changing anything on the current data. If you still need to change something on the data move that part of code to a new function. That’s really important, that your function need to do exactly one thing and nothing more: the thing what is in its name. So for example in a getter function don’t do complicated calculations. In that case just create a separate calculate and save function.


          1. Make a clear difference between functions and methods

            It is a personal opinion, but I’m following this point at coding and I think it makes the code readability really better.

            In my understanding a function is a subprogram with a return value. And in my view a function should not change the state of the object. So it should not change any object level private/public variable. Just read them, calculate the return value based on them and return. So for example in C++ they can be marked at const.

            The methods are subprograms without return value. So in C++ technically they are the void functions. The main goal of methods is to change the state of the object. Every change in the status of the object needs to be done by using methods.


            1. Organise your parameters/variables into structs

              There are several cases when a function have several (3+) parameters. Some functions have a really long parameter list over 10-15 parameters. When you are calling such functions it is pretty difficult to figure out which added value belongs to which parameter. That’s why I think it is better to organise your parameters in one or more structs, like:

              Instead of:


              
              drawRectangle(double x, double y, double width, 
                double height, int color_r, int color_b, int color_g)
              
              


              Rather use:


              
              struct Position
              {
                Position(double x, double y) :
                  x(x),
                  y(y)
                {};
              
                double x;
                double y;
              
              
              }
              
              struct Size
              {
                Size(double width, double height) :
                  width(width),
                  height(height)
                {};
              
                double with;
                double height;
              }
              
              struct Color
              {
                Color(int red, int green, int blue) :
                  red(red),
                  green(green),
                  blue(blue)
                  {};
                int red;
                int green;
                int blue;
              }
              
              drawRectangle(Position position, Size size, Color color);
              
              


              So that when you are calling it, instead of:


              drawRectangle(100.5, 54.3, 34.5, 23.3, 222, 144, 68);
              
              


              You can use:


              
              drawRectangle(Position(100.5, 54.3), Size(34.5, 23.3), Color(222, 144, 68));
              
              


              I think in this way it is much more clear what is the meaning of each parameter.



              1. Convert functions to classes if needed

                Especially in old code there are quite often function with multiple input and output parameters. Most cases I would avoid the usage of output parameters. But especially if there are multiple ones it is really better if you are creating a class, having all the parameters as private variables. Create  setter for inputs and getter for outputs.


                1. Cover your code with unit tests

                  Unit tests are really useful to verify your program and to avoid regressions. But it is even really good to have unit tests if you would like to understand a code. Simple you can see for each function and class what is their expected behaviour.


                  These were my points for this articles. I hope you like them, feel free to extend them if you have any other good idea.

                  10/18/2018

                  How to deal with bugs?

                  Introduction

                  Bugs are part of the daily work of programmers. Everyone hates them: the tester, the developer, the manager and the customer. So it is pretty clear, they should be removed as soon as possible. But what is the most effective way to do it. I can still remember, right at the beginnin of my career I needed to find a bug in a quite complex system and fix it and I was totally lost. So in the post I will share with you my way of “bug hunting”.

                  Before bug hunting

                  So the very first step is on the level of understanding: you should understand what should be the normal behavior of the programm and you should understand what is the bug itself and why is the buggy behavior not correct.
                  As next step you should be able to reproduce the bug. Never start to search for the root cause without reproducing it. It can also happen that the bug is not appearing at all on your system. At the reproduction phase make sure always about the following points: you are testing the same version of code as where the bug appeared, you are using the same operating system, all settings are the same, all other conditions are the same.
                  So if you would like to document a bug always write down the steps to reproduce the bug, the expected behavior, the current buggy behavior, the exact software version, all software settings and your system info.
                  Once you reproduced the bug you should find the bug, there are two ways from this point.

                  Finding the bug

                  The first one what I found really effective is based on the version controlling of the code. You should find the last version where the bug was still not present. Once you found it check which changes have happened between the last working version and the first buggy version, quite often you will find root cause at this point immediately.
                  The next method you really need to start with debugging. You need to try to identify first the component which includes the bug. For that you will check the inputs and the outputs of different components. One you found the component try to go one level down: on class level and later on do it on function level.
                  There are some things you need to think about always: if there is multithreading in your code think about the shared memory areas. If there is dynamic memory allocation always take a look if you did everything well with the memory. And if you are using 3rd party components always make sure if they are providing the currect values for you.
                  With a professional debugger software like gdb the duration of debugging can be much shorter. The other thing which can make the debugging faster is if the code is covered by unit tests. You simple need to check which unit tests are failing and it will lead you to the root cause.

                  These are my basic practices and I think with practice it will be just faster and faster to find the bugs, but the bugs can surprise you everytime.

                  10/11/2018

                  Being a specialist vs. being a generalist as a developer

                  Introduction
                  It is not easy for everyone to decide which carrier path would be the best for you as a developer, some of the developers know since their childhood in which field they would like to learn and others have an interest in almost everything. On the other hand it is not always up to you in which direction your carrier is going, sometimes your carrier is just driven by the opportunities which are coming. There are lot of different directions to improve yourself: different fields, programming languages, industries and roles. After some years of professional experience you will see for sure which is your direction: choosing one field, one language, one industry and one role and learning everything about that and being a specialist of the topic or working in multiple fields with multiple programming languages in multiple industries and changing between different roles, having a good overview of everything, but not really being a specialist in any of them. Both of them are quite typical and of course it’s not always binary, sometimes you are just half way between being a specialist and being a generalist, yes, life is complicated. But both situations have its own pros and cons, I tried to collect them.

                  Being a specialist

                  You count as a specialist if you have on really specific field and you are deep into that topic, but about other topics you don’t really have a knowledge.

                  Pros

                  • A lot of big companies are searching for these people
                  • You can reach a very good salary in that specific field
                  • If you are finding a position with that in that field then you have very good chances
                  • You are much better than most of the people in your field
                  • If there are good freelancer tasks in your field, then you can earn a lot of money as a freelancer
                  • You only need to be up to date in one topic

                  Cons

                  • It can be difficult to find a position very really your specialisation is needed
                  • Sometimes the specialisation is really company dependent
                  • If your used technology is getting obsolete, you need to start something new from scratch (like most of the Delphi programmers)
                  • As a freelancer the scope of tasks you can overtake is quite limited
                  • You are in trouble if you are getting a task where you used use an other technology

                  Typical work opportunities

                  • Senior software developer especially at big companies
                  • Freelancer with a specification
                  • Research projects at university or at a company or institute

                  Being a generalist

                  Pros

                  • You have a good wide-range overview on the topics happening in the tech world
                  • You can learn new technologies fast
                  • You are very flexible if you need a new job
                  • You are facing with any tasks you will find a solution
                  • At first round job interviews you can do a good discussion about a lot of topics
                  • You will find always new challenges
                  • As a freelancer you can overtake almost everything

                  Cons

                  • You need to follow the news regarding a lot of different languages and technologies
                  • There is not special field where you are the best
                  • However it is easy to find a new position, it is difficult to show that you are the best candidate
                  • Most of the cases you can not have such a good salary
                  • It is difficult to reach the next step of your carrier if you are changing your fields too often.

                  Typical work opportunities

                  • Start-ups/Small companies
                  • Consultancy companies
                  • Freelancer
                  • Start own business

                  Summary

                  As you can see both of them have advantages and disadvantages. I’m personally rather a generalist, maybe that’s why I could fine more pros there. I still think that to optimum is somewhere in the middle. For example a lot of companies are searching for people with “T-shaped” knowledge. Which means you are a generalist, but you are a bit deeper in one topic.

                  So I think it is always up to the person which sounds better. But I’m pretty sure that most of you have some experience in this topic. Feel free to share it as a comment!

                  10/04/2018

                  6 books you need to read as a software developer

                  There were some book which changed a bit my way of thinking regarding software development. I think everyone should read these books who have anything to do with programming.
                  The list is the following:


                  1. Robert C. Martin: Clean Code
                  I read this book shortly after I started to work as a software developer. At my first company it was a big problem, that all code was messy which caused quite a lot of issues. The book changed the way I’m thinking about programming and helped a lot during your carrier. But of course you need to handle it flexible: don’t follow blindly everything what you read.

                  1. Steve McConnel: Code Complete
                  This book is quite long, but it is covering almost everything what is connected to programming: requirements, debugging, refartoring, configuration management, documentation, integration, development, everthing.


                  1. Michael C. Feathers: Working Effectively with Legacy Code
                  This book was proposed for me by a colleague when we needed to refactor a quite complex old legacy tool. This refactoring was done succesfully, it was strongly decreasing the amount of bugs and it would not happen without this book.


                  1. Robert C. Martin: Agile Software Development
                  This book is much more about processes, but it is partially covering technical topics as well. It gave me a pretty good overview on agile processes. I read it when we started to work based on scrum at my current company and that was my first experience with scrum. It helped me to understand the whole process and gave me a lot of ideas for improvement.

                  1. Robert C. Martin: The Clean Coder
                  It is never enough to talk about code quality. If you liked Clean Code, you need to read this one as well!


                  1. Gayle Laakmann: Cracking the coding interview

                  The best book to read before starting job search and attending interviews. I got it a bit late, I read it before the first technical interview I lead at my place, but it was really helpful. I plan to write more about this topic later.

                  9/27/2018

                  Plan before coding (why software design is needed?)


                  Introduction

                  I’m quite often facing with the situation that developers are starting directly with coding when they are getting a new task. Beginners as well as developers with long years experience, even at well-known, famous companies. And to be honest it is pretty strange for me, I think it is very unprofessional and risky. Let’s see why!

                  Advantages of creating software design

                  I really like the parallelism between building a house and writing a software, because both of them is the result of a complex engineering work. At a house you need to take care about a lot of things: choosing the correct walls, the correct size of rooms the correct roof, correct electricity and water system etc. In case of a complex software you need to pay attention on several things as well: runtime, memory usage, ergonomy, security, scalability, modularity, compatibility etc.
                  It is physically possible to build a house without a planning phase, but only in simple cases and most likely it will have poor quality, it can collapse anytime. But I have never heard about any bigger building which has been built without planning. And in fact: would you like to live in such a house? I don’t think so.
                  Then why would you use such a software? Of course it is possible to implement a software without planning, but only in non-complex cases and for sure it will have a poor quality. Simple you won’t be able to take care about all the points without a design.
                  An other advantage is: during the design phase you can identify a lot of possible problems which can come up in the future. So you can avoid making code which will be never used and you can save a lot of time with that.
                  The other important point is the life cycle of the software: most of the programmes have multiple versions. That means: someone did something. Later on new needs came into the picture, so new implementation was done, quite often by different developers. Then bugs are appearing in the code, someone needs to fix them urgently. In practise that means if there is no design document and all the developers needs to figure out on their own how it is working and what was the concept of the previous developers they will loose a lot of time, they will repeat the same mistakes what the others already did and they will miss-interpret the concept, so they will follow an other way at the new implementations and after some iterations it will be a big chaos. So the number of bugs will be higher and the duration of fixing each of them is getting higher and higher as well.
                  That means: at the beginning you are saving some time by missing the design phase, but later you will loose much more time because of the lack of design.

                  What is the write level of design?

                  Of course it makes no sense to design every small function and small detail for each simple software. You need to find the write level of design to find the most effective way of working and you need to find the right toolset. And it is always up to the project. The following questions are always important: Is it a team-work or a one man show? Is it a software with long term support? Is the software part of a bigger framework or it is stand alone? Is the functionality safety relevant? Would we like to support multiple running environments? Do we have limited resources? Who will use the software? After answering these questions you can write choose the right method of design. If it is a small one-man project, only for internal usage a paper and a pen can be the right tool. But even in this case, do a design! Think about the architecture and main components, main interfaces, main functionality, corner cases etc. and draw some diagrams, write some notes. Of course if you are preparing a safety critical application for serial production then you need to create a really detailed design with static and dynamic software plan, diagrams, well-formulated requirements, use case analysis etc and you need to use some really proper tools. So this is really up to the situation. As you are getting more experience you can always figure out easier the right level of design. But what I think as the most important points: even in case of a minimal design specify your main components and the main interfaces between them. Assign main responsibilities to you components and describe the interfaces with some sentences. You should describe the main use cases with you own worlds in some sentences as well. I think this is the minimum level of design in case of a team work. And as your software getting more complex your design needs to get more detailed and more formular. You can use tools like UML as well.

                  Summary

                  So to not loose time with unnecessary rounds you need to create design, but the right level of design is always up to the situation. In the future I plan to write a post about “How is a good software architecture?” But in the meanwhile you can share with us your habits regarding software designs!

                  Best regards,
                  RelaxedProgrammer

                  9/20/2018

                  9 websites you should know as a software developer

                  After showing you which books I really like I prepared several webpages which are good to know as a programmer. Here they are:

                  1. Tutorials point - https://www.tutorialspoint.com/
                    You can find here tutorials for all programming language, technics, algorithmic topic and basicaly for everything what you can need. Next to programming topics there are several other topics as well (like marketing, communication etc.). This tutorials are usualy really good start points.
                  2. Code project - https://www.codeproject.com/
                    A nice page, collection of articles in technical topics regarding programming. There are a lot of good articles, it’s having frequent updates.
                  1. Stack overflow - https://stackoverflow.com
                    I think everyone know stack overflow. Any programming issue you have the chance is here the highest to find a solution.
                  1. DEV Community - https://dev.to/
                    This is a quite cool developer community with a lot of interesting arcticles and a lot of good comments. You are free to write articles and pop up any topic.
                  2. Exercism - https://exercism.io/ On this page you can develop your coding skills by solving tasks. Your solutions will be reviewed by the mentor team and you are getting a lot of useful advices. If you feel yourself advanced enough you can join the mentor team as well for specific programming languages and you can support the learning period of others.
                  1. Simple Programmer - https://simpleprogrammer.com/ This is a nice blog with a lot of high quality posts. Technical topics, career development and soft skills are envolved as well.
                  1. The dev coach - https://www.thedevcoach.co.uk/
                    An other blog focusing mainly on the necessary soft skill set of programmers.
                  2. LinkedIn - https://www.linkedin.com/
                    This is the other page which is most likely known by everyone. This the best place for networking. The best place to start if you are searching for a new job, but you can get informed from here about conferences and other events as well. You can get good connections if you wanna start your own buisness. If you are filling your profile you will get a lot of relevant message quite soon.
                  3. Meetup - https://www.meetup.com/
                    If it is not enough for you to build your connections online join the meetup.com, find the next events which are happening at your place and has an interesting topic, attend them for free and get familiar with other developers who are living and working in the nearby.

                  These were my suggestions, feel free to extend it in the comments section!

                  All the best,
                  Relaxed programmer

                  9/13/2018

                  5 points to do and 5 points not to do if you are asking for a higher salary

                  It is always difficult to ensure your boss to increase your salary, for some people it means so much stress that they are rather not asking for that at all. I collected some points to do and some points to avoid at asking for a higher salary.
                  To do:
                  1. Find the right time slot

                  You need to find the best time and place for that. Always be between four eyes with your boss, don’t mention such needs at a party or in front of other colleagues. Only start to talk about that if your boss looks happy and relaxed, make sure that your boss has free time and is not in a hurry. The best strategy is to ask your boss for a feedback session or if you have a regular one mention your needs there. At some companies there’s a yearly feedback meeting, at such companies use that meeting for such reasons. Do not start your discussion with this topic, let your boss finish first all other topics, leave it to the end of your meeting.

                  1. Ask for a feedback and use the words of your boss

                  First figure out what is the opinion of your boss about your work. Don’t tell as reason that you are working well if his opinion is totally different, it won’t work. It is a good strategy to ask your boss to a feedback about your work. Most likely there will be positive and negative points as well. If there are only negative ones than sorry, you have a low chance for a higher salary. First always reflect on the negative ones, ensure your boss that you are trying to change them. After that you can tell something like this: “As you mentioned you satisfied with my work, because …, I’m glad to hear it, because I like to work here as well, I have only one problem, I’m not feeling comfortable with my current salary”. Your boss can not really give a negative answer for this sentence. The only thing how he can regret your request is to tell that “the company has a hard financial situation”, but that’s all. One more thing: ask for a feedback session even if you don’t wanna request for higher salary, because on long-term it is bad if your boss knows after your first question that it is all about your salary.
                  1. Mention all the success of your projects

                    The most important counter for a team manager is the success of the projects in his team, that’s what is making all the benefits for the team. So if your project is running well (meeting the due dates, customer is satisfied etc.) then it is a good point to mention. Don’t mention your projects if they are not running well.
                  2. Mention all the extra efforts you did

                  Mention everything what you did in the previous period over your project work, like: you supported new colleagues, you wrote a good training material for the team, you developed a tool which is helping the daily work, you were representing the team at some events. These are always good points to mention. If you wanna reach a higher salary it is a good idea to do something like this before asking for a higher salary.
                  1. Mention all you responsibility you are having

                    Next to the things what you have really done mention the points you are responsible for: you are taking responsibility over a software component, over functional tests, over a subproject, you are organizing a meeting session, you are responsible for a student at the company: mention it, even if you didn’t need to do anything with that. Do not mention it if something went wrong with the topic in the previous months.

                  Not to do:
                  1. Do no compare yourself to others

                    It is never a good reason that “I’m working harder than XY”. Maybe you are mentioning the favorite team member of your boss and no one likes if someone is speaking against their favourites. Or if your boss is not satisfied with the one, then he will simply think: “it is not so difficult to be better than that guy”. Always concentrate only on yourself.
                  2. Do not mention concurrent companies (or use it only as your last weapon)

                    I don’t see it as a good idea to tell that at the neighbour company your could have a higher salary, even if it is true. Your boss will think you are not loyal enough and won’t trust you anymore. Mention this point only as your last weapon before resigning.
                  3. Do not use your personal situation as a reason Do not mention things like, “I have a big family, it costs a lot” or “I need to pay back my bank credit”. First of all it is your private thing. On the other hand it makes the feeling that you are weak. You are paid after your performance and not after your private situation.

                  1. Do not mention your weaknesses It is good if you know what are your weaknesses, but it is not time to mention them. Here you need to show that you are the best employee ever, even if it’s not true.
                  2. Don't be impatient Most likely your boss won’t give you a direct answer, be always patient, don’t ask it again every day, let him have the time to make the decision!


                  Do you have any other idea?




                  All the best:

                  Relaxed Programmer

                  9/05/2018

                  Why are companies not making more effort for keeping good developers?

                  This today article will be a bit different from the earlier ones. In the previous articles I always try to give some suggestions to solve some problems, but now I would like write about something what I never understood why? Of course I have some ideas how can you as a developer handle the situation but I will write about that an article later.

                  During my working years I understood a lot of mysterious things how they are working, even if I really did not understand them at the beginning, but there is something what I couldn’t understand and that is the following: why are companies letting to have such a big fluctuation in their teams?

                  There are many reasons for changing company: no more technical challenges, boring projects, bad working environment, bad connection with the team or with your boss, but there is one reason which is coming up almost always when someone is changing company: the salary. Most of the developers are changing their job to reach a higher salary, but of course in most of the cases it is not the official reason, but it is almost always in the background.

                  Nowadays there’s a high competition on the market of software developers. Most of the developers has already a salary above the average, but most of the developers are still not satisfied with their salary. At most of the companies you can reach around 4-8% increment per year up to country and company. But if you are changing company you can reach much more. When I left my first company I got more than 50% more at second one. I think no one would tell no for this opportunity. In my view that’s one of the biggest reason for developers are changing companies often.

                  On the other hand I can see that loosing a developer is a big loose for the company even from financial point of view. The developer will need a replacement, who has similar skills and knowledge. That means normally months of recruitment and interviews with multiple candidates. After finding the right candidate it takes weeks/months to do a rump up for the projects. At this phase support of other colleagues will be needed for sure and sometimes external trainings are necessary as well. And after several months they have a developer who has still less knowledge/experience with the project, but already can work on that.

                  Let’s make an example:

                  George is Java developer, with 3 years experience of bank security, he is working since two years on the project and has already a good knowledge base. George is asking his boss to increase his salary by 20%. Based on the salary rules of the company his boss can only give him 8% in that year. After this decision Georg is deciding to change to an other company where he will work on a similar project for a higher salary and resigns from his current company.

                  The company needs a replacement of George, so they start to recruit someone with similar skills and for the same salary as George had. They are paying the amount of 2 months salary for the recruitment company and George boss himself is taking part on 3 interviews to find the right person. After 2 months they are finding John who is a Java developer with 2 years of experience, but he is having much less experience with bank security. He is joining the company for 10% more as George’s previous year salary was. Since John has a notice period at his earlier company he can start only 2 months later. During his first working months he needs to take part on a bank security training, it costs a half month salary. Additionally he need to do a ramp up for the project, it costs him time and the senior developers who are working on the project needs to support him. John is doing well, after one month he can overtake tasks from the project, but of course he has still less experience than George had, so he needs frequent support from the others.

                  Let’s see the numbers:

                  To get a replacement for George, who can overtake his tasks took 5 months (2 month of recruiting, 2 month of waiting for his notice period, 1 months ramp up). That’s causing a late delivery of the project.

                  The costs during these 5 months where the following:

                  • 2 months salary for the recruitment company
                  • 0,5 month salary for the bank security training
                  • 1,1 month salary: John’s salary for the ramp up month (he’s salary is 10% more than George’s last year salary)
                  • Ca. 0,5 month salary: The time of the boss to take part on the 3 interviews and to deal with the recruiting company, the time of the senior developers on the project to support John’s ramp up, time of the HR department for administration, time of the IT for installing John’s new computer with the working environment

                  That’s altogether costs: 4,1 month salary and the company is getting no added value from that (no work on the project).

                  The costs for John for his first project year is (12*1,1+4,1)= 17,3 times George’s last year salary.

                  If George would get his requested 20% of salary increment there would have been no need for John, for the next one year it would have cost (12*1,2)=14,4 times George’s last year salary.

                  That means with the decision of not increasing George’s salary by 20% the company paid 2,9 month salary more in that year. Did it really worth to the company? I don’t think so…

                  And now you could tell that it worth on long-term, but after one year John is requesting for a higher salary and the story is starting from the beginning... And I think it was still a lucky situation where the company found a correct replacement quite fast. And it could be even worse: the new colleague is leaving the company after 2 month, because it’s not meeting with his expectations, our simply he can not take over the tasks.

                  I know, some parts of the example is simplified, but I think it is representing the situation well. Why are companies doing it? I don’t understand. Do you have any idea?

                  Next week I’m collecting you some tips how to make sure your boss about increasing your salary!

                  All the best!

                  RelaxedProgrammer

                  How I prepared my first online course

                  Since long I didn't publish anything here. It's because I was busy with some other topics, but now it's time to share the result...