Yearly Archives: 2017

My Coding Approach

I was thinking about my typical approach to coding. When writing a new feature, I tend to implement in the direction of where the data flows, starting from the user interface then to the backend and back to the frontend and wherever else that goes. I will build incrementally, using debugging tools or console printouts to ensure that each step is working correctly.

As an example, here’s how I did a recent web-based function:

  1. The user needs to see a new button on the screen, so I add the HTML for that button and just have the click handler be an alert confirming the button has been clicked.
  2. The button needs to open a modal dialog. I write the HTML for the modal dialog, then add the code to the button to launch the modal.
  3. On load, the modal dialog needs to fetch some data from the server. I write the Javascript to make the ajax call on launch of the modal.
  4. On the backend, I map the URL route used by the above ajax call to a controller method. The controller method simply outputs a debug message to the console. I refresh the page on the front end, click the button to launch the modal and verify on my server’s console that the controller method has been called.
  5. I modify the controller method to call a method on the relevant model. I write the stub method on the model with a dummy return value, which the controller method then outputs to the console. I verify the entire flow again.
  6. I write the retrieval logic in the controller method. I verify the entire flow again, using server console output to verify the correct data is being returned to the controller.
  7. I have the controller write the returned data to the response as JSON. I go back to the frontend and modify the success handler of the ajax call to log the response to the Javascript console. At this point, I also update the error handler to do whatever is appropriate. I verify the entire flow again, this time confirming that the correct data is displayed in the browser console.
  8. The user needs to see the data from the response, so I write the Javascript and HTML to render the response inside the modal dialog. I verify the entire flow again, this time confirming that the correct data is shown in the modal dialog.

I’m not sure if this is the best approach, but it works for me. It feels incremental, systematic, methodical, and easy to see where things go wrong (which they inevitably do). As kind of an upside, I also strangely feel compelled to not stop until I have working complete flow. Of course the downside is that if I have to stop at any point, I now have a nonworking UI component, but at least that’s a clear indicator of where I need to pick up next time.

I realize that a lot of modern software engineering advocates recommend some kind of test-driven approach. I imagine with such an approach start with the smallest iota of functionality, write a test for it, then write the actual code, then work outwards from there, building more complexity on top. So for the example above, maybe I should have started with the retrieval logic on the backend then work my way outwards from there.

I do that sometimes but I find that as a full-stack engineer my natural tendency is work my way across a new feature in this manner – from user interface to backend and back. Combined with the difficulty of writing code to test UI/HTML/JavaScript, this means I rarely get into the mindset of test-driven development. It’s not something I ever got used to. Maybe someday a switch will click and I will get it and my mind will be blown.

My approach does have some benefits though, in that I’m defining the interfaces first before diving into the guts of the logic. In that sense it’s kind of “test-driven” except all my testing is manual.

I do think having such a systematic, incremental method of implementation is a good skill for the junior programmer to learn though. My experience is that many younger programmers (especially those fresh out of college) tend to write huge chunks of code/logic/functionality then get surprised when the very first thing breaks down.

Recently when sitting down with a junior to help them walk through some problem I often show them how I debug problems this way. I trace the entire flow from start to end, adding debug messages as I go, to help identify at which step the process goes awry. I also try to describe my proposed approach for complex new functions this way. I’ll prototype a small part of it from frontend to backend, writing debug messages all the way, and it conveniently leaves the junior with a template for writing the rest of the functionality. (Although I am as of yet unable to attest to the efficacy of this approach)

I’ve been writing code for a long time, and while I wasn’t self-aware enough back when I started out to document how I was writing software, I like to think I’ve improved a lot since then. And for sure there’s still a lot to learn. Maybe some years from now I’ll look back on this blog post and chuckle about how naive I was and write a new blog post detailing an even better approach.

Grand Prix Singapore 2017 Tournament Report

