Ignoring Instructions

I was about to leave work when Colin asked me if I knew how to set up a messaging system. I said I couldn’t remember the exact details but I’ll have a quick check because I was sure I had written a guide on how to do it.

Anyway, I emailed him some details. I attached a security certificate to the email but explained it was probably expired, but he could grab a current one from the test servers. I also added a SQL script to modify his database settings to match the certificate.

The next day he never told me he had problems, but I heard him talking to the Lead Developer about his issues around 11:30. The Lead Developer told him that he hadn’t updated his settings. When Colin showed him what he had changed on his database, the Lead Developer told him he had updated the wrong table.

How could he have updated the wrong table? I had sent him the script.

Anyway, 10 minutes later he got it working with the Lead Developer’s help. Another developer comes over and asks Colin what he did to fix it. Colin says “my certificate had expired, and I had updated the wrong table”.

So the two things I told Colin to do, he didn’t bother doing. If he had followed my instructions he could have saved around 2.5 hours.

Innovation Day

Every so often, people raise the idea of tech companies having an Innovation Day. So maybe every Friday, people can put down their usual work, and do a personal project instead; maybe using a language they aren’t familiar with. Sometimes we have explored this idea, but usually just for one or two days.

I’m always skeptical, because I often find fixing a bug, or making a simple feature will take a day or two, often even longer. To expect some kind of prototype in such a limited time always seems an impossible ask to me.

Recently, a group of people have been allowed to have a full Innovation Day each week. I was speaking to one of the guys and he was saying that they plan to stop it since one day a week isn’t enough time. A month quickly goes by and that’s only 4 days work.

When the innovation is supposed to be meaningful and integrated into new projects, these new projects will have come a long way and then it’s awkward to utilise it. Recently there have been projects that have been scrapped or required a major overhaul because of ideas that have either come out of the Innovation Day, or by some idea someone suddenly had. The earlier people know about requirements, the easier it is to integrate into the project. Trying to implement it later is hard, or even impossible; so the project gets scrapped and they all start again.

Another problem with just having a single day is that you could book that day off as annual leave, or maybe you are ill. If it is a team thing, what happens if someone has the day off and you end up being on your own?

Anyway, I was low on work, so thought I’d pay a visit to a particular pair of developers that were working on a feature relevant to my project. Turns out one of them was ill, and one of them had some important meetings in the morning so would be a few hours late.

Anyway, I end up meeting him and we had problems getting the previous week’s changes to build. There were quite a few people missing from the overall group too, and some developers seemed to take an overly long lunch break – like 1.5 hours. Then when they did return, they ended up switching conversation between work and banter, so much so; that I reckon they only were productive half the afternoon.

So how much benefit can a day a week really be? It’s seems unreasonable to expect zero complications and 100% efficiency, so it seems a waste of time.

I was speaking to another colleague about the Innovation Day and he was surprised that it was limited to a select group of people. He said entire teams should be innovating so they buy in to the ideas, rather than someone else saying “I did this in the Innovation Day, so your team should do it too”. It also links back to the comments on time; that you don’t want a team to have got so far into the project, then be told to rewrite it with a different style architecture.

Response to Carlos Orelhas

Over the years, I have asked many colleagues how/if they manage to set time aside in order to learn more programming skills. It something that I have struggled with, but often find myself going through phases of coding a few hours each weekend for a month or so… before going back to my normal routine.

Recently, Google recommended me a blog by Carlos Orelhas https://dev.to/aorelhas/how-i-deal-with-my-9-5-when-i-still-learning-programming-3ifb where he seems to suggest it is very easy to study every day.

I can pick many flaws in his statements, so here goes.

He says his typical day was this

9:00-1:00 work

1:00-2:30 lunch break

2:30-6:30 work

6:30-8:00 exercise

8:00-? shower, eat, watch Netflix

So when he looks at his schedule, he can plan his studying. He decides to get up earlier to study, replace part of his lunch break with study, then cuts his Netflix time to study.

7:00-8:00 learning

8:00 – ? shower, eat, prepare for work

9:00 – 1:00 work

1:00-1:30 lunch break

1:30-2:15 learning (not sure why he stops at 2:15 rather than 2:30)

2:30-6:30 work

6:30-8:00 exercise

8:00-? shower, eat, watch Netflix,

8:00-11:00 learning

11:15 reading before sleep

So he reckons he spends 1 hour reading a book and 4 hours (presumably) programming. 5 hours is a lot of free time, so he thinks it is really easy to learn new things. So let’s compare that to me. My schedule probably looks more like this:

7:30-8:15 shower, eat, prepare for work

8:15-9:00 travel to work

9:00-12 work

12:00-12:30 lunch break

12:30-5:00 work

5:00-6:00 travel home

6:00-7:00 catch up on the latest news, maybe watch a few YouTube videos

