Speed Read Code Like a Pro: Developer Training AI-style | Long Method

preview_player
Показать описание
If you read code faster, you can get started working on it sooner, or provide feedback to the author sooner. In a previous video I showed Llewellyn Falco's original Sparrow Deck. In this video we’re going to look at a similar training deck, but this time with code not birds. The idea is that it will help you to subconsciously identify code smells using your brain's visual pattern recognition so you can learn to read code faster.

Contribution: Llewellyn Falco

▬ Links ▬▬▬▬▬▬▬▬▬▬

Llewellyn Falco explaining and demonstrating Sparrow Deck at Agile Latvia Developer Conference ➡️


Emily on social media

▬ Video chapters ▬▬▬▬▬▬▬▬▬▬
00:00 - Introduction
01:02 - Long method & Code Smells
01:41 - Martin Fowler's definition of Code Smell
05:11 - Instructions Code Reading Exercise
03:42 - Exercise: Long or Short?
07:34 - Closing words
Рекомендации по теме
Комментарии
Автор

In the late 80's, long before modern code comprehension tools were available, one of the silliest (and helpful) tools we had was to view the code in 2-point font. It was, of course, too small to read, but because we could see indention structure, and some basic color coding, we could understand the structure of a file back when 100-line functions and 2, 000-line files were not (yet) considered harmful.

MichaelRWolf
Автор

I've absolutely had the experience you describe of being able to see some code smells just from the "visual shape" of the code. A visual sign I notice right away is a "jagged" indentation style, which, in my experience, indicates excessively complicated nested ifs and/or deeply nested logic that should be extracted into separate functions and sometimes both.

dalehagglund
Автор

Love this exercise, Emily.
As we discussed in the other video, this would be a great way to develop a sense of detecting code smells for developers!

It also reminds me of J. B. Rainsberger game of "what not to like about this code?" where you pull up some code and let everyone express how they feel about it. People who have more "code smell" vocabulary tend to express more issues, in my experience. Pretty much like what you showed here with the Gilded Rose example.

Have you planned to cover other smells with this technique? Would you need help doing so?

nicolascarlo
Автор

Is the part of your brain the works like an AI also called AI? As in Actual Intelligence? 😂

LouisDuran
Автор

LOL! That was so silly! Usually on a real project we don't read the code to spot bad patterns of inexperienced developers. We read code to understand how the software works so we can upgrade it with new functionality or fix bugs.

I worked on some of the largest projects in the world and I saw horrendous code written by now senior developers/managers long time ago. If I would start fixing "their" code I might even get into trouble because they want new functionality and not fixing something that works... The real life of programmer is full of office politics...

tongobong