I had booked the Singapore trip earlier in the year, since I almost always attend Grand Prixs in Singapore as its an easy trip and gives a good opportunity to visit friends. Unfortunately, I ended up not having time to prepare for the tournament itself. Fortunately, it was a limited event rather than constructed, so I figured maybe I could wing it and still do well. (Spoiler: I could not.)

Prior to the trip, my prep for the sealed format had consisted of a single pool at my prerelease and reading a few articles online the night before the trip. I went there on Day 0/Friday to try a last chance trial, but didn’t get past the first round due to a “I’m still testing” mentality that meant poor mulligans and not reading the cards and tilting and scooping before figuring out there was an alternative.

Later that night, we opened 6 different sealed pools and tried out a few different builds to get a feel for the format. I liked the B/W vampires archetype best, and felt that the format was aggressive and wanted to avoid dinosaur decks which would have too many high-end drops. (Spoilers: Dinosaur decks would be my undoing). I knew I wanted to open cards like Bishop’s Soldier, Mark of the Vampire, Walk the Plank, Vanquish the Weak, Ixalan’s Binding and so on.

We ended our night prep with a few simple guidelines for the next day:

  1. Read the cards
  2. Mulligan well
  3. Think before scooping
  4. Life is unfair

Main event time: Amazingly, the judges had pre-registered all the sealed pools. I was happy to note as I opened my pool that I had opened many of the cards I wanted to see. I had a secondary R/G dino list that seemed workable but lacking a few playables. I just went with B/W aggro since that’s what I was confident with. Here’s the build I went with:

Here’s a blurry image if you like that sort of thing:

I was pretty happy with the pool and thought I could do well. The deck looked good, if a bit lacking in two drops. To the swiss!

First 3 rounds: WIN. Aggro deck works as expected. Feels good to get a good GP start.

Round 4: LOSS vs B/W. The guy I fought here eventually finished Day 1 undefeated, so I guess he had a pretty good pool anyway. I was saddened by the early loss, but there was still much to give.

Round 5: Win. Hooray, we are back on track. Or so I thought.

Round 6: Loss vs B/G dinosaurs and removal. Ok, guy had a really solid pool and I tilted a bit, that’s fine. 7-2 for Day one was still doable and a perfectly decent finish.

Round 7: Loss vs R/G dinos. Ugh. Now I see the problem with not having enough two drops. Not able to push through enough early damage means the opponent stabilizes. Mana problems at 16 lands doesn’t help either. No more losses to give after this one.

Round 8: Loss vs R/G dinos again. Similar story as the last round. I message my friend who had gone home earlier. “Good news! I don’t have to come in early tomorrow!” Sigh.

Round 9: Playing just for fun now. Aaand I lose a very close game 3 to another B/W deck.

Oh well, that’s Ixalan limited for me then. The next set drops early January so I’m not playing this format again. The good news is, even if you scrub out on day one, there’s always Chaos Sealed to look forward to on Day Two!

Chaos Sealed

Chaos Sealed was pricey since we get two Masters boosters this time. Here are the ones I pulled:

Yup, everyone got an Unstable. And yup, I sadly got a Coldsnap. I built a red/blue deck with green and black splashes. Mostly just fliers and tempo and removal. Most expensive pull was a Verdant Catacombs from the MM2017. I did use a few Unstable cards, just removal and some solid creatures. None of that contraption silliness, though I did have the opportunity to lose to one later on. I also had a foil Terminate that happened to be by the GP artist so I managed to get it signed.

I won the first 3 rounds on the back of my fliers, then lost round 4 to a mildly annoying Chinese person, then did an ID with the 5th round opponent. Got enough points for like 5/6ths of an Ixalan box. I actually wanted to get a GP shirt, but they were out of XXXLs. At least I managed to win something for the weekend so it wasn’t a total wash.

I’m a bit sad about not performing well in both GPs I attended this year, and as always it makes me think about quitting competitive Magic completely. It requires a lot of time and effort to keep up and be familiar with the metagame. In fact, I had already decided to skip the Standard GP in Singapore next June. (This will be the first GP Singapore that I would have missed since 2010). I’ll probably stick to Modern mostly for the near future.

