Thursday, 20 January 2022

The Different Categories of Data Analytics

Data Analytics comes in different flavors. All of them are, at the core, crunching numbers and statistics to form a coherent narrative. The difference lies in what the narratives are used for.

Today, we will be examining the different kinds of Data Analytics that are used in the industry. For the purposes of relevance, we will be using the COVID-19 pandemic for examples.

Descriptive

This is by far the most common type of Data Analytics, and there is good reason for that - it is basic and provides insights to a current situation. Figures are displayed in a way that shows how the situation currently is. It describes a situation, hence the word descriptive. The question most commonly answered in these scenarios is what, which and possibly where or when.

Examining the
current situation.

One example of descriptive Data Analytics would be a day-to-day tally of new COVID-19 infections, with perhaps a monthly average and comparisons with figures from preceding years.

Diagnostic

The next step after descriptive Data Analytics is diagnostic Data Analytics. This is an analysis of the data, with possible patterns and correlations identified within. It is meant mainly to answer the question of why - why the situation is as presented and the possible causes.

Possible causes such as age
and pre-existing conditions.

One example, building on the example given above, are further breakdowns of COVID-19 data into age groups, genders and pre-existing medical issues. From this data, analysts can then determine if the numbers of infections or deaths correspond to these conditions.

Predictive

Progressing naturally from diagnostic Data Analytics, which explores how the current data came to be, is predictive Data Analytics, which projects, from the current trends and conditions, what the data will probably look like from this point forward. This is the Data Analytics version of fortune-telling.

Telling the future.

This could take the form of dashboards where variables can be adjusted to see what effect this has on the visualization. For example, if the number of infected elderly people was brought down, what effect would it have, over time, on the total number of COVID-19 infections?

Prescriptive

The final piece of the Data Analytics puzzle is prescriptive Data Analytics. After predictive Data Analytics, this comes in the form of recommendations as to how to affect the projected trend. As one might imagine, this is probably the most valuable component. The descriptive component explores the what, the diagnostic component generally explores the why, and the predictive component explores the what-if. The prescriptive component, however, adds value in the form of analyzing the gathered data to determine what steps could be taken to achieve desired outcomes.

Recommendations and
action plans.

In the case of our example, the desired outcome is lower, controllable and (hopefully) zero COVID-19 cases. Sample advice might be, vaccination programmes for elderly and high-risk groups, limitations on group sizes in public, and so on.

In a nutshell

What I have outlined is the different kinds of Data Analytics and how they stack up. The examples given above only pertain to the COVID-19 situation. But imagine these analytics being applied to profits, research and the stock market!

Analyze this!
T___T

Saturday, 15 January 2022

Some thoughts about movie reviews and movie critics

Someone asked me recently about a movie, and whether the reviews of it were any good. And my response was one of puzzlement. I have never in my life relied on the judgement of a movie critic to determine if I should watch a movie or not. If I want to watch a movie, I will; and if I don't, I won't. No amount of rave reviews or critical bombing has ever convinced me otherwise.

And for good reason. Well, reasons, actually. Some of which will be discussed today.

I also write movie reviews on this blog, though mine tend to be about movies that deal with tech. For the most part, my reviews come from a more layperson perspective. Occasionally, it comes from a tech worker perspective.

Objectives

Professional movie critics tend to judge movies by different standards than people like you or I might. They might think in terms of filmography, social messaging, diversity, storytelling and all that arty-farty stuff.

The filmography.

Me? I watch movies to be entertained. Education is the furthest thing on my mind. My objective is to have fun. If I'm not having fun, then it does not matter how many awards this movie has won or how many critics love this movie - the movie has failed where I am concerned. Remember, the critics are not the ones paying for your movie ticket. You are. Therefore, you should decide what your standards are... and most of the time, our standards are very different.

I don't feel particularly bad about having different expectations from a professional movie critic. It simply means that I am not a professional movie critic. That's hardly anything to be ashamed about.

Audience pressure

Sometimes it's a blessing to be a complete nobody in real life. I do not have a reputation to maintain, nor does my living depend upon my audience. No pressure at all.

On the other hand, professional movie critics are beholden to their employers and their audience. This means that they cannot praise or criticize however they please. Not if they want to keep their jobs.

Shush!

One such critic might hesitate to criticize a black actor for his performance in a movie, or suggest that it was the wrong casting choice, if the critic's audience comprises of racial activists or something. Cancel Culture being what it is, these professional movie critics could hardly be faulted for acting in the interest of self-preservation.

My reviews are independent. My living does not depend upon the approval of my audience. This is a fun pasttime for me, nothing more.

Biases and agendas

