Website Bundle Size

I was looking through our application and removing redundant code. I was checking the size of our application and wondered if I could reduce the size. A smaller download size will give the user a better user experience.

How long will you wait for a website to load before you give up and go somewhere else? Ten seconds? Twenty seconds? Apparently, nearly half of us won’t wait even three seconds.

https://www.bbc.co.uk/news/business-37100091

In my research, I found this blog https://www.freecodecamp.org/news/3-easy-ways-to-boost-your-web-application-performance/ which mentions a few areas to look at; reducing image sizes, code-splitting/lazy loading, and reducing the bundle size.

For the third point, it gives an example of a Javascript date library called “moment” which is something my team was using. When I looked at our bundle stats, Moment was contributing to 30% of the size of our app! We only used it as part of a Date picker control which we use once. The blog recommended a website called Bundlephobia e.g. https://bundlephobia.com/result?p=moment@2.24.0 which shows you the size, and recommends some alternative libraries. Moment is 231.7kB and 65.9kb (compressed) whereas “daysjs” is only 6.5kB and 2.76 compressed. If you look at their time stats, the site reckons it will take around 1 second longer to use Moment rather than DayJS.

According to research from digital performance measurement firm Dynatrace, just a half second difference in page load times can make a 10% difference in sales for an online retailer.

https://www.bbc.co.uk/news/business-37100091

Git Hub user martinheidegger logged this very issue back in Aug 2016 https://github.com/moment/moment/issues/3376

It looks like development/maintenance has slowed down this year, but I’m surprised that the Moment library hasn’t been abandoned completely. Loads of people have highlighted the size is a problem, yet no one has actually sorted the issue out after all these years.

When the research highlights how important fast speeds are to users, then you would think developers would put more important on performance.

Full Regression

Several months ago, a project was completed (let’s call it Project X) that must have contained the biggest impact to our software. What I mean is that the scope impacted a lot of features, and therefore to sign it off, the testers ran an insane amount of regression tests. The Project X team ended up running these tests with the help of other teams, and many hours of overtime was needed.

A release was being planned that involved more bug fixes than usual. I think one of the Test Managers had suggested that we run a full regression test to ensure the changes made by Project X hadn’t been effected. Marcus, a tester involved in Project X stated that this was an “unreasonable request, and we need to do a more focussed, targeted test”.

The next day, a Test Manager came up to Marcus and said she had asked someone to give estimates of a full regression and she had been quoted 6 weeks. She said it was absurd and wanted Marcus to confirm it. Marcus stated once more that he had already highlighted it was an unreasonable ask. He explained that she is requesting that 4 people run the tests over a two week period, when the original team had three weeks and around 20 people were involved. This is why Marcus rejected the proposal in the first place.

Another day passes, and another Test Manager announces that, after much debate – running a full regression isn’t feasible, so they will do a targeted regression.

No doubt there were one or more meetings to discuss this, when Marcus had already told them how unfeasible it was a couple of days earlier. It’s just that people with the authority to make the decisions, and the people that actually have the knowledge of how things work – are completely different people.

Gun ’em down

A tester had created loads of alerts and hadn’t disabled them. Jack sent a mass mail to rant about it, stating that any tests that can annoy others should always be cleaned up. He was doing some important testing and having alerts spam his screen was slowing him down and stressing him out.

Later, I sat next to Jack in a meeting and decided to wind him up about it.

timeinints: “Hey Jack, what are you gonna do about this testing situation? This happens a lot and we need to stop it.”

Jack: “What I’m gonna do, is march down to their office and gun them all down.”

The meeting host then points out that members the other office were on the conference call.

Well, that’s awkward. 😀

Jack

Some teams make a presentation to show what they have done over the previous Sprint (usually 2 week period). One team hadn’t achieved what they had planned, so included a table to illustrate that they were low on staff, mainly due to annual leave. So it looked something like this:

25th NovemberJack off
26th NovemberBen and Jack off
27th NovemberSally off
28th NovemberBen at a conference

Jack off!

The team was jacking off for a few days so they weren’t very productive.

Untested illogical code

A Junior Developer sent a Code Review for some C# code. There was a bug that if a user didn’t have permission for a particular record, the code would try and look for the record and couldn’t find it, then it would then crash.

Not only was the “fix” a classic case of merely hiding the bug, rather than addressing the fact of why the code was trying to find the record in the first place – but the fix produced couldn’t possibly work. The Junior Developer had written some code like this:

public boolean HasPermissionToAccess(int recordId)
{
 try
 {
    records.singleOrDefault(record => record.id == recordId);
    return true;
 }
 catch(InvalidOperationException)
 {
    return false;
 }
}