Singapore 2017

  1. I took a 5-day trip to Singapore last weekend, mostly to play in the Grand Prix, but the opportunity to get away from the country for a while was appreciated. These are some notes and anecdotes from the trip. (Not about the GP itself, that’s a separate post on its own.)
  2. By my count this would be my 5th visit to Singapore. That means Singapore now ties Hong Kong for my most visited foreign destination. My last HK visit was back in 2009, there was no overlap.
  3. Normally when flying out I prefer to check luggage so that I’m not carrying much on the plane. This time I decided to go the opposite route. I hadn’t prepaid for any checked baggage so I tightly packed 5 days worth of clothes into a single backpack for hand carry. It was 0.2kg over the limit, but the lady at the check-in counter didn’t bother to check.
  4. My flight was 5am from Manila to Singapore, mostly so I wouldn’t run afoul of the horrible December traffic on the way to the airport. This plan would have worked better had I not also decided to watch The Last Jedi on it’s first night, mere hours before the flight. That meant I was quite sleepy while waiting at the airport. I’m not one of those people who can sleep alone at the airport – I’m worried about people touching my stuff.
  5. The plane I was getting on was one of those smaller ones with six seats to a row and a single aisle in between. I’d ridden in one of these before, but this was the first time I managed to take a look at how tiny the plane was from the window at the boarding gate. It was barely bigger than an EDSA city bus. I’ve flown many times and I understand the physics, but I’m still amazed that basically a big chunk of metal carries us across the skies by momentum.
  6. Tall people problem no. 37: practically impossible to get a decent sleep on these budget airlines with their little to no legroom and seat backs too short. I managed to get a few  pockets of sleep but nothing continuous as I had to keep adjusting my neck every so often. The flight was three and a half hours, fitbit says I managed to get around 1 hour of sleep.
  7. I met up with a friend at Changi’s new terminal 4. This terminal was new enough that my flight itinerary still said terminal 2. I would be crashing at my friend’s place for the trip. I think I’d stayed at their place twice before.
  8. We took a long train ride to Tiong Bahru where we had a Mos Burger for brunch before taking a bus back to their place. When I originally booked the trip, I assumed I would have free time Thursday to wander about a bit, since the MTG event starts Friday. However, due to lack of sleep I ended up just taking an afternoon nap and mostly lazing around for the rest of the day.
  9. Internet in Singapore is of course much better and faster than in Manila. But it’s a bit less tourist-friendly than say, Tokyo, where every Metro station and 7-11 had free wifi the wandering traveller could use. My friend lent me a mifi to use for the stay, but luckily there was free wifi at both our transition point at Tiong Bahru plaza and at the Singapore Expo where the event was being held.
  10. I had turned off my mobile data prior to boarding the plane to avoid exorbitant roaming charges. Despite that, I managed to accidentally pocket dial someone back home. I’ll find out how much that costs in my next bill.
  11. Aside from the internet, the other thing I like about visiting foreign cities is the public transit. Buses and trains were pretty much the same as I had noted in previous visits, except that they had managed to add a new train line since I was last here, giving us a secondary route to the expo. Basically while Manila’s MRT had been continuously breaking down over the past three years, Singapore managed to add a new line and there’s even another one in construction already. Stark contrast.
  12. Singapore doesn’t have as many train lines yet as HK or London though, and the place I was staying with was out of reach of the train lines, so I still had to transition to buses often. My friend lent me an EZLink card I could use to pay for buses and trains. A robust public transit infrastructure including buses and trains, with predictable schedules and routes you could track online, and a universal payment scheme – some of my modest hopes for Metro Manila.
  13. I’m not much of a foodie, so I don’t really go to other countries to experience their food, so nothing too special to note in that regard. However, I found out that in Singapore, Burger King doesn’t have the 4-cheese whopper (!). Later during the MTG event I spoke with an American dude who works for BK in Singapore and he mentioned that even though the 4CW is a best seller in the Philippines, it didn’t do too well in Singapore. Their best seller is the mushroom swiss whopper thing. (Yuck mushrooms!)
  14. This my first time in Singapore in December, and I think also the first time I’ve experienced rain here. It was a bit heavy while I was at the expo on Friday, I had to wander around Tiong Bahru Plaza a bit on the way back, to give the rain time to settle. Of course I had no umbrella, as I believed I was not allowed to bring one on a plane.
  15. There were book and IT sales at the expo during the weekend I was there. I thought about buying some Marvel trades. They were selling for 10 for S$50, but I would never have been able to fit those in my backpack for the trip home. The electronics and laptops still seemed expensive, even for a sale.
  16. Well, Singapore is an expensive city in general. Meals typically cost 2-3 times what they would back home in Manila. When I’m in a foreign country, I try to avoid doing the conversion math all the time for meals – I went here knowing how much it costs to live here after all. I do the conversion when browsing around for stuff to buy for back home. The conversion rate of around 37php to 1SGD wasn’t convenient, but luckily my friend was a math major and told me to just divide by 8 and multiply by 300. Intuitively it didn’t seem like it would be easier, but it actually was.
  17. Another thing that strikes me whenever I’m wandering about in Singapore is the diversity. On the train, there’s always a smattering of Chinese, Indians, Filipinos, White people, etc. With the recent rise in worldwide news of people expressing hatred towards people who are not of the same descent, it’s refreshing to be in such an environment.
  18. My flight home was just before 7pm on the Monday after the Grand Prix. That meant I had the day to kill, as it were. Packing when quickly (since I didn’t bring much). Spent some time wandering around a mall in the Orchard Road area. Malls in Singapore are a lot more… high end than malls in the Philippines. More like Podium and less like SM Megamall. Browsed through comics in Kinokinuya for a bit (and decided they were too expensive), then headed back to Tiong Bahru for a late lunch and then back to Changi.
  19. Sadly, I had forgotten to web check-in for my flight. Because of travel anxiety, I’m often well-prepared for flying out, but have no similar best practices for flying back. They didn’t have any of those automated check-in kiosks available either, so I had to queue with a whole bunch of OFWs. The annoying thing about OFWs flying back is that they’re often a bit older people who have a ton of luggage and hence take forever at the check-in counter. Some will even argue or haggle over how much they’re allowed to bring. One lady in front of me said she wasn’t even aware there was a limit to check-in baggage. @_@
  20. When it was my time to check-in, I was done in around a minute. The lady behind the counter asked to weigh my hand carry bag, luckily I had somehow shaved off some weight and it was at a comfortable 0.5kg under the limit.
  21. For outgoing immigration at Singapore, if you had your biometrics taken on your way in, you can just do automated immigration. You just scan your passport and boarding pass and your fingerprint and you’re good to go. Neat. The last time I was here, outgoing immigration gave me a scolding for losing the small piece of cardboard that was once part of the card I filled up on the way in. I didn’t need it this time.
  22. Terminal 4 seems much smaller than terminal 2. It’s still large and spacious and kind of like a mall though. I didn’t have much time to browse around, other than buying some bakkwa for people back home. There was an arcade area where I could play Marvel vs Capcom 2, but I was too lazy for that. And of course, there’s ample places to charge, which was nice.
  23. The plane for the flight home was bigger than the one coming on, one of those with 3 sets of 3 seats per row, with two aisles. Amazingly, I had the same seatmates as I did on the flight coming in. They were a young couple that I guess were on their honeymoon or something (they had wedding rings on). We didn’t really talk or anything, just the “Oo nga!” when I noted the coincidence.
  24. I wasn’t really sleepy during this flight, so I spent some time drafting this blog post instead. I also managed to win some kind of Cebu Pacific pouch thing off one of those trivia games that they sometimes have. I managed to answer the incredibly challenging question “Where did the child see mommy kissing Santa Claus?”
  25. Flight landed around 10:45 without incident. This schedule I booked had the same rationale as for my outgoing flight: I wanted to avoid Metro Manila traffic. However even this late wasn’t enough, and I failed many times to get an Uber or a Grab. Reluctantly I queued for a regular taxi. Fighting through Metro Manila traffic, I finally managed to get home a bit past 1am, despite my cab driver being obviously sleepy. Our cab also got sideswiped along the way, with some severe damage on the front headlights and bumper.
  26. The trip is in the books. Aside from doing poorly at the GP itself, it was pretty good. Good to get away for a bit and see old friends and hang out. It felt a bit weirdly casual too, like I randomly popped in to Singapore for no reason. The weekend went quickly, and so back to the grind.