Recently, I watched Ghostbusters: Afterlife and proceeded to read some reviews. It was surprising to me how many reviewers slated this movie despite the fact that audience ratings were so high. And some of these reviews seemed to get awfully personal and there seemed to be an unhealthy amount of resentment that this movie dared to exist at all after the Ghostbusters, featuring an all-female team, was released in 2016.

I watch a movie because I want to watch a movie. Not because I want to promote a feminist agenda. Or indeed, any kind of agenda. In fact, I hate it when movies get preachy and heavy with the moral posturing. I'm in a motherfucking movie theater, people. Not church.

Promoting a feminist agenda.

Sure, everyone has biases, myself included. But I was under the impression that part of being a professional movie critic was at least being subtle about your biases.

Are my movie reviews better?

Using the judgement of a movie critic who has no idea what you like or don't like as a gauge as to whether you would enjoy a movie or not, is pure foolishness. I enjoy reading reviews to see what different people think. But my views remain my own.

The language used by professional reviewers is infinitely more colorful, and there are times when I aspire to that standard.

My reviews are definitely more relatable, even if the reader does not work in the software industry. That is because I think largely like the average layperson, I am beholden to no larger agenda; and most importantly, unlike some of these reviewers, I don't act like people should like or dislike a movie based on my opinion.

Pleasant viewing,
T___T

Tuesday, 11 January 2022

Functional Terminology

Some terms in programming tend to confuse new programmers. There's a certain historical context to them, and with the rise of more recent technology, new terms muddy the waters a bit.

And among these terms are: function, subroutine and method. They all seem to be referring to the same thing - procedures - but there are some significant differences.

Today I will be attempting to provide some clarity.

Subprocedures

These are procedures that exist in a block of code, and can be called from anywhere. Arguments could be passed into them, optionally. In QBasic back in the day, there was a specific keyword for that.

SUB HELLOWORLD()
    PRINT "HELLO WORLD"
END SUB


CALL HELLOWORLD()


Basically, the subprocedure would perform whatever operations the programmer put in it, and that would be the end of it. This has all but vanished from the programming landscape. These days, it's all about functions, which we will examine below.

Functions

Functions are also procedures that exist in a block of code, and can be called from anywhere. Arguments could be passed into them, optionally. The difference is that after performing the operations, they return a value.

This is how it was done in QBasic or Visual Basic.

FUNCTION HELLOWOWLD(str)
    HELLOWORLD = str
END FUNCTION


PRINT HELLOWORLD("Hello world")


Or in JavaScript...
function helloWorld(str)
{
    return str;
}


console.log(helloWorld("Hello world"));


...and in certain cases may not even return anything.
function helloWorld(str)
{
    console.log(str);
}


helloWorld("Hello world");


So in these cases, a function works just like a subroutine, and thus subroutines are not really needed any more.

Methods

Now we come to methods. Methods are just like functions in every way... except for access control.

We call a function a method when it's part of an object. This is an example in JavaScript.
let obj =
{
    helloWorld: function (str)
    {
        console.log(str);
    }
}


So if we were to call this method, we can only call it when specifying the parent object.
obj.helloWorld("Hello world");


If we were to treat it like any other function, it would not work.
helloWorld("Hello world");


In some object-oriented programming languages such as Java or C++, if you specify that the class is Private (for instance), the method can only be called within the class itself. There's actually a fair bit to cover on this subject, but it's out of scope for this blogpost.

Finally()

As long as you have a clear idea of what you are referring to when you use these terms, end of the day it doesn't really matter what terms you use. Communication is key. Just don't be confused when the context changes, and the terms change with it. Ultimately, it's generally the same thing.

Play that func-y music!
T___T

Friday, 7 January 2022

Five Software Development Takeaways From the COP Saga in 2021

In sunny Singapore, the Committee of Privileges (COP) saga took place last December, just a month ago. It all began when Raeesah Khan, an MP from the Worker's Party, was caught speaking a falsehood in Parliament which directly implicated the Singapore Police Force.

Time passed, and she repeated the lie in Parliament, and subsequently confessed when pressed on it. The fallout from this was that she had to resign from the Worker's Party, and the Committee of Privileges was formed to investigate the possible culpability of Worker's Party leadership in this debacle.

There has been a lot of coverage on YouTube concerning this investigation, with the hearings (the combined durations more than thirty hours in all) of different witnesses publicized. As a Singaporean, I have taken an interest and listened to almost all of the footage. As a software developer, these were the lessons I gleaned.

1. Diversity Hires

When Raeesah Khan first won her seat in 2020, there was this article from The Independent Singapore that made this big song and dance over the fact that she was the first female minority Opposition, and the youngest MP in Parliament. This turned out to age badly, considering what trouble Khan has gotten herself into since.

