Code Reviews have a bad reputation. It seems easy to do them poorly, to create friction, to hurt people, and to waste both time and energy doing them. For this reason, I developed a simple serious game: “What’s Not To Like About This Code?” I’m going to practise criticizing code in public. I’ve decided to do this for two key reasons: It might help readers by making concrete some of the abstract-sounding advice that I provide. It might increase the amount of civility in code criticis...| The Code Whisperer
A mentoring client of mine said this recently: I took ownership of some strategically pivotal code and did precisely that, typically refactoring twice a week for about 18 months (my delivery was unaffected). The refactorings took at most half an hour. Last week I got reprimanded. I’ve read the room and stopped. Someone asked why someone reprimanded them, from which came this reply: I should be refactoring under an initiative, the colleague felt. I said I was refactoring to the Four Rules of...| The Code Whisperer
What is refactoring? You’d think that, in 2022, we’d have long settled this question already. Yes and no. A Problem I routinely encounter programmers who struggle with refactoring because they become stuck on this central question: I’m making these kinds of code changes (describes example)… am I refactoring? They might arrive at this central question because some well-meaning person has looked at what they’re doing and exclaimed, “That’s not refactoring!” To someone trying har...| The Code Whisperer
Someone is circulating a talk—a concise one, which I appreciate—entitled “Refactoring is a code-smell” (sic). Before I continue, let me make a few things clear: I do not wish to shame nor criticize the speaker. Their talk triggered this article, but… I have not seen the talk; I’ve only been given one viewer’s impression it and… I am not trying to rebut/refute this talk, but rather I want to say a few things about the claim as I understand it. Please take a moment before you co...| The Code Whisperer
I think a lot of people fall off the TDD wagon because of this exact thing—they learn TDD by working on new code and then can’t seem to apply it to their existing work projects. And then they give up, naturally! When this happens, I help the person focus on the difference between “test-first” and “test-driven”. I hope that this offers them more-realistic expectations regarding the outcome. With test-first, we focus on correct behavior and fix defects. Usually, but not always, when...| The Code Whisperer
Too many people are writing too many articles trying to direct others’ thinking on their own testing strategies. I am guilty of this and would like to contribute to reversing this trend. Instead: test until fear is transformed into boredom (Phlip Plumlee) if you don’t like something about the test, then try interpreting that as a sign of a design problem—usually an unhealthy dependency in the production code (The “driven” in test-driven development) faster-running tests tend to prov...| The Code Whisperer
I noticed that Ron Jeffries had written about a kata I hadn’t tried before, so I decided to try it. The exercise involves evaluating a polynomial of one variable at a single point. For example: 5x3 + 4x2 + 19x + 3 at the point x = 5 evaluates to 823. Check my arithmetic if you like. How does one write this incrementally and test-first? First things first: if you’ve never tried it, and especially if you’re new to test-first programming, then try it yourself. Take small steps and never wr...| The Code Whisperer
In my evolutionary design practice, I consider removing duplication one of the three fundamental moves.1 Accordingly, I practise this move daily and trust it as a primary tactic for understanding the needs of the design. I would like to share a little example with you. We encountered this example during a session of Evolutionary Design Without* Tests. We’re adding a feature to the Point of Sale system: adding provincial sales tax to each item as the shopper purchases it. The system already ...| The Code Whisperer
I recently started a new project and used this as an opportunity to learn and practise a few things, among which we find 11ty, a static site generator. I fancy myself a static site generator hipster—I did it before people called it “JAMstack” and made it cool—first with Octopress, then with Jekyll. Indeed, I’ve built my other sites with Jekyll and even built the occasional plug-in, taking advantage of my experience working in Ruby. In spite of my successes with Jekyll, I became espe...| The Code Whisperer
Refactoring, the activity, involves the following things. improving the design of existing code … in a sequence of small transformations … that preserve the important behavior of the system … which you can complete relatively quickly … and which gives you inexpensive options to change direction. Effective refactoring combines the value of Real Options thinking with the care and attention of engineering. It reduces volatility in the marginal cost of adding features. It reduces the over...| The Code Whisperer
How do object hierarchies evolve? Many programmers struggle with this question. Mostly, they want to know how object hierarchies can evolve safely and sensibly! They have a picture in their mind that TDD is only safe in the hands of programmers with excellent design sense, but I believe that anyone can learn these skills with a combination of simple guidelines and guided practice. It would be nice to have more examples. I have stumbled upon one that I’d like to share with you. I’m refacto...| The Code Whisperer
The bottom line: Modularity. Details. Pick one. I often spend time with programmers who don’t like small methods and small classes, in spite of all the benefits of small methods and small classes: easier to test easier to read, quicker to skim costs less to understand, less to understand at once easier to build correctly, quicker to build easier to compose into working systems These programmers range from feeling vaguely uncomfortable to showing strong and open antipathy towards small metho...| The Code Whisperer
Errors in Go are like the STOP sign. They send a strong signal to avoid disasters. Just like the Go error yelling don’t trust returned value, don’t use it.| Jakub Jarosz
Refactor for success! Learn why continuous codebase cleanup is a necessity and how to onboard your team with these tips. Keep code fresh and organised.| CodeSmash
"I have two news for you, bad and worse," said the mechanic. "The battery is dead and I won't get a new one until Monday. Forget about your annual inspection today," he continued. "But..." you started. "There is no but." he cut short. No setup, no testing. Just like in your Go program.| Jakub Jarosz
An Intellyx Brain Candy Brief Via its open-source project OpenRewrite, Moderne offers automated code refactoring and analysis across teams, applications, and languages, helping to resolve code quality issues and migrate and upgrade older frameworks and libraries. While OpenRewrite offers refactoring for smaller codebases, Moderne’s commercial offering provides adequate scalability and support for multiple Git repos […]| Intellyx – The Digital Transformation Experts – Analysts
The surgical breakdown of a 1.6k LOC Ruby monolith into focused modules. Or: how I performed open-heart surgery on a dying codebase and lived to tell the tale.| Seuros Blog
We’re taught to eliminate duplication at all costs. But the wrong abstraction is far more expensive than a little copy-paste. Here’s why.| Terrible Software
Explore refactoring Rails transaction blocks with the endless method. Pros and cons, examples from Maybe and Mastodon, and community feedback| All about coding
I really liked a “Long Term Refactors” by Max Chernyak explaining a nice development practice. I was reminded of a thing that surprised me about refactors and dependency management.| Push.cx
Infrastructure as Code (IaC) tools such as Pulumi can provide enormous amounts of leverage, but they must be used correctly to also provide safety. One of our main jobs as infrastructure engineers is to not break things, so leverage without safety is useless. If something is safe, we can change things easily without even thinking about it. If it isn’t, we’ll be up until 2 a.m. fixing what we broke. At Oso, we recently had to do a large infrastructure migration and learned three key princi...| Pulumi Blog
In Go, we build packages - fundamental Lego-like blocks that we assemble in modules and use to build applications. That's why it's crucial we start designing packages by modelling their public APIs. Let's roll up our sleeves, sharpen the scalpel and start the second code surgery. This time, we focus on tests.| Jakub Jarosz
Identifying and avoiding bad coding practices, and refactoring them into clean, elegant, self-explanatory code| iO tech_hub
This is an update on the latest improvements for nocodefunctions.com, with a short video demo! The demo This video showcases a number of new features detailed below: 1. Handling first names better When crawling news sites like lemonde.fr, you can end up with nodes like “Emmanuel” or “Anne” popping up in the resulting network. Not because two people with those names were making headlines, but because many different people named Emmanuel or Anne were mentioned but completely unrelated. ...| nocodefunctions.com
This week we do small refactoring to illustrate how we can improve code readability and reduce cognitive load.| Jakub Jarosz
Using Model-Driven Design to keep your code constantly aligned with the constantly evolving business constraints. Our chat with Bruno Boucard and Kenny Baas-Schwegler.| Avanscoperta Blog
Introduction| bitcrowd blog Blog
MP 132: It's a simple built-in function, but using it isn't as straightforward as it might seem. A task that's come up repeatedly in my programming work involves looking through a collection of values, and taking an action if a specific item appears anywhere in that collection. There's a way| Mostly Python
Controllers can get out of control. Their job should generally be quite simple. In an MVC framework such as Rails, they should have the job of knowing how to work with the Model in order to get what is needed for the View. In other words, they…| Leigh Halliday's RSS Feed
No, tests aren't supposed to make refactoring _easier_; they make refactoring **safer**. Sometimes, by accident, they do both.| blog.thecodewhisperer.com
This is RonJeffries.com, the combination of new articles, XProgramming, SameElephant, and perhaps even some new items never before contemplated. Copyright © 1998-forever Ronald E Jeffries| ronjeffries.com
A brief look at the history behind the opposing styles of quick-return and single-return in functions.| blog.benwinding
TDD is for those who don't know how to design software, which doesn't have to mean that we're all dopes who are doomed to perpetual failure. Let's explore th...| blog.thecodewhisperer.com
A guard clause might be an embryonic parser, so what happens if you nudge it in that direction?| blog.thecodewhisperer.com
When you notice that you need| blog.thecodewhisperer.com
Let's look at a simple example of a name. Let's judge the name (kindly!), then imagine some likely next steps in refactoring. We can learn and do quite a lot...| blog.thecodewhisperer.com
The stronger your refactoring skill, the more easily you can use architecture advice as guidelines instead of as rules to enforce. This makes it significantl...| blog.thecodewhisperer.com
Just another little example of two people looking at a situation, one seeing a problem and the other seeing a solution.| blog.thecodewhisperer.com
Technical blog of Microsoft certified developer James Hickey. Helping you reach the next step of your career as a software developer!| blog.jamesmichaelhickey.com
Technical blog of Microsoft certified developer James Hickey. Helping you reach the next step of your career as a software developer!| blog.jamesmichaelhickey.com
Technical blog of Microsoft certified developer James Hickey. Helping you reach the next step of your career as a software developer!| blog.jamesmichaelhickey.com
Technical blog of Microsoft certified developer James Hickey. Helping you reach the next step of your career as a software developer!| blog.jamesmichaelhickey.com
Recently, my team and I were tasked with the holy grail of assignments--a greenfield project. We were writing brand new code in a brand new app to meet brand new requirements. Like many developers, we jumped at this chance to design our own codebase and solve a new set of| The Great Code Adventure