Guidelines to protect developer time for meetings and sprints

Just came up with some guidelines which I feel would help in protecting developer time with regards to meetings and sprints, mainly by putting in some kind of structure. Disclaimer: These guidelines may not be applicable to everyone or every company ๐Ÿ˜› Do read Paul Graham’s article on Maker’s Schedule, Managers Schedule which clearly explains …

10 criteria to rate oneself in a programming language or framework

Was sitting on an interview panel recently and the interviewee was asked to rate himself for the Laravel PHP framework, on a scale of 1 to 10. Some basic questions on Laravel were asked before this but the answers were not satisfactory. His reply? 9/10. Personally, for PHP, I would probably rate myself 5/10, and …

Responsible CSS – your plugin is only a tenant renting a room in someone’s house

Let’s say you own a website with 2 webpages and you wish to install a third-party plugin to create a newsfeed on each page. In this case, I am the author of the newsfeed plugin that you have chosen. Below is a sample of how the plugin is embedded: <div class=”container”> <!– container element provided …

Logical operators in Javascript do not always return boolean result

Given a variable myObj in Javascript, evaluating myObj.child.name || ‘Kid’ will cause an error if myObj.child does not exist. In comparison, in PHP, $myObj->child->name ?? ‘Kid’ would just yield “Kid” with no errors. One way would be to write the expression let result = (myObj && myObj.child && myObj.child.name) ? myObj.child.name : ‘Kid’;. Another way …

When an object is assigned to a variable, will modifying the variable modify the original object?

This is similar to the previous blog post except this is more direct. The answer is “Yes” for all tested languages except C and C++. This may seem trivial until you meet a situation where the same original object is shared across requests/sessions, like a public static variable in Java or an incorrectly scoped Javascript …

Does modifying objects passed in to functions modify original object?

As per title, ran this across various languages. Results are mixed, but IMHO, it seems unsafe to design your functions/methods this way. It would be better to pass in the object, compute the changes without modifying the object, return the computed changes and assign it back to the original variable. Below are sample code snippets …

Get actual app ID and version from Android library without Context

References: How to get package name from anywhere? Get Android application package without Context Source code for android.app.ActivityThread This addresses the scenario where you are writing an Android library/SDK and it’s used in an app. How to get the actual app ID (package name) and version from inside the SDK? BuildConfig.APPLICATION_ID and BuildConfig.VERSION_NAME would return …