An MP deceitful enough to lie once in Parliament, and foolish enough to double down on that lie a month later? What really gets me was that there was so little to gain from this. Politicians lie and cheat in order to embezzle huge amounts of money. What were Khan's motivations? She wanted to make the police look bad. Furthermore, the incident she had described in Parliament had not been personally experienced, but something she had read off a WhatsApp chat group conversation. Passing off WhatsApp anecdotes as fact is the province of clueless Boomers, not an MP.

Make the police
look bad.

During her hearing, it was revealed that Khan was against resigning from the Worker's Party because she was worried about how this would impact the image of female minorities in politics. With all due respect, that ship appears to have left the harbor the moment she got caught in the lie. If it's any comfort, unlike those idiots at The Independent Singapore, I never saw Raeesah Khan as a female minority, much less considered her any representative of such. All I ever thought of her, even when she won her seat, was as this dangerous loose cannon with an axe to grind against the police.

This is a valuable lesson for hiring in tech. Stop focusing on age, gender and race - largely immutable traits - of your candidates and instead focus on what they have accomplished, what they are currently doing, and what they can further accomplish. Hiring people for the sake of fulfilling some nonsensical diversity quota can come back to bite you in the ass when they inevitably screw up because you cared more about the color of their skin or their genital plumbing than their actual ability.

2. Explicit Instructions

According to Pritam Singh's testimony, his instructions to Raeesah Khan were to "take ownership and responsibility" and that she would not be judged. Somehow, according to her, these were license to double down on that lie later in Parliament. I'm not sure how "take ownership and responsibility" translates to a choice for anyone to continue lying in Parliament. Maybe to a complete child. But this is not a child we are talking about. This is a democratically elected Member of Parliament.

Clear and unambiguous
instructions.

Could Pritam Singh have been more explicit about ensuring that Khan clarified her falsehood? Sure. Should he have to? Absolutely not. Remember, this is not a child we are talking about.

But this is the thing about operating in a professional environment. Sometimes, you feel that certain things go without saying. And this can go badly.

As a software developer, I find myself having to check the input that users give me via the system. Of course, I feel that anyone with even an ounce of common sense would be responsible about faulty data and do their due diligence before sending me a potential mess that I have to clean up later. Unfortunately, people tend to do what they think they can get away with, especially if their hands are full. Therefore, now my correspondence with users contain explicit (sometimes sternly so) instructions to ensure cleanliness of data before handing it off to me. Should I have to remind people to do their goddamn jobs? Fuck, no. But this is the reality I have to deal with.

3. The Price of Authority

Regardless of whether or not you believe that Pritam Singh was complicit in the lies that Raeesah Khan continued to tell in Parliament, there is one glaring, inescapable fact: he is the leader of the Worker's Party. The buck stops with him. As such, Khan's membership in the party is at least partially his fault. As for her candidacy in 2019, that is definitely his fault. The fact that such a flawed character ended up as a Member of Parliament, is down to his failure in terms of character judgement.

Real leaders
don't play
the blame game.

That is the price of authority. When something happens, you ultimately have to shoulder some of the blame, if not all of it.

In tech, I have encountered CTOs and team leads who love pointing fingers, not understanding how completely stupid this makes themselves look. They are in charge; everything is their fault. Even if they did not personally write faulty bug-ridden code, they are responsible for approving it. If bugs persist in the product, they have to shoulder the blame for not addressing the issue sooner.

They are in charge. The buck stops with them. Failure to accept responsibility is poor leadership. Very poor.

4. Due Process

The long and drawn out process of the COP has had mixed reactions. From supporters of the Worker's Party, mental fatigue and lamentation that this was a waste of time and taxpayers' money. From supporters of the People's Action Party, baying for blood. Both predictably so. But these are simple-minded villagers masquerading as political commentators, and their views are inconsequential.

Instead, consider this: why did the PAP make this public, and publicize these videos on YouTube? Bear in mind that Singapore is a democracy. As such, we are under certain obligations to due process, no matter how onerous and how tiresome the process may be. You cannot claim to be a democracy and yet eschew the portions that are unpalatable. That is simply not how things work.

Due process is important.

Singapore's Government needed to show the rest of the world just how seriously we take democracy. Singapore's image as a stable and conducive place to conduct business, was at stake.

Due process is another big factor in Agile Methodology. Code sprints are capped off with code reviews. System Integrated Testing. User Acceptance Testing. You cannot claim to be "Agile" and yet do away with integral components of said Methodology.

Would I get more work done without having to deal with Sprints? Are Retrospectives a gigantic pain in the ass? Undoubtedly. Yet, they are necessary.

5. Layperson Expectations