7-00-7:30 food time, watch more YouTube whilst eating.

7:30-12:00 free time.

So there’s some differences here.

  1. Carlos doesn’t mention actually travelling to work, presumably he works from home. This is a big difference because travel can be quite tiring and mood changing depending on what happens. Maybe you get stuck in traffic, maybe the bus was late, maybe the bus was filled with loud people.
  2. Carlos has 1.5 hours of lunch which is bizarre. 1 hour can be standard at some places but I find most people have a social group during lunch break. Walking off into a corner and reading isn’t really great for fitting in and getting on with your colleagues.
  3. I have no idea what happened to Carlos’ “shower, eat, watch Netflix” slot. It started at 8, but then he starts studying at 8. I often oven cook, so you can multitask and watch something whilst its cooking. Other meals require more attention to keep stirring. What is Carlos doing? Ordering takeaway 5 days a week?

When it comes down to it, we both have a similar amount of “free time”. So what’s my response?

  1. If I have been staring at code all day, I don’t feel that inclined to stare at more code.
  2. If you are stuck on something in your work, often it is best taking your mind off it. Do you want to keep reading about the problem, or just come at it with a fresh mind the next day?
  3. Carlos acts as if his specified schedule is a proper routine that can be maintained throughout the 5 week days. When does he do his food shopping? Who does the housework? Does he do any outside work activity? I’d say every odd day I end up picking up some extra food on the way back home, and I’ll end up doing a bit of housework. One day a week, I play a sport which ends up taking the afternoon (travel there, the activity itself, travel back, shower).
  4. Does he live with anyone? Some people live with their parents, some have a partner. You might get away with ignoring them for a few days a week, but you will need to dedicate sometime to your relationships. Other people have kids and will have to dedicate a few hours with them until their bedtime. Then the rest of time won’t be free time, it will be time with their partners.
  5. After I have come home, I need to relax and eat food. After that, I might be in the correct frame of mind to start studying. There’s an optimal point though, and after that I’ll probably feel too tired for something complex. So maybe 7:30-9:00 is quite optimal. After that, I’d find it hard to read a non-fiction book, but could be fine with fiction, or play games, watch TV/film etc. Carlos’ 3 hours of 8-11 seems inhuman to me, especially when it is all non-fiction based and requires more brain power.
  6. People may say “why can’t you study in your travel time?”. If I am at the bus stop, it’s not exactly comfortable reading stood up. Also, I can’t look down for more than several seconds without wanting to keep an eye out for the bus. When on the bus, there is 20 mins or so where I could do something, but as I reach the destination, then I will be paranoid I will miss my stop if I’m not looking. I think my comfort of reading on a bus depends on how full the bus is. If people are peeking at what you are doing, then again; it’s uncomfortable.

I ended up writing all this response and then realised I never did a thorough investigation into Carlos. After doing a bit more digging, I see him in the comment section of another blog on the 6th August “I started learning web developer a few weeks ago.” Brilliant. So his routine is only a few months old and he thinks his methods are so good, that he needs to blog about it. I think it links to this tweet by @iamdevloper

I think Carlos has the youthful energy which will soon wane.

If Carlos sticks to this routine for a long period of time and proves he has learnt a lot in that time; then I will take him seriously. His GitHub page currently has 12 repos with very simple examples in which no one is going to be impressed by. One called MyPortfolio has nothing in it.

Open Source

I was making a simple demo website to try a library that a “UI Controls” team had put together. I added a combo box, a text box and a button.

In such a simple app, there were two bugs, and I was distraught. The first bug was that the combo box always showed the first item no matter what you selected. The second was that the text box should clear when you clicked the button to submit the data, but the text remained.

I was beginning to think I wasn’t cut out to be a web developer, but then I had the idea of replacing them with the standard HTML controls in order to eliminate the idea that it could be a problem with the custom UI controls. Turns out that the code I wrote should work, it was just the custom UI controls that were buggy.

Then I wondered why a team had even bothered writing some custom controls. With any code, you always have to ask yourself “am I reinventing the wheel?” Many common programming tools are available Open Source, completely free to use. The advantage of using Open Source is that you can focus your attention elsewhere, and only write bespoke code that gives the company some value. UI controls is a prime candidate to use Open Source since it is generic to most applications, so should have a good user-base who will support the tools. As it goes, there are plenty of Open Source UI kits we could have used.

If you think you can add value, and definitely make a better product, then you may choose to develop something yourself. But you have to bear in mind, any new features or bugs will take developers away from the projects that matter. Here we are, several months later, and the basic controls have fundamental problems with them.

The strange thing is, the team that did this “UI Controls” project was led by a vocal advocate of Open Source software. He was even suggesting we should move one of our projects to Open Source and claimed it would bring massive reputation benefits to the company. It seems strange to then reinvent the wheel, then fail at it.