Another developer had beat me to the review, but he nicely asked questions to hint that this can’t possibly do anything beneficial; along the lines of “can you tell me where the exception is thrown?” and “can you tell explain why these return values work?”. I would have just said “you cannot possibly have tested this”.

The thing is, the Junior then gave an answer like “the singleOrDefault line will return null if the user doesn’t have permission”.

Yes that is correct Junior, but you ain’t doing anything with the return value. You are returning “true” regardless of what happens. i.e the user “HasPermissionToAccess”. Surely it should return “false”? Also how can the catch block ever execute? singleOrDefault will never throw that exception. Since his new method always returns true, then the calling code will still crash in the exact same place it did before.

I don’t understand how you can write code with the aim of fixing a crash, but it doesn’t even fix the crash. On a positive note, I guess it didn’t introduce any other issue, other than being completely redundant.

EA Sports

Around 2002-2009, I was very loyal to the FIFA computer game franchise and purchased it every year. There were always detractors; people stating each version had a few tweaks and updated player rosters – so was always a cheap, annual cash grab.

After 2009, I bought the game occasionally, before taking a 6 year break, returning to the franchise for FIFA 2019. I really enjoyed the game and seeing all the improvements in 6 years was really impressive. When I read other reviews and comments, people were saying that the Career mode was exactly the same as 2018 versions with virtually zero changes.

So people’s complaints of EA reselling the same game each year seemed like a valid viewpoint. When FIFA 20 was announced, EA not only announced Volta, a 5-a-side football mode which has been missing since FIFA 98, but they also promised an overhaul of Career mode.

Feature 1:

They promised to fix the problems with fixtures. Sometimes you would get fixtures multiple days in a row. This has been a problem for years, and you would think EA would have fixture scheduling perfected. Surely a similar algorithm is required for Madden, NFL and NBA Live? (although I guess the NBA Live franchise died off on the consoles).

What actually happened…

Fixture scheduling still broken; they are still been organised on consecutive days. Additionally, after a few years, the European Cup and Champions League stop working.

EA put out a statement saying “…implemented logic improvements to this system early in the development cycle, where the results we were seeing were positive. Unfortunately, a change that we made late in the development cycle, which was the insertion of the authentic fixture schedule for the first season of a Career Mode, resulted in an issue where the rescheduling of games is creating new match congestion issues.”

Feature 2:

“new Morale system” and “player conversations”. They announced a new morale system where player’s morale will affect their stats. You can talk to players to discuss their concerns.

What actually happened…

Players request a rest…then moan when you don’t play them.

Feature 3:

“Speak to the media”. Press conferences

What actually happened…

The general consensus is that they got boring real fast. Also, sometimes the questions won’t be relevant to your matches. EA’s response: “due to the large amount of text and options that are present, despite our best efforts during testing to identify and resolve as many of these issues as possible, there are some issues that have been found by our players that we were unable to find during the development cycle”

Feature 4:

“Improvements to team line-ups”

I didn’t have a problem with the line-ups for opposition teams in FIFA 19. When changing your own tactics, often players would switch positions, e.g. your winger playing in centre midfield.

What actually happened…

Opposition teams mainly play reserve squads. This resulted in big teams like Manchester City being relegated rather than winning the leagues. Final league positions were essentially the opposite of real life.

Feature 5:

“getting sacked for offering contracts”

What actually happened…

I read there was some kind of contract negotiation feature on FIFA 19 that could be exploited to gain extra cash. It seems EA have prevented it on FIFA 20 by sacking the manager if they offer a big contract. People were complaining they signed a new star player and were instantly sacked. Other people took small clubs up the leagues, only to find they couldn’t offer even small pay-rises without getting sacked. It makes zero sense.

All these problems got the hashtag #FixCareerMode trending on Twitter. You would think that EA will work harder to improve their reputation. They have had a lot of bad reputation in recent years with the disappointing Anthem, the loot box controversy of Star Wars Battlefront. Going further back, they kept on being voted “Worst Company In America”.

To those detractors that say “all this game is – is FIFA 19 with updated rosters”, well you are wrong. The game was released with old squads! You would think it would have updated squads since the game releases after the transfer window has shut, so squads are finalised. But no, EA can’t even have that correct on launch.

It was interesting to watch a few videos on YouTube from the “Game Changers” – YouTubers that get the game early, and can deliver constant feedback to EA. The Game Changers said they got the beta for FIFA 20 only a month before release, and even though they reported all these problems, they knew that EA would not have enough time to fix them before launch.

To be fair, it’s been less than a month, and EA have actually put out a patch that apparently fixes the majority of these issues. However, a company shouldn’t need a huge backlash before sorting things out.

We just need #FixVolta to start trending. In the story mode for the Volta mode, one of the main characters, Syd plays for your team. She also plays for every other team you are up against. She must have 30 identical twins. How do bugs like this even get released?