Compartmentalization

I had been looking into a software performance problem for a few hours now and had decided to call it quits for the day. I turned off the lights and climbed into bed, hoping to get to sleep early for a change. I hadn’t been in bed five minutes when I thought about something I hadn’t tried yet. I picked up the tablet that was beside my bed and did a few google searches and soon I was back on my desktop trying out some parameters I hadn’t tried yet.

Ideally one practices some sort of compartmentalization. There should be a clear boundary between work and non-work and you can set work aside as needed. It’s something I’m really bad at, as seen in the example above.

It’s something that needs a certain kind of discipline, and we all know discipline isn’t my strong point. Working from home and with everything in the cloud and accessible online makes that discipline even more important. And even more difficult! It’s a lot easier to create separation when your work stuff is only accessible from the office.

My tendency for multitasking probably doesn’t help either. Even when I’m playing a video game or out on a walk, I can still get distracted by notifications on my phone. I’m used to it and I expect it and I don’t really want to disconnect – so maybe I’m kind of asking for it too.

The other day I was supposed to take a day off from work and was planning to chill all day and maybe work on some personal projects. Still I ended up replying to a few emails and discussing some stuff on slack even while I was playing Persona 5. It wasn’t much work time but still drove home that I was so bad at compartmentalization.

Software development is also like any other professions that involves creative problem solving. It’s hard to set aside the problems you’re trying to solve. You can’t just suddenly quit on a problem at a certain time. They tend to keep spinning around in your head and will pop back into mind at random. And once a new idea or solution does come to you, one might think it wise to just write it down and pursue it later, but then you risk losing flow. Flow is a valuable commodity in professions like mine, so you kind of want to ride along with it when it decides to come.

