I often hear something along the lines of “I cannot write tests for that UI code!” as the reason for the lack of unit tests. The fact is, more often than not, we can write tests for what seems to be “UI code”. I decided to come up with a talk to explore that topic and will be giving it at the Improving Code’s User Group next month, on March 4th.
In this talk, we’ll explore an approach to either write or refactor UI code so it can be tested more easily. We will NOT cover how to write automated UI tests, though.
Looking forward to it!!
I’m speaking at the North Houston .NET User Group this coming Thursday, Feb 20, 6:30-8:00pm. I hope to see you there!
Code Review: I Mean No Harm!
As part of the work I’ve been doing for many years, I get to do a lot of code review. I usually document things that come up doing a code review so I can share it with other developers in the teams. In this session, I share some of the code I’ve looked at, the reasons why the code raised yellow or red flags in my head, and some possible solutions I’ve proposed.
Back in 2015, I used to have a morning routine that included working out at the gym. Since I get bored working out, I’d often be either listening to audiobooks and podcasts or watching TED talk videos on my iPad. Whenever there was something I wanted to either review or remember later, I’d take a quick note, such as this one: “Slow the #$@! down!“
I wrote that note when watching Carl Honore’s “In Praise of Slowness” TED talk. I’ve been since saying that sentence in my mind, deliberately, at times when I realize I’m rushing through things.
Did Michael Jordan really say that?
I’ve either read or heard someplace that somebody asked Michael Jordan how he was able to read a game so well and react so fast to it, and his answer was something along the lines of having an ability to see everything going on around him as if it were in slow motion.
I haven’t been able to fact-check that, but I don’t care, since the idea makes a lot of sense to me: if anything is fast-paced, the best way to succeed at it is to see it in slow motion. But how do we do that without acquiring the powers that only fictional characters such The Flash possess?
How does he make his guitar sound like that?!
I still remember my thoughts when I first listened to Yngwie J. Malmsteen (Swedish Guitarist) when I was a teenager. At the time, I was happy I could play some of my favorite guitar solos found in the music of bands such as Iron Maiden and Metallica. I could learn their songs simply by listening to it.
Then, I start listening to an album by Yngwie and my face is melt; I simply could not understand how he could make his guitar sound like that. I mean, I couldn’t visualize how he was playing that. Certain passages sounded so fast, yet so smooth. I’d pick up my guitar and not have a clue where to start trying to learn one of his licks or solos. I had to see it to believe it. After seeing it, my brain could start processing what was happening.
At one point I got a copy of a VHS tape with his video lessons (holy grail!), and when he slowed down playing some of his licks, only then I believed I could actually learn how to play that (and I did, as we can see in some of my own music).
Practicing playing a guitar has to start slow, regardless of your level.
Riding motorcycle at a race track can be daunting. Things come to you very fast when you’re going 150mph on a straight, or 100mph around a corner! When I started riding at the track in 2017, I did what most beginners do: looked down on the track, instead of further ahead. By the time I got to a corner, my brain didn’t have enough time to process the information and make quick decisions on all the things that I need to do in order to go through a corner properly.
“Go slow to go fast”, they say. And that’s true. I needed to slow down to be able to learn fundamentals of track riding. Give time to the mind and body to internalize the actions. As time goes by, muscle memory is built, besides developing better visual skills; instead of looking where I’m going, I learn to look where I want to go next. The better I do that, the more time I give the brain to process everything, so it’s almost like things are coming at me in slow-motion.
Putting the mind and body through the process of slowing things down before trying to go fast makes me a better rider, so I do it as much as I can, which includes riding mini-bikes:
Fast-Thinkers and Improv
I’ve been blogging about my recent experiences in improv. At first, I thought improv would teach me how to think fast. As I focus on thinking fast, I end up stumbling into my own thoughts. That’s similar to blowing up corners at the race track because of not “seeing ahead”, or blowing up several notes in a guitar solo simply because I’m focusing on playing fast.
But then, I found this short video a few days ago, which changed my perspective on it:
“Backing up” in a scene seems equivalent to seeing things in slow-motion.
What did that driver just do?
I guess this has happened to you several times: you’re driving, minding your own business, when all of sudden, another driver pulls up right in front of you (driving out of a parking lot or something like that), startling you really bad.
That does happen to me at times, usually, when my mind has drifted away, as I’m thinking about a million things, except for the one impostant task at hand, which is to safely drive my car. In such situation, it is easy for other drivers to catch me off-guard.
That type of situation can be avoided by using “slow-motion” again. In this case, that means to be in the moment, aware of my surroundings. When fully-aware, predicting what other drivers are about to do becomes easier. We predict when a driver is ready to jump the gun and make a last-minute right-turn, or when a driver will cut you and others off, jumping lanes without using the blinkers, or when a driver will speed up to prevent you from merging into his or her lane. “Slow-motion” here doesn’t mean slowing down the speed of the car; instead, it means our mind can better assess the situation because we’re giving it space to process the information.
I’d like to point out that I believe I’m usually way more aware in traffic than other drivers because I also ride motorcycles (the lack of a “cage” makes one aware in the middle of crazy traffic and drivers).
Software Development: Productivity Tools
I’ve been using productivity tools such as ReSharper and Code Rush for a long time. At first, it was just cool to see how quickly I was able to navigate code, write it, change it. I now see it differently.
To the outside (other people), it looks like I can do those things really fast. Internally, though, doing those things fast allows me to think slowly. Because of the muscle memory built after practicing all those shortcuts, I spent less time figuring what and how I’ll do something, and spend more time thinking why I’m doing it.
In the same vein of giving the brain some room to think, I often take the time to do things the slow way; for example, I may go the command line and type a command character by character, instead of recalling and changing a previous command, or using an alias of some sort. I fall back to this approach when I feel I’m either rushing or unsure as to whether I’m going in the right direction (“If we are facing in the right direction, all we have to do is keep on walking.”).
Summing it up…
Does your job title define you? Your role? Soon after I moved to the US many years ago, I’ve noticed this thing Americans do that seemed different to me: meeting people for the first time, even at a non-work related place or activity, people would ask me “what do you do?”.
I got used to it and never thought much about it again. Until I ran into this video:
That American youtubber loves Brazil, its culture and its people. In his point #9 on that video, “You’re not your work”, he made me think about the “what do you do?” question again. When asked, I used to think to myself: “well, I do a lot of things… what exactly does this person want to know?”.
“What do you do for a living?” would be a more specific question. But that’s where the main difference lies: Brazilians, as pointed out by Tim, don’t define themselves by their job title.
I’m one of those fortunate people who do love their jobs, but I certainly don’t let my job title define myself. Doing so would be very limiting, I believe.
When people ask me that question nowadays, I tend to immediately break the ice by saying something like “well, it depends on the time of the day, or to whom you ask!”. Such response allows the conversation to go many different routes, opening up exploration paths that could lead to the creation of a better connection between the other person and me.
So, what defines you?
A month ago I’ve mentioned that Improv Techiniques come in handy. Here are two recent cases where I’ve used it.
Getting to know new team members
Last month, I stepped in as the temporary scrum master for my team. The team had three new members, so I figured I’d try a warm-up I learned at the Improv workshop to help the team members get to know each other a little more as we started our Sprint Retro.
The warm-up consisted of the team sitting in a circle. I started by saying my name and a couple of things I’m passionate about. The activity continued on with every person doing the same. Once we went around the circle, I asked a random person to choose from a number between 1 and X (“X” being the number of people in the circle). Then I asked another random person to choose left or right. I finally asked everyone to stand up and move the chosen number of seats in the chosen direction.
Next, I say my name and things I’m passionate about, except that I’m impersonating the person who was seated in that spot before. The group quickly understands what’s going on, and we go through the circle like that.
In this activity, it’s very likely some people will realize they have no recollection of what the previous person seated on that spot said. It’s a good and fun way to learn how to pay more attention to others.
Listening everyone to the last word
Last week, I’ve started an 8-week Improv class, learned another warm-up techinique, and once again, brought it to our sprint retro, spending about 5-7 minutes on the activity.
In this warm-up, the team stands in a circle. We go around the circle, each person saying one word. The words don’t have to be associated, but we do observe the following behaviors:
- Some people end up getting biased by the word they have just heard from the previous person;
- Some people end up spending a lot of time thinking up of a word. Why is that? Maybe trying to come up with a “smart” or “funny” word?
Next, we do the same activity, but this time, we say associated words.
We then move on the the final activity: making up a sentence, one word at a time. One person says a word to start the sentence, then each person in the sequence says a word to contribute to the sentence. When a person in the circle feels like we have a sentence, she can end it by saying “alright, alright, alright”. At that point, the whole circle joins in and says the entire sentence out loud. The person who decided to close the sentence then says a new word, starting a new sentence.
This last warm-up is great because, besides being fun and lifting up the mood, it helps learn to:
- Listen to every word said, all the way to the very last one. You can’t make up your mind after listening to the first word and blanking out on everybody until it’s your turn, as the other people in the chain may change the direction of the sentence completely with their associations and interpretations;
- Work together as an ensemble, creating something as a group, building it by adding to each other’s ideas.
The experiment continues
I have another 7 weeks of Improv classes and I intend on trying our more of those techniques in my daily life. I’ll keep you posted!
Registration for the Houston Agile Shift 2020 is now open!
After its successful debut in 2019, the conference is back in 2020, bigger and better. I enjoyed presenting there last year, had great interactions with the attendees, and stayed in touch with them even months after the conference was over.
This year I’ll be even more involved with the conference and can’t wait to see attendees learning and networking, speakers sharing their experiences, and a vibrant community coming together!
If you’d like to speak, the Call for Speakers is open for only a short period of time, so hurry up and submit your session proposals.
If you’d like to be a sponsor, this is also a good time to reach out.
If you’d like to attend, grab your tickets!
The February Improving Code User Group meetup has been announced. Here’s the main presentation info:
Tailor your Swift
We’ll discuss writing cleaner, better code in Apple’s new language, but this talk will be mostly language agnostic and discuss concepts that apply to all languages.
This talk is for all programmers. It is about 98% language agnostic, with Swift used as the language example because I primarily work in Swift, therefore any developer will understand the material and concepts presented.
Presenter: Mark Wilkinson
Hello fellow coders! I am someone who stumbled into software development and realized I loved it. I continually strive to improve the code others, including myself, will have to read one day, and that’s what is at the heart of my talks.
Please follow the link below for extra information. I hope to see you there!