Nerd Elitists #2: Dark Theme

In a similar fashion to the Anti-Microsoft mentality, there is a group of Dark Theme extremists too (although I think many people are the same as those with the Anti-Microsoft agenda). Every so often, someone will post some kind of meme criticising those that use Light Themes, and they have also created some alternative Dark Theme emojis, some of which they have intentionally made so they appear invisible to Light theme users (white text on a transparent background).

https://preview.redd.it/ie0vsl7ar3311.jpg?width=960&crop=smart&auto=webp&s=0fbe8a072ea85c185bc01422faf2acd228f0b9c6
How it feels to be a Light Theme user

Any news of companies now supporting Dark Theme is celebrated like some kind of big event. It’s almost like they are a minority group that have successfully fought for their rights.

How did these people even survive before Dark Themes even existed? I think the advice when this became available was to use Dark Themes at night, and Light during the day. I find that my eyes feel strained if I have been looking at something light then dark, or vice-versa. I think it only works if everything is Light, or everything is Dark.

Light Theme Dark Theme Swaping Betweern Dark and Light ...
Dark Theme users are apparently smarter than Light Theme users. True enlightenment is actually swapping between them.

When doing some quick research, I have often read statements like this:

“In terms of readability, the verdict is clear: black text on a white background is the best”.

https://www.maketecheasier.com/are-dark-themes-better-for-eyes-battery/

Yet, these Dark Theme fanboys will keep moaning against the research. I do wonder if it comes down to the individual though. There are some sites like Megan Laura John’s blog (e.g. https://meganlaurajohns.blogspot.com/2016/12/entrepreneurship-success-and-impostor.html) where I think “ooh this white on brown looks nice”, then after 3 paragraphs, my eyes start to struggle to focus, and it gets to the point where I can no longer look at it comfortably. I ended up reading that blog post in an RSS reader just so I could read it with black text on a white background. People must be able to comfortably read it though, or so I assume.

If it does come down to the individual’s eyes, then mocking people for it isn’t acceptable. It’s like mocking someone for being short-sighted. There’s no place for it in the workplace. I don’t understand why people can’t just quietly use a Dark Theme. Instead, they have to go out of their way to attack those that don’t share similar views to them. Like posting a tweet saying that people aren’t real developers.

Nerd Elitists #1: Anti-Microsoft

Recently a group of people have started responding to questions about why things aren’t working with the answer “because you are using Microsoft” (or similar). A conversation may play out like this:

timeinints: I’m getting a crash when installing Software X

Elitist: Are you using Windows?

timeinints: (excited because they know how to solve it) Yes I am

Elitist: Well, there is your problem!

It reminds me of my university days when people said similar things. Also, people were just obsessed with Linux, but even though the Graphical User Interface was perfectly fine, they would always use the command line. Those Linux extremists would then respond with statements along the lines of “it would work if you did it on the command line”.

Recently, we have been having troubles with conference calls on Slack, but when we try using Microsoft Teams, the audio is perfect. After announcing that we will switch future meetings to Teams, we had several Slack fanboys react to our announcement with an “anti-Teams” emoji on our Slack channel. These people don’t usually contribute to our channel, they were just lurking, but they jump at the chance to show their anti-Microsoft agenda.

I don’t think that elitism creates a good working environment, especially when people are struggling with some problem, then they get an arsey, dismissive response instead.

Manager Step Down

Our team was initially managed by Jane. A few weeks into the project, Jane explained to a colleague that she was leaving the team. Only when she noticed I was eavesdropping did she then tell us that I probably need to listen too. She told us which team she was moving to but she didn’t even give a date when this would happen. I thought it was bizarre that she announces it so casually rather than having a formal meeting.

The next day, when we were on a conference call with some remote workers, they were waiting for her to join and didn’t want to start the meeting without her. Jane did join on request, but she still didn’t tell them she wasn’t in charge, or even had left the team.

Afterwards, a team member in our office was outraged about it, because he wasn’t aware. She claimed it wasn’t her responsibility to tell people; the responsibility should fall with the new manager, Adam.

I’m thinking it totally is her responsibility. Adam shouldn’t just state he is in charge now – it should be announced by Jane, who then explains we need to listen to the new guy. It wouldn’t be her responsibility to hand over if she had been fired; only then you would expect the new guy to announce he is in charge, or someone further up the hierarchy to announce and introduce the new manager.

The funny thing is, months later, Adam suddenly leaves the business. His replacement started joining the stand-ups but didn’t speak for a few days, didn’t even introduce himself. When he finally introduced himself on the fourth day, he then had the awkward task of telling us Adam’s last day is today and will leave after he completes his handover.

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.