Supposedly you should be setting aside specific times of the day for when you hunker down to work. That way your mind gets conditioned that “this is work time”. And it makes it easier for you to create that separation between work time and nonwork time. And hopefully flow comes to you at the proper time instead of randomly while pooping. That’s not always easy though, and not always viable due to scheduling concerns. But it should be a step in the right direction. Hopefully it’s not too late to learn that kind of discipline.

Thirty Nine

I haven’t had much time to write recently. Been busy. (I’ll write about that some other time.) But I’ve kind of been posting regularly on this date for a while, so here we are.

Ah, time. And the inexorable passage thereof. There’s some kind of big milestone for me in around three hundred and sixty-five more solar cycles. Well, I don’t personally consider it big, since that’s kind of arbitrary. But as people are wont to say, life begins… maybe I’ll save that for next year.

This year, kind of at a crossroads. Considering where to go and the way forward. Trying out some things. Figuring out what’s important and what’s not and what one would be willing to give up.

In all honesty there’s a good chance that in another year’s time, I still wouldn’t have figured anything out. Maybe that’s what life is though. A constant struggle of figuring out where to go next.

And so it goes.

Hardware Review: Steam Link

Last week the local gaming shop had the Steam Link on 70% discount so I figured I’d give it a try. We recently got a new TV at home, so I was eager to try out some Steam games on the big screen. If you’re too lazy to click the link above, the Steam Link is basically a set-top box that streams your gameplay to a TV via HDMI, allowing you to enjoy your steam games from the comfort of a couch. There was also a sale on Steam controllers, but I had a variety of controllers at home to try out, so I passed on that.

