#13: Don’t treat test code as a second-class citizen
2020 was my first full year working as a software engineer and my full first year living in San Francisco. Thanks to a pandemic, I did a lot less exploring of an exciting new city than I’d intended and a lot more baking and Tiger King-watching. The one silver lining was that I got to spend some of my stuck-at-home time reading and working on personal projects, so I learned more about software engineering best practices than I would’ve had it been a normal year. Here are my 20 most valuable learnings.
Developers spend most of their productive time reading code, not writing it: debugging, checking commits done by others, learning new libraries, etc. This means your code should be easy to understand, even if it means longer names, more lines of code, and less “cleverness.”
For example, naming a variable timeInMillis
rather than time
requires a bit of extra typing, but saves developers from needing to look around the code base to figure out which time unit the variable is using.
Another example is all the one-liner solutions posted in LeetCode discussions. This palindrome number solution is clever:
def isPalindrome(self, x: int) -> bool:
a=list(str(x))
return a==a[::-1]
But it’s much harder to understand than a more verbose solution would be. Coming up with one-liners can be a fun challenge — just make sure you’re not adding it to a code base with multiple contributors.
AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!
AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!
AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!
This blog provides quick analysis to decide whether to opt for Kotlin or React Native to build robust and secure mobile application.
In this Kotlin tutorial, the lead Kotlin language designer will show you how you can write more idiomatic Kotlin, what the benefits are, and help you discover some of the most powerful yet lesser known features of Kotlin. Kotlin is similar to the Java programming language, so it's natural that your Kotlin code looks very much like Java code when you are first start to use the language.