masto.es es uno de los varios servidores independientes de Mastodon que puedes usar para participar en el fediverso.
Bienvenidos a masto.es, el mayor servidor de Mastodon para hispanohablantes de temática general. Registros limitados actualmente a invitaciones.

Administrado por:

Estadísticas del servidor:

1,9 K
usuarios activos

#refactoring

1 publicación1 participante0 publicaciones hoy
Continuó el hilo

It's going well so far:

*!git log --oneline | cut -d' ' -f2- | tac
Starting point
Simplify for loop
Invert the first if
Split first if
Invert if on sulfuras
Permute ifs for sulfuras
Join first 'if else's

I think I can now say it's totally doable and even worth repeating this kata a few times.

Continuó el hilo

Example of scope, I currently want to invert the condition on the name here:

*34,40n
34 } else {
35 if (item.quality > 0) {
36 if (!item.name.equals("Sulfuras, Hand of Ragnaros")) {
37 item.quality = item.quality - 1;
38 }
39 }
40 }

This is fine if I do one thing at a time.

Also: ed edits could be a great format for #refactoring toots 🤔

Totally random thought: would I be able to do the Gilded Rose kata using only the ed text editor in a reasonable time?

Goals:
1) have fun,
2) look like a fool,
3) learn enough ed to later be able to script complex text changes across files,
4) also level up in sed and vim

Reason: ed(1) is the standard Unix text editor.

Well, another one bites the dust... Code Climate is shutting down and their new replacement service (only upgrade option) with the fascinating strapline "Code With Vibes, Merge With Confidence" does inspire anything but... 🙄

(Been using CC for years and even though it produced a lot of false positives, it generally was a very useful tool which sent me off on several major refactoring journeys over the years, from which not only I benefited as a maintainer, but all users of my libraries/tools did too... c'est la vie...)

#python #programming #refactoring

Reached the point where — after days of work — unit tests break again. In the same place as they did before the big rewrite.

(Checks notes)

Oh! Now the underlying data structures aren’t a horrible mess and I can actually apply the fix that all those rewrites enabled. I think.

Nested contexts of todo-lists are hard.

Continuó el hilo

The result of the #analysis was a an in-depth report explaining possible pitfalls in my code base including recommendations to fix them.

Finding them manually would have taken me days. This way, I was able to cut down the time for #refactoring and fixing most issues to hours.