The Steam Link came in a box that was bigger than I was expected. The box looks neat though:

And this is the only device I’ve ever bought that came with a bunch of adapters for different socket types:

The device itself is about as large as external hard drive:

Usage is fairly simple. You hook it up to the TV with an HDMI cable. You connect controllers or dongles via USB. Some controllers like the Steam Controller have wireless support. Network connectivity is through a LAN cable or via wi-fi. When it starts up, it searches your home network for computers running Steam, then it gives you a code that you type into the computer to grant access. Once that’s done, you can stream your games to the TV.

I first tried it out with a Logitech F710 Wireless Gamepad that I’ve had forever, since that’s explicitly meant for games on Windows. I plugged the dongle into the USB slot, but had some trouble at first with the controller not being detected or taking multiple button presses to respond. I wondered if it was lag due to a poor network and worried that I had just wasted some money. It turns out however, that the batteries on the controller simply needed replacing haha.

When streaming to the Link, Steam uses Big Picture mode:

I tried a couple of games I got during the recent Steam sale. I’ve already sunk in at least 8 hours on Ori and the Blind Forest (that includes a lot of dying repeatedly!). This game is a Microsoft exclusive, so I’d never have been able to play it from a couch without the link. A very pretty game too.

I also wanted to test if an arcade stick would work. I had a PS3 Hori arcade stick at home, so I used it to play a bit of Guilty Gear Xrd:

I was also able to test that the PS4 controller works when wired. Supposedly the PS4 controller and the WiiU Pro controller can both work wirelessly, but I had both the PS4 and the WiiU in the same room so I couldn’t try it without activating the consoles.

I’m using a LAN cable, and there’s no noticeable lag or anything. Only annoyance so far is that the controller seems to become unresponsive if I bring up the Steam overlay midgame and try to go back to the game. (If the Link becomes unresponsive, you can still go to your computer and turn it off from there.) All the processing power still comes from your computer, so enjoying your Steam games on the TV still depends on having a decent computer.

While a lot of my Steam games are also available on consoles I have, it’s often cheaper to get them on Steam, so I’ve been looking towards restricting my console purchases to mostly exclusives only. Having the Steam Link helps with that, since I can still enjoy my Steam games on the TV and comfortably from a couch. All in all, a great experience, and a pretty good buy I think.

 

Pisay (the movie)

Last weekend I watched Aureus Solito’s movie Pisay at the UP film center with a couple of friends (both of whom were my Pisay batchmates of course).

For the uninitiated Pisay is the nickname for our beloved Philippine Science High School. It’s a system of government-run schools with a special focus on science and math subjects. There’s a highly-competitive entrance exam and we’ve always been told that students who make it in are considered the “cream of the crop.” (I don’t know that I’ve ever heard anyone outside Pisay say that though.) Students are given full scholarships and a modest stipend, and are required to take a science course upon graduation.

The movie was pretty good. It was more or less four short stories tied together, each one focused on a different year and following a particular batch of students through their stay at Pisay. Each story covers themes central to the Pisay experience: the difficulty of getting in, balancing academics and relationships, stipends, homesickness, trying to pass and failing, wanting to take a non-science course, and so on. The movie takes place during the school years from 1982-1986, basically during the fall of the dictatorship. So it also gets to cover some of the major events during that period and the senior year story has a stronger focus on activism.

I suspect that the movie will be a lot more appreciated by people who actually went to Pisay or people who lived through the 80s. (I’m not sure if teenagers in the 80s really used that much slang though.) I’m also not sure how accurate it is as a reflection of what it was to be a Pisay student in the 80s – some things felt deliberately dramatized for the film’s sake. (That’s fine though.)