Innovation

Recently, we were told about a culture change to one of innovation. Our new philosophy is that people need to explore different technologies to work out which ones would benefit the company.

When investing time into this research and coming up with a prototype, obviously many experiments won’t bear fruit. As long as we document our thoughts; why the technology isn’t suitable, what scenarios it could be suitable etc., then it won’t be a waste of time, because we have learnt from it and educated others.

One team did a presentation on cloud computing, and the differences in performance when it comes to running severless functions. They reported that using languages such as Java and C# will be a poor choice due to “cold starts”. Better languages would be Go or Python that have a speed benefit. See Cold Start Comparisons for comparison tables and charts.

When the time came around to do more presentations, a different team talked about severless functions and how they encountered a problem called “Cold Start”. I was face-palming. What’s the point in these presentations if teams aren’t gonna listen to each other? Sharing knowledge and learning from each others mistakes or findings make teams progress quicker. It’s a waste of time repeating what other teams have already done.

Anyway, when the next presentations came about, we were all eager to hear about something different. But up stepped a team to talk about severless functions. The presenter explained that they knew about the “cold start” problem due to the other presentations over the previous months, but they wanted to witness it for themselves rather than just go by what they were told. I couldn’t believe it; why wouldn’t they invest their time in something new, and then come up with a presentation that people can learn from. Just churning out the same content was a waste of everyone’s time.

This week, I overheard a couple of developers talking about their experiences with severless functions.

“I’m finding Go really difficult to code in, so I might just use C# instead”

“What about the cold starts?”

“Well, it will be Microsoft’s priority to fix it, so by the time our code goes live, it probably won’t be a problem”

There are many programming languages around, and they are created for a purpose. As a developer, you need to use the correct tool for the job, and shouldn’t just use a language just because you are familiar with it. If you look at the findings in Cold Start Comparisons, maybe Microsoft could improve efficiency slightly to Java levels, but surely you can’t expect Python performance. It’s a completely different style of language. Also, it’s a bit of a gamble hoping that performance will improve by the time you rely on it.

Colin doing a Derek

It was a nice surprise when former team member Colin sent me a review. There was some existing code that basically used an ID to look up some data from a local cache. It was written in a way that implied that one result should always be returned. The ID number does not come from the user, it will (originally) come from the database if you trace the code back far enough.

Anyway, Colin had changed the code to allow for 0 results. Just like the story I told about Derek in https://strangercodingtings.home.blog/2019/02/07/derek-origins/, Colin is basically hiding an error from the user. So began an argument in the review:

timeinints:“if we have an ID, how is it possible that this doesn’t find a result”

Colin: “I don’t know, this is a question for Paul” <link to Paul’s original change>

timeinints:“this is clearly a data issue. Paul’s code works as intended.”

Colin: “My change prevents the crash. I don’t care about it finding a result, the information it retrieves from there isn’t applicable in my case.”

timeinints: “A crash signifies to the user that there is a problem. Preventing the crash hides the problem, and the user will miss potentially key information. Just because your scenario doesn’t use the extra data doesn’t mean you can change it; all the other scenarios require it.

Colin: “Just to explain this problem: The user has a task which they can Accept or Reject. This problem happens if the user Rejects it.”

timeinints: “If they Reject it, should it clear out the ID because it no longer exists then?

Colin: “On further investigation, there are other scenarios where this can occurs. It’s a bigger problem than I anticipated”.

<facepalm> I think it’s quite disheartening that I can spend less than a minute looking at an issue and can categorise a problem better than Senior Colin. Not much thought had gone into finding out the root cause of the issue. He has gone straight to the “paper over the cracks” approach. That mentality is deserving of a demotion to Junior Developer.

Small Project: Complete

So after we finish our long-lasting project, myself, Derek and the Junior Developer were assigned to a small project. This involved adding a few fairly simple extra features. Derek was assigned to lead this small team.

I thought it would be interesting how Derek takes on the challenge, since in a smaller team, his incompetence would be more obvious. Sadly for the blog, he did pretty well. As a side note, since I wasn’t working with the main inspiration for Colin, and he is moving teams; there’s a lack of Colin ideas for the blog too. For whatever reason, external teams stopped sending me code to review too; so I have been a lot focused on my own work.

Anyway, as we neared completion for the final development work, we were relying on a third party to provide us with an API call. It was a simple true/false value we needed, and if it was true, we would display an icon next to the data items. As a temporary solution until we got the new API call, we chose a property which would roughly give us a 50/50 split of true/false values. That way we could check in our changes and see the icons next to a decent amount of data; a representation of the final product.

Anyway, by the time we got the new API call, Derek had booked a week off. That wasn’t a problem since all I needed to do was switch out everywhere we used the temporary property and use the correct one. Easy task. However, I changed all the places and one feature wasn’t working. Just so happens to be the only place where Derek didn’t use the agreed temporary solution, and chose a property that was always true, so always showed the icon.

