Sunday, March 17, 2013

Code Review: Kevin Go


Kevin, like any other Chinese kid growing up with Asian dad Chinese parents, has been brought up to be intellectually competitive and a medal short of an overachiever.

Incredibly young (only 20 years old), he has shown street smarts and a healthy dose of competitive edge that shines through in his work. Kevin wants to not only do well, he also has a drive to turn things he touches into coding gold. His favorite mantra is "meliora" - a Latin word meaning "better." Because being Kevin Go (and being as Asian as they come), that's what he always aims for, to always do better, be better so that one day, he may become great.

Here's a kid worth looking out for as big things may come from him yet!

Read on for Kevin's kickbutt code review:

Hey Kevsies. What are you currently working on?
* Hi! I'm currently working on maps. Something like Google maps where users can search for places except that it's limited to the organization locations plotted on the map in the project. This map displays the locations of the organizations and is searchable. Also, users can save their search, filter their search and export it to a PDF file.


What issue/problem did you encounter while working on it? (or what task did you finish/accomplish?)
* I was not allowed to use Google maps for easier implementation in the front-end. So I looked for open-source stuff for the maps to come up with a solution for it.

* Another is that the client asked me to look for a way that a user can export the displayed map/have a screenshot of the map into an image attached to the PDF file. 


Wow, that must've been a challenge! So then, what cool solutions did you come up for it?
* It was. Got stuck on it for a couple of days. Then I found something floating around and that's what I used. It's called Leaflet.js. That's what I used for the front-end design to display the pins of the places and pop-ups. Also, I used Mapbox to cater the display of map tile layers to integrate with leaflet.js. Layers are also configurable via the Django admin and can be enabled/disabled with its use.

* For the map image export, knowing that the map is displayed by the Javascript and I can't use the HTML to PDF feature, I looked for a different solution and found HTML2Canvas.js plugin where it converts the displayed map into a canvas then converted to a .png image to be attached to the .pdf exported file.


Well, aren't you a resourceful one! I'm a non-technical loser. Could you expound on this maps thing a bit more?
* So basically, it's just a maps (same with other map stuff you see online) where you can search using filters, save your search, display information about the searched places then you can export your saved search into a PDF file. The project I'm currently working on needed it. That's what necessitated the research of new materials, hence the use of Leaflet, Mapbox, and HTML2Canvas. Imagine Mapquest or Google maps or something.

Cool beans. Were there any other cool ninja stuff you shared to the guys during your code review?
* Well I think I have discussed Leaflet.js well to the team and how it can be an alternative for Google maps. Also, I have discussed with them the process on having a screenshot of the html that is generated by the JS.


No mistakes on the code then?
* There were none, of course. Having one would be a travesty!! My parents would disown me. (Joke)

* Kidding aside, when I work, I always make sure that the code I write is clean and streamlined so that it's easy to read and debug and would be optimized to the best degree. I find that doing it right the first time is actually more productive that having to always re-do your work. Saves me a lot of time and effort. As an Asian, I'm OC with my code like duttt.


Feelings, reactions while doing the code review? 
* I was glad that I have shared something to my co-devs. I hope it would be useful to them too.


That's all, dear. Thank you.
* You're welcome. :)

No comments:

Post a Comment