This movie hits all the nostalgia points even though it takes place in a completely different time period than when I was there. I look back fondly on my days in Pisay and consider that an important formative period for me. It was challenging and rewarding and it was great to be among peers that shared many of my interests and many lifelong friendships were formed. Maybe someday I’ll write about the experience more, but probably one blog post wouldn’t be enough.

 

Software Development and Government

Random thoughts while walking at night: The structure of government can be a bit analogous to the structure of a software development project.

The Constitution is like the requirements for a project. It’s kind of high-level and (I believe) shouldn’t be too detailed. Supposedly the requirements are written by the client. For a country like the Philippines the client is “we the sovereign Filipino people”.

Slight tangent: I used to know this guy who was one of those rabid “we need to amend the constitution” types and he asked me to review a “mathematical model to track the budget as a function of tax collection and monetary policy” that he wanted to include in a proposed new constitution. I told him I didn’t believe such detailed rules shouldn’t be in the constitution – that would unnecessarily tie us down to a specific model that we may or may not regret later on. I ended up declining to help him with his strange hobby.

The Legislative branch are the analysts. They make the detailed specs/laws to define how we’re going to satisfy the requirements/constitution. In a real project, the client usually signs off on the specs. In government, we supposedly sign off when we vote for the legislators.

The Executive branch are the developers. They’re responsible for implementing the specs/laws in order to fulfill the requirements/constitution. They can decide the technical approach to use, as long as they satisfy the specs and the requirements.

The Judiciary is the QA, they review the work of the developers/executive and make sure they’re following the specs/laws and adhering to the requirements/constitution. Sometimes they even have to review the specs/laws themselves to make sure they aren’t contradicting the requirements/constitution.

Sometimes a project is so large and you need to form smaller subteams to specialize in different areas or modules. That’s called Federalism. Or maybe local government.

Sometimes one person handles specs, development and QA. That’s called dictatorship.

Sometimes people want to rewrite or amend the requirements/constitution. That’s called agile development. Or maybe scope creep.

Sometimes the bureaucracy needs to be reorganized to be more efficient. That’s called refactoring.

The big difference between government and software projects is that in software projects, team members are selected based on meritocracy. In theory at least, you choose the best people for the job. In government, who gets the job is determined by who is best at bamboozling the largest number of people to vote them in. Maybe someday we’ll get a meritocracy in government too, but until then I’m probably sticking to software development.

Adulting

Some time ago a friend from high school invited me to her daughter’s debut. And I had to proxy for her daughter’s ninong and maybe give a few words on what it means to become an adult. My first two reactions were (1) wow I’m so old one of my batchmates has an eighteen-year-old daughter; and (2) what the heck would I know about becoming an adult? (I guess (3) was “oh, it’s a debut, so it’s formal and I have to dress up? I hate dressing up.”)

I mean, don’t get me wrong. I certainly consider myself an adult. But I have no idea when that transitioned happened. It’s not like when you turn eighteen you get some kind of brain implant that magically tells you how to live life and be independent and get a job and be responsible and do your taxes and all that stuff.

If anything, I would say “becoming an adult” is a continuing task that keeps going on even when you’re nearing the big four-oh and beyond. I guess the zeitgeist is already aware of this though, given how we’ve coined the word “adulting”, which basically means doing stuff that makes you feel like an adult. Like going to the bank. Or signing contracts. Or even dressing up to go to a formal event.

While we were having dinner at the event, I jokingly said I should just give a message like “fake it til you make it.” I basically feel that’s what most of adulthood is: bumbling along until you figure out what the heck you’re doing. When you’re a kid you look up to the grown-ups who can go out and do anything they want and confidently do all these jobs and they know everything. But when you grow up you realize that’s not really how it works – most of the time all the adults are struggling through life too, trying to figure out whatever thing they have to do that day, or even just trying to make it to the next paycheck. And you’re definitely going to miss being a kid. Maybe that’s the sign that you’re already an adult, when you already miss being a kid?

