Wearing dice on my head since 2008 Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart. Randomly amazed.

roytang.net

last update:

  There was this project we had where there was a strange bug. The developer working on it found that the problem only appears when the record ID was 12. When it was 11 or less, everything was fine. When it was 13 or more, everything was also fine. After some investigation, it was found that there was some code that executed with a condition of “if record id == 12”, which was already a WTF.

There’s a very rare, privileged group of people for whom everything in life goes well and they experience great success all the time. You and I are not part of that group (most likely). Like the vast majority of other people, sometimes our lives are good and sometimes our lives are bad. Sometimes life can feel cruel or unfair or exhausting. In those times it’s easy to forget the times when life was good and to wallow in your misery.

The software development process is already difficult mainly because a lot of it so imprecise. Requirements are often only vague wishes that the client has, with no regard to the sheer number of instructions needed to implement those requirements. Throughout the entire process it’s important to use feedback loops to determine whether development is on the right path. And like all feedback loops, their effectiveness often hinges on how quickly we are able to turn around and give and incorporate feedback into future iterations

A feedback loop happens in a system when you are able to use an output of that system to influence the inputs, which in turn influences the outputs and repeats the cycle In engineering, feedback loops are useful to generate steady-state outputs. We had an entire subject dedicated to feedback loop controllers back in college. I enjoyed the topic so much I took the subject twice! An example of the use of feedback loops would be a thermostat that has a sensor to detect the current temperature.

In Tagalog: “Madali lang naman diba?” Probably one of the most annoying things a programmer can hear, especially from a client or a manager who has no appreciation of how complex software development is. It’s presumptuous at best and actively damaging to schedule and morale at worst. We already know estimation is hard, there is no need to make it more complicated by automatically assuming the best-case scenario (or in many cases, an impossible scenario)

I’ve picked up quite a few daily habits since the start of the year. To name a few: I’ve been doing daily sketches, I’ve been going on a daily walking routine, learning Spanish on Duolingo, I have a quick stretching/exercise routine I do in the mornings, etc. (I’m also supposed to be writing daily, but this has proven more difficult to keep doing consistently… ) I like those daily habits that can be easily tracked with technology.

“Composition over inheritance” is an object-oriented programming principle that I’m sad to say many devs I’ve encountered aren’t too familiar with. Composition provides greater flexibility, modularity, and extensibility in large software systems as compared to inheritance, especially for statically typed languages like Java that don’t support multiple inheritance The most common examples of the problems caused by too much inheritance involved generic object such as the game objects example in the wikipedia page linked above.

Sometimes I write something and at the end I find that it upsets me. Or I think about something I haven’t thought about in a long time just before I sleep, then I have a nightmare about it and it saddens me to think that my subconscious still hasn’t let go of it after all this time That’s a good thing though, right? One of the purpose of writing and introspection is to become more attuned to your inner thoughts and emotions, to better understand and work with your own self.

For the better part of my software development career so far, I’ve had the doubtful pleasure of being one of the devs using and maintaining our in-house web development framework. Framework coding is a bit different from the actual application development. At the core it’s a simple idea: you have a whole bunch of code that helps do programming tasks that you expect will often be necessary in a certain set of projects, so you write that code with the intent of reusing it across multiple projects.

I’m kind of a serial project starter. I’m sure it’s a very common thing. I’ll often have random ideas for projects I could do, big or small. I’d have a dozen of them percolating in my head at any one time. And somewhere between four to five dozen scattered down in various documents, notepads and what not, waiting to be explored. (I literally have two such small post-it notes with 5 such items in front of me right now)

“We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.” — Larry Wall, Programming Perl (1st edition) Hubris is a fancier word for an excessive sense of pride. Why is this to be considered a great virtue for a programmer? Programming is at least partly an act of creation, which means there is an element of craftsmanship involved. A craftsman imbued with hubris is able to take pride in his work – he is driven to create work that is the best quality he can provide.

(A bit of Philippine politics in this post, if that sort of thing bothers you) Recently as the whole world watched one of our political leaders display his expected lack of diplomatic finesse on the global stage, I couldn’t help but think about how in my younger days there’s a good chance I might have approved of his frank, straight-talking, shoot-from-the-hip brand of diplomacy. I have a bit of a reputation myself for preferring to speak frankly and directly instead of dancing around the issues, although these days I understand the wisdom of adapting to the situation as needed

… especially for strongly-typed languages. In one of the bigger Java projects that I took over, I was often annoyed to find some devs had written method signatures like public void doTheThing(HashMapparams) Which is silly – not because of the naming, that’s obviously not a real-world function name. The silly part is requiring a particular implementation (HashMap) instead of the generic interface (Map). It unnecessarily restricts your API and makes it less flexible.

