Week 11 Reflections

The week started with talk by Carousell. The biggest takeaway for me was the idea of technical debt. It was a big reminder for me to not blindly hack my way through for the final project and in future projects, but to be aware of the cons of the hackish solutions used, which someone has to fix it up in the future. A small instance of such happened this week when I thought of how the back button logic I implemented some time back could turn out wrong because I took the easy way out by using “window.history.back()”, which causes the back button to bring the user out of the app if the user directly access the app via URL and not the app’s UI flow. Thankfully, it was not too hard to rework the logic from scratch.

Another such problem is binding data fetched asynchronously from server side to HTML where my angular directive has to compute derived attributes, which are to be binded to HTML, from the received data in the directive’s constructor. However, the data takes time to arrive and by the time this happens the execution flow already missed the timing. I could not find a proper way to resolve this as the simplest solution of using semaphore is just stupid for single-threaded Javascript. I found a hackish solution but it restricts whoever passing in asynchronously-fetched data to my directive to have to code in that 1 way in order for it to work properly. I guess this is ok if everyone follows this strictly. I guess this is an intentional technical debt?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s