I ended up reading a few words from the actual ninong, so I didn’t get to give my own adulthood message. One of my other batchmates gave the debutante a copy of The Art of War as a gift, with the message that adulthood is basically warfare so she should be prepared. While I agree with that sentiment somewhat, I think for me the most important thing about becoming an adult would be learning to find your own voice and identity. That means figuring out what’s important to you and what values you hold. Being an adult isn’t easy, but knowing yourself in this way gives you a framework to guide you in your adulting decisions.

Web Frameworks – Open Source or Roll Your Own?

A while back I wrote about my experience coding and maintaining an in-house web framework at a previous job. It was a full-stack web framework. We had libraries for front-end Javascript up to server-side database connections. And the entire stack was tightly coupled. But while the framework was serviceable, it was almost always behind modern trends in web development. I always felt like we were playing catch-up. And as a developer I wanted to widen my horizons and try out more things. So more than once I had discussions with higher management about using open source web frameworks in some projects.
 
Unfortunately, our in-house web framework already had a long history and most of the devs in our company were used to it. The company had tried using a different Java-based framework stack before. It was back in the days when things like Struts, Spring, Hibernate, etc were beginning to ramp up. It kind of ended in disaster – that project ended up taking a lot of effort, had a lot of technical problems, and so on. I believe this gave the company leadership the impression that investing in other frameworks are not worth the risk and effort. It’s a form of Not Invented Here syndrome.
 
I admit there are some advantages to having your own in-house web framework. After all, all the popular web frameworks today started out in-house in some company and later they decided to release as open source. And many companies do fine using in-house frameworks. Using an in-house framework means full control over the behavior. And you can tailor the functionality and coding style to your internal processes. In fact it can be a good value add to your company if your in-house framework did something better or unique compared to open source ones.
 
But there are also significant advantages to using open source frameworks. Maybe I should have used some of these during discussions when I was there:
 
  • With an open source framework, we wouldn’t have to maintain the core functionality of the framework ourselves. We wouldn’t have to maintain the full stack ourselves. We would only need to maintain any customisations and extensions we write for our own needs. For our in-house web framework, every so often we’d spend some effort to come out with a new version with incremental improvements. With an open source framework, we could instead redirect that effort to higher-value work.
  • There’s more learning material available online, and they don’t have to be maintained in-house.
  • There’s a wider base of experience to draw from. For our in-house framework if you encountered a problem requiring deep framework knowledge, there were only a handful of high-level experts in the company. For an open-source web framework, that expertise is widely available on the internet through sites such as Stack Overflow.
  • Having knowledge/experience in established frameworks means your company can get more contracts. You can take on projects that use those frameworks. You don’t have to spend proposal space trying to convince clients that your in-house framework is great. With open source frameworks you can reuse marketing copy by someone else!
  • Working on well-known, established frameworks is better for your developers career-wise. It gives them more knowledge that could be transferable to other jobs. While this isn’t a benefit to the company per se, it will make the company more attractive to developers. It even allows the flexibility of hiring developers experience with that framework.

There are some disadvantages too of course:

  • As mentioned above, there is time and effort involved in learning a new open source framework. This effort is mostly for the experienced developers – for new hires they will need to learn something regardless
  • Having an in-house team developing your own framework means you have a core set of developers experienced in the full stack. Reliance on open source frameworks means most of your developers won’t be familiar with the low level details.

In the end, there’s no guarantee that using an open source framework will be painless or be better than developing one in-house. So I can understand the decision to stick with what you know. But for me as a developer, I feel that it’s more rewarding to be exposed to different frameworks.

In fact I wrote this post because recently someone asked me what my “go-to web framework” was and I said I didn’t have one. I’d rather be flexible enough to learn and work with any existing framework. In our industry where change happens quickly and can catch you by surprise, I think that flexibility is a much more valuable asset to have.