A recent post on Wait But Why had me thinking about lying. Some people will scoff if I say I don’t lie. They’re not wrong. I once spun a tall tale about a childhood rival I had visited in the province who challenged me to a swimming contest to explain why I had lost my glasses to the sea. The lie was so good, I got a follow-up question about it a year later and was so surprised I just blurted out that my rival died in accident before finally admitting to the fib

It’s no secret that many are unhappy with the way the congressional investigations into the so-called “drug war” and related killings here in the Philippines. If I were in charge of these investigations, these are the some of the questions I’d want answered: (Disclaimers: I’m not a lawyer or any kind of expert. Understandably, the resource persons may be reluctant to answer some of these in open session, in which case an executive session could be done.

Overhead scale up rapidly as project team size increases. Every time you add a new person to the team, he comes with a lot of overhead such as the need to learn the project details, responsibilities of other team members, who to consult when there’s trouble, custom project procedures, and so on It’s a reinforcing cycle too. As overhead increases, the team imposes more processes and restrictions to make sure everyone is doing the right thing and there are no screw-ups.

Speak Up

opinions

Asians, and maybe Filipinos more specifically, have this cultural bias towards trying to avoid conflict. So often there will be people who don’t like to speak up when they think something is wrong, either just tolerating it or hoping someone else will take it up. A software dev in another company once told me that he felt like he was complaining so much that he was looking like a bad guy

Overtime in software development projects seems to be a given. Sure, there are projects and companies that don’t need it, but those feel like the exception rather than the norm Overtime in software development is a natural consequence of schedule pressure and the fact that estimation is hard, which is why it’s understandably common, but that doesn’t mean we shouldn’t try to avoid it More than once I’ve been in a situation where the team stays overnight to try to get a build or release ready for the next day only to run out of time and have to delay the deployment anyway.

Pain

nostalgia

Almost six years ago, I had to undergo minor surgery and had to endure the pain of being administered spinal anesthesia. I was reminded of this recently because a loved one with an even lower pain tolerance than I did recently had to undergo a similar procedure I have a pretty low tolerance for pain myself. I tried to spin it a bit positively in the blog post linked above, but there’s no question many times during the procedure I felt miserable and in lots of pain.

A while back, news came out that an AI was able to perform a diagnosis after the human doctors were stumped. Having just finished binge-watching the entire run of Star Trek Voyager, I immediately thought that was the sort of AI advancement that could lead to such things as Voyager’s Emergency Medical Hologram, an AI which could replace a human doctor. Of course, it is still very unlikely for this to happen anytime soon, medicine is a very complex field and new things are still being discovered all the time.

I remember having a discussion with a friend a few years back where I made the following list to emphasize a point: 8-9 hours at work (possibly more) 7-8 hours of sleep 3-4 hours commuting in Metro Manila 2 hours for meals That leaves you between 1-4 hours for all forms of recreation including exercise, sports, TV, derping around on the internet, hanging out with friends, and so on.

Without a doubt, the number one problem in software development projects is schedule pressure, that is, the pressure to meet unreasonable deadlines and targets Almost all other problems can be overcome if there were no schedule pressure: weaker developers could be mentored to become better, more productive, and commit less faults less faults overall will be committed anyway if there were no schedule pressure poor requirements could be threshed out in more detail difficult clients can be argued, worn-down, and eventually reasoned with problematic team members can be counseled, or replaced with new blood and so on But of course, the reality is that we live in a world with deadlines and targets, many of them set by people who have no idea about the complexities of software development.

Some days you are tired Maybe you are tired of all the work You can’t keep up with, it all piles up Of all the meetings and reports That come relentlessly without end Some days you are tired Maybe you are tired of all the time That you never have enough of Of all the deadlines and targets That you never meet but should’ve Some days you are tired Maybe you are tired of the world

Estimation is hard. Estimation has long been the bane of many software developers and software development projects. But there are two secret ways to be able to produce perfect estimates for software development work all the time! One is dependent on talent, and the other is dependent on technology Psychic precognition, i.e. be able to predict the future Have a time machine, so you can go back in time and tell yourself how long the work would have taken Such precognition is necessary to have perfect estimates because of all the unknowns present at the start of a software project.

When you’re young and in school memorizing math formulas or history dates or whatnot, all of it seems so silly and you wonder if you’re really going to be using all of this knowledge in real life. However, the intent of a general education program isn’t specifically to give you knowledge that will be useful to you in the future (although it may turn out to be so) The stuff school teaches you – literature, mathematics, art, history, science, and so on – are intended to give you a broad enough base from which you can freely choose the direction you want to go in life.

If you follow me on Facebook or Twitter, you’ll know I have a tendency to be pretty vocal about any problems I have with our country’s erstwhile leadership. But for the most part I’ve restricted it to those channels and have tried to avoid posting about current events in the country on this blog (outside of my personal choices for the election), but I feel that now more than ever those of us who can speak out have a responsibility to do so whenever we can, for several reasons

I like to say that software development is a challenging career because no two projects are ever the same and there are always new challenges to face and new concepts to learn, but the truth of the matter is a bit more complex. Writing software is about breaking down large problems into a series of very small technical problems for which we already have solutions. Examples of small enough technical problems include list sorting, comparison, arithmetic operations, path traversal, string concatenation, returning a string as an HTTP response, rendering text to the screen, retrieving submitted parameters from an HTTP request, and so on.

No, not that kind of history, don’t worry. Twenty-five years ago this month, the first website went up on the world wide web. That was 1991. It took a few years for the Philippines to catch on, the first internet connection in the country was only set up in 1994. My personal experience with the internet came a bit later, during our freshman year in University, sometime in the schoolyear 1995-1996.

So, Stranger Things It’s true, it’s great. I thought it might be overhyped, but it’s not. And I can see why people find it hard to explain without spoiling things. It’s about strange things happening in a small town. Creepy things. It’s a mystery. It’s suspense. It’s not a jump-scare sort of thing if you’re not into that. Well, there’s maybe a little bit of jump scares. The best description I’d say it’s about as scary as an X-Files or Doctor Who episode.

I was originally going to write a post about the problems development teams face as they get larger, but the section on development standards was long enough by itself so here we are. Having some sort of development standard in a project development team becomes a lot more important as project size goes up (for obvious reasons). There are different kinds of standards to consider, but generally I break them down into design standards and coding standards.

Thirty Eight

Thirty eight lessons I’ve learned through the years, in no particular order: Do not be beguiled by pretty things; not all that glitters is gold Remain true to yourself in the face of adversity You can’t help people who aren’t willing to change People will believe what they want to believe You don’t have to do what everybody else does Happiness often comes from small things Be thankful for what you have and appreciate the people who are there for you Other people think about you a lot less than you think Time you enjoy wasting isn’t wasted time Spend some time alone with your thoughts regularly; solitude has its benefits In most situations, a balanced approach will serve you well.

Pros: It is a very rewarding career financially. Software development often ranks in the top 10 highest-earning careers in most countries There is a lot of scope – you could be developing web applications, mobile applications, embedded applications, client-side, server-side, data analysis, artificial intelligence, games, etc It is very difficult to be bored. You can always automate away the boring stuff. Different projects always present different challenges. The field is evolving rapidly so there are always new things to learn.

Motivation is a fickle mistress. It comes and it goes. It’s easily distracted. It can vanish in a blink of an eye. When it’s there, it’s great, but when it’s not you don’t get anything done and you don’t feel terrible. Motivation is based on the principle that you need a certain emotion or state of mind to get things done. Motivation is burst damage, you can get a lot done but you don’t know when it’s gonna come out.

Evaluation of programmer performance is notoriously hard. You want to be accurate and at the same time fair such that all programmers on your staff are evaluated in the same matter. However, there are no good, objective, universally accepted standard metrics. It follows from the fact that there are no good, objective, universally accepted standard metrics for program size. Typically each programmer in a team will not be doing the same task or even the same type of task, so in order to produce fair evaluations you will need some standard metric of program size to normalize any evaluation.

When blogging and social media started to explode in popularity, it held a great promise: it would give a voice to the masses. Where previously there were gatekeepers in traditional media channels who controlled whose opinions could be published or broadcast, the internet meant that anyone with an internet connection could publish and voice out their thoughts and people would be all smart and there would be lots of intelligent discussion and it would be great.

****Since I wasn’t a graduate of computer science, there were many concepts of software development I really only got exposed to when I started working. One of those was the concept of a relational database, and hence SQL. The company I worked at gave all new hires a training regimen that started with about a week of SQL. Despite not knowing anything about it beforehand, I took to it like a mouse takes to cheese.

I found this draft blog post that I had written back in 2010. I’m not sure why I never published it, though it does end on a dire note and seems a bit incomplete. Perhaps I had some further thoughts percolating in my brain back then that never came forward. I am also not sure if I wrote this before reading about The Great Filter. I figured I’d just publish it now without further comment:

I never really put much stock in certifications. I felt that they were no guarantee of knowledge or expertise, and that many people who did have knowledge or expertise wouldn’t necessarily have a certification to say so. Add to that it often seem overpriced to even apply for the certifications, so I didn’t have a high opinion of them. That being said, I have had the opportunity to take professional certification exams twice in my life (both luckily paid for by my employer at that time).

During my the first semester of my second year in University, I failed four out of five classes I was taking due to slacking off a lot. Those same classes were only available during the first semester of each year, which meant I could not retake them during the second semester or over the summer to catch up. So effectively, I had fallen one year behind everyone I knew. When I got the news, it was devastating.

A friend of mine had an informal consultation with me the other day (read: asked me questions over FB messenger) about what their IT staff was telling them about a file upload vulnerability that had been recently exploited in one of their applications. Obviously it was difficult for me to judge given that I didn’t know all the details, but for me it was most likely a vulnerability introduced in the application code itself.

During my adult life, I’ve tried to learn or at least expose myself to one new skill or programming language every year. For example, over the past year or so I’ve been studying, dabbling, or trying out the following: game development using Unity, technical analysis of stocks, Spanish, driving a car, and even some simple cooking! I’ve also been regularly practicing to improve my skills in writing and sketching. I probably even forgot a few things I’ve tried to learn.

Some time ago, one of my many intrepid followers pointed out that this blog tested poorly on web page performance according to this Speed Testing Tool. Now, I’m of the opinion that for a personal blog such as this, web performance isn’t really a mission-critical sort of thing, but as a software developer who has often had to work hard to optimize the web applications we delivered to our clients, it kind of became a matter of pride :pUnacceptable!

Ice Candy

nostalgia

I read an article recently about how we should encourage entrepreneurial spirit in kids from a very young age. It made think of a time when we were kids and we tried running a business It was a summer from years ago. Perhaps 1988 or 1989, or maybe a year or two earlier, I can’t be sure. I was young, my brother was younger by a few years, my female cousin older by a few years.

I had my first taste with working with software testers during my first project where I was involved with porting an old system to a new version of the software. My first task involved porting reports which were to be generated by the users then printed out. The task wasn’t too difficult: basically you took the source code of the report (it was some weird binary format recognized only by the particular reporting tool – that was how it was done back in the day) and open it using the newer version of the tool, and the tool did some sort of migration magic to adapt it to the new format, then you just save it back again.

Grammar note: “Biased” is an adjective. “Bias” is a noun. It is not appropriate to say that a person or an entity “is bias”. Unless you are talking to like a prejudice elemental or something (takes note of that for hypothetical hipster RPG) In a (long-winded) discussion during the recent election period, someone told me that I “obviously had a bias” and my answer was “Of course I do! Everyone does!

In the modern era of online services and applications, it is getting more and more common to hear of databases and systems being hacked and user data being exposed. The most dangerous of this data is the user’s password since it may allow access not only to your own service but to other services as well. As an application developer, the below is probably the bare minimum you need to know when handling user passwords:

Around the first week of June 2016, Mark Zuckerberg, well-known nerd and founder of Facebook, was hacked. If even the founder of the world’s largest social network can be hacked, anybody can! So it might be a good idea to review how you manage and secure your online passwords     Avoid using short, simple, or commonly-used passwords! These are subject to so-called “brute force” attacks where bad actors just try a whole lot of passwords until they find one that works.

More stories from the early days. Evaluating someone’s programming ability is hard, especially someone fresh out of college. A student’s grades is in no way indicative of how well he can program after all. So most nontrivial programming jobs have some sort of complicated application process involved. I remember going in and taking an exam. Most application processes will have some sort of written exam to filter out people who look good on paper, but can’t actually do anything.

Immortality

opinions

“Do you know what’s there, waiting beyond that beach? Immortality! Take it! It’s yours!” – Achilles, Troy Each person has a different view of what their life’s purpose is, but I’ve found more often than not it relates to some form of immortality. Usually that means leaving something behind, some trace of yourself so that the world remembers you, something that says “I was here, I existed.” For many people that means offspring, for others it may mean some other legacy: children taught, people helped, ideas expounded, inventions created, companies founded, and so on

I once had to advise someone who found himself irritated at receiving lots of comments during code review. I think my response was good enough to quote verbatim: Remember: You are not your code. You are not the hundred or so lines of C or Java or JavaScript or whatever that you wrote today. This problem arises because you are too attached to your code. Your ego is associated with the code you write and you feel that any comments or defects found reflect upon you as a person.