In all the other places where we use it, once the data is there, it is never changed. However, this particular control, you can select a data item, then change it for a new one. Therefore the image should show/not show depending on your new selection. Of course, we couldn’t see that this feature didn’t work because all the items were always showing the icon.

Did he use the wrong property to intentionally cover the fact it didn’t work? Of course he did. I thought it would be easy to change, but the control had all kinds of dependencies and it wasn’t designed to refresh the image on a new selection. Took me the whole day to sort out. Massive twat.

Care

After I write some code, I always test and inspect it thoroughly. I’ll write Unit Tests, running manual tests, constantly reading and re-reading the code. Any slight change I make, I then end up repeating the process. Even when I’m about to send it to review, I get paranoid that I’ve missed something, so end up looking at the files again to make sure.

It’s often rare that I get any (serious) feedback to change my code, and it’s rare that Testers will find anything wrong with it. But then sometimes I wonder if I’ve spent a little too long in the development stage.

However, Colin and Derek seem to take the opposite approach and end up coming out with something more quick and dirty.

Derek always seems to come up with a solution close to a hack which I’ll tear apart in the Code Review. After, it will end up being rejected by Testing and he will put in another bodge.

Colin spends time writing Unit Tests but often misses some scenarios. His methods often need refactoring down more, and methods/variables/classes may not have the best names. His solutions still come across as rushed, and he seems to cut more corners when the deadline approaches. When I point out his mistakes, he often says “the deadline is tomorrow night, so I just have to get it checked in”.

But surely it’s useless if it doesn’t work? In a similar fashion to “it’s better late than never”, you could say “it’s better that it is late and works, rather than getting it early and broken”.

He got some comments last week to refactor some of his methods. He quickly changes them and submits his new method for review. It was a one-line method, and somehow there were 3 mistakes in it. The thing is, he had Unit Tests covering every possible scenario of that method; he just didn’t run them. Unit Tests take a several seconds for a large batch of them to run; why would you cut corners so much that you don’t even run the unit tests? If you had full coverage, it will allow you to cut manual testing, but to cut testing completely? Madness.

Anyway, his code was something like this:

public string DisplayInfo(bool isScotland)
{
return DisplayInfo(Configuration.Scotland==Configuration.Scotland);
}

The 3 things that are wrong:

  1. he is passing in a parameter “isScotland” then not using it
  2. where he should be using “isScotland”, he is calculating it…but wrongly. He is comparing a value to itself; so it always evaluates to “True”
  3. The method just calls itself, which calls itself, which calls itself…until it crashes with a StackOverflowException because it’s an infinite loop.

Absolute Junior-level coding.

Reading code

“When I get a Code Review request, I always open it. If it is a one line change, I click ‘Looks Good’, otherwise I’ll close it and let someone else deal with it”

Derek

Derek said this in jest, but the thing is, it is actually true. Derek avoids doing Code Reviews because he just wants to write code, or simply chill out. Or that was my interpretation anyway.

Developers should always partake in Code Reviews. It helps enforce Coding Standards, and helps your team learn from each other. It’s also mandatory for our code to be approved before we can commit it, so it’s good if is done promptly.

It winds me up that Derek never does them (well, it’s a rare event). It was part of his job as a Developer, but he is a Senior; so it is definitely part of his job.

Anyway, shortly after moving over to Git source control, Derek calls me over and asks me how he can grab the code from the Pull Request (Git’s nomenclature for Code Review) so he can test it out himself. I was quite shocked he actually was looking at one. Anyway, he comes out with this quote for the reason he wanted to test the code out:

“Some people are better at reading code and understanding it than others”

Derek

He was stating a reason he doesn’t do Code Reviews is that he finds it difficult to read code, and can only really understand it if he can step through it using the debugger.

The thing is, reading code is a major part of what a developer does. I think it’s a huge struggle if you can’t work things out and picture how it pieces together simply by reading. Sure, debugging does help, and is required with more complex and abstract areas… but; a Code Review is usually a small change. The changes are clearly highlighted with the editor with a Before and After view, with the colour Green showing additions and Red showing deletions. It will be linked to a Bug report so you know the Developer’s intention. They will (or should) have written a good Commit Message which will show in the History when they check it in. What extra help does he really want/need?

Mini Musing #2

When talking about the Source Control “Git”, there’s so much jargon to throw around. Pull, Push, Fetch, Sync, Clone, Stage, Rebase, Squash, Branch, Merge, Commit, Tag…

I was talking to the Junior Developer about Git, and he comes out with this gem:

“When I think about Git, it reminds me of the game Bop It!”

“Fetch It”, “Pull It”, “Push It”