Testing React (& Native) Components

React is big. Really big. It is the web framework that you need to be doing right now. It was the Ruby on Rails of 2016. You had to be doing it with a double mocha. And a beard. And a comb-over. Unless you're black. Or a woman. Or sane. Then maybe not a comb-over. The component based approach of React is really great. The idea of building these small components that do one thing, and do it well, and using these as building blocks of a larger app. Really…

Keep reading

Pairing vs Pull Request Reviews

Some like them. Some hate them. But code reviews are a good thing. Some may think they are demigods who fart out perfect code, and therefore think them irrelevant. Others think they are absolutely terrible and don't want to be openly found out, and are therefore scared of them. But they are good. For one, they provide knowledge transfer. Firstly, knowledge of what someone did. It gives another developer in a team an understanding of how a feature or requirement was implemented, incase the original developer gets stuck in an…

Keep reading

ECMA Specification Safari: Increment (and Decrement) Operators

Recently, I’ve started reading through the ECMA Script (JavaScript) specification to get a more in depth understanding of the language I seem to be using every day. There are some interesting things I am coming across. Today’s interesting thing is increment and decrement operators. There are two ways of incrementing a variable (decrementing the variable works in the same way): putting the increment operator before or after the variable. var prefixIncrementVariable = "4" var postfixIncrementVariable = "4" ++ prefixIncrementVariable // returns 5 postfixIncrementVariable ++ // returns 4 What both operators do is convert the…

Keep reading

What Is A Class (and why to avoid static methods)

There are many debates in software development, from how to test, to languages, to frameworks, and everything under the sun. Despite my oblivion to the technical details of many of these debates, what I’ve seen is that many of them hover around the lofty heights of roof trusses without understanding the subterranean foundations that build the houses they are comparing (wow, that was poetic: +1500 hipster points). In my short software development career thus far, I have been introduced to 2 paradigms of software development: procedural and object-oriented. And…

Keep reading

Why Are We Mocking Like This?

People like labels that they can classify themselves under. It’s a nice way to have a club you can belong to, and an opposing club you can speak against. In political rhetoric here in South Africa, one group of people will feel complemented when calling them ‘capitalist’, whereas another will feel completely insulted. It’s the same with the term ‘socialist’. This phenomenon seems to also exist in the software development sub-genre of reality. Of late, I’ve been reading and discussing the tensions between the unit-testing practices of…

Keep reading

Broken Windows and Broken Code

This week, I have been reading Tipping Point by Malcolm Gladwell. It talks about how large social movements happen, breaking it down into three things: the people involved, the stickiness of the message, and the context. In discussing the context, he introduces the Broken Window Theory by James Q. Wilson and George L. Kelling, which explains how environment plays a big role in bringing about bad behaviour in individuals. This is my simple understanding of it. In New York, in {{ somedaterangebefore1990 }}, there was a high crime rate. There was a…

Keep reading

Spock: Making Java Testing Groovy

In my previous post, I alluded to how I was introduced to the Ruby cult some time ago. I decided to try out the language for myself. Now, being used to statically typed languages, I’m not really a fan of type enforcing only happening at run-time for languages such as Ruby, JavaScript and Python. But one I really like about Ruby, similar to what I found about Python some time ago, is how human-readable it is, making understanding what the code does a lot easier. Groovy, a language that…

Keep reading