There are more than thirty hours of footage on YouTube. Some enterprising souls have created clickbait by making compilations of all the heated moments. Viewers gravitate towards these, so as to save themselves hours of listening to it all, and entertain themselves by pointing out how Edwin Tong stutters at some parts, or jeer at Pritam Singh, depending on which party they support. And hearing Pritam Singh utter "agree" and more often, "disagree" or "completely disagree".

However, if they took the trouble to actually listen to the entire proceedings, they would find it much less adversarial than the short compilations suggest. For the most part, Tong and Singh are pretty respectful and gentlemanly towards each other - cordial even. There are even parts where Singh elicits a chuckle from Tong, and Tong makes a corny joke or two.

But no - viewers just want the political theater from that little "PAP vs WP" narrative they have in their head. As mentioned before, these are pitchfork-wielding, simple-minded villagers at heart, and they're incapable of seeing anything else.

This isn't magic.

It is much the same in software development. Laypeople only see the end result. They do not see the trial and error, the painstaking process, and the mess that results when requirements are unclear or worse, ambiguous.

What we do is not magic. If something does not make sense outside of the system, it will still not make sense in a program. Programs run on logic, not fantasy. But because laypeople are blind to the process, they may have expectations that can be divorced from reality.

To conclude...

I'm not entirely sure how I managed to sit through all that footage, and actually make sense of it all. But like it or not, this is Singapore's Parliamentary process at work. Perhaps I managed to endure all that precisely because I was thinking like a software developer. And as such, this managed to retain my attention.

"Agree? Disagree?"
T___T


Sunday, 2 January 2022

A dish best served cold?

Former employers may rank among some of the most disliked people on the planet, especially for those of us who have ever left a job due to a toxic work environment, or have been dismissed unfairly. For some of us, it feels like there is should be a special place in hell reserved for nightmarish ex-bosses.

As such, I am dedicating today's blogpost to a popular activity: revenge. Some of us may practice this only in our fantasies, and some might have even dedicated some time to actually materialize this.

Getting even is sweet

Let's face it: most of us, at some point or other in our lives, are capable of vindictiveness. After all, unpleasant bosses made our lives miserable. We spent time and effort trying to do the job, and what we got in return were unrealistic expectations, financial exploitation or bullying - or all of the above. It's only human to want some payback once the work relationship has ended.

Want your
pound of flesh?

However, there's a problem - it's generally considered unprofessional to actually actively take revenge.

No prospective employer, whether he or she is an asshole or not, is going to feel comfortable employing somebody who will openly and willingly trash his former employers. And your professional reputation does count in such cases. So, if your former employer is really such an utter rear end, is it worth affecting your own professional reputation to take him or her down a notch?

Well, here's the good news: you don't have to.

The best revenge

I've had my fair share of unpleasant bosses. Some of them were just demanding. Some of them were huge wankers.

In 2010, my then-boss disappeared after I worked for him for ten months, for free. Years later, I am drawing more than twice what he used to pay me.

In 2013, I had a boss who tried his best to make my life untenable while not-so-subtly promoting a replacement he hired. His wish came through; I quit. I'm sure his candidate tried her best, but it was a sinking ship. To be fair, it was a sinking ship long before I ever left. Last I heard, that unpleasant boss is having legal troubles (due to not paying his staff or some shit) and his good name is in shambles. And I am drawing more than twice what he used to pay me.

In 2015, I ran into a boss who unilaterally cut our pay citing the economy as an excuse. The company collapsed and he had to let us go. Years later, he's encountered one failure after another trying to set up a profitable business, and yes, I'm drawing more than twice what he used to pay me.

In 2020, I encountered one of the biggest jackasses to ever walk God's green earth. He got rid of me, and two weeks later I landed a job at a far larger company, with a raise. He's still running his shitty startup and trying to convince himself he's relevant.

Each of them amounted
to this, nothing more.

In all of these cases, I did not have to lift a finger. I simply outgrew all of them. They were good as stepping stones, and I used my experience with them to move upwards. At the risk of sounding cocky, they can no longer afford me. I don't have to be bitter, or seek to destroy their reputations. It isn't worth the effort it would take from me. They're still struggling entrepreneurs, while I'm a far more highly-paid employee than when I used to slave for them.

Those who made my life difficult back then are already being punished in the worst way possible - they have to be themselves. I don't have to do shit. They're no longer worthy of my time and attention.

You know what's even sweeter than revenge? Being above such things. You can be obsessed with hurting them the way you felt that they hurt you... or you can work on yourself and leave them in the dust. After all, what's one more bad boss in a long line of bad bosses? Making the effort to exact payback makes them seem special. They're really not. Terrible bosses are a dime a dozen.

Conclusion

Revenge is overrated. Revenge is for children. I have no hard feelings towards any of these guys. At the end of the day, it's just business.

Revenge is a dish best served when you no longer give a shit. Best for you, anyway.

Revengers, assemble!
T___T