Code smells.
— Martin Fowler
Code smells.
— Martin Fowler
Master thesis by Hendy Liang: "Property-Based ASTs: Enabling Language Parametricity in Refactoring Tools"
"By leveraging Tree-Sitter, a parser generator that creates parsers that produce generic, property-based ASTs, this research adapts Renaissance, an existing industrial refactoring tool, to support multi-language extensibility with minimal additional effort."
https://repository.tudelft.nl/record/uuid:6e143a35-32b8-4f7e-928e-52057ea57566
Je suis un développeur logiciel expérimenté (20+ :) indépendant, mentor et coach, je serai disponible en février.
Si vous cherchez un coup de main pour dompter une base de code sauvage, préparer une grosse évolution ou plus généralement développer un logiciel maintenable, c'est le bon moment :)
J'interviens principalement de deux façons:
* intégré à l'équipe, je fais le taf avec vous en pair programming
* et/ou en accompagnement, je vous guide dans vos réflexions et l'implémentation (qq heures/semaine)
* tous langages/technos/environnements
* remote only ou Ambert
* déplacement ponctuel ok
* freelance
Don't comment bad code rewrite it.
— P. J. Plaugher, Brian W. Kernighan
I was going gung-ho on this #software project and then realized I needed to insert a layer of abstraction. I'm now on the second full day of #refactoring and each thing I touch makes me think of 3 other things.
I don't regret it--I'm already better off--but, UGH. When can I push forward again?!
Now featuring a couple of valuable comments by @timotheegoguely and @cwilcox808: https://css-tricks.com/come-to-the-light-dark-side/#comment-1880711
The thread that lead to the comments starts here: https://c.im/@cwilcox808/113369368407766000
Note some interesting conversation about whether radio buttons or select elements should be able to trigger the mode change without hitting a submit button. These things aren't always clear cut, and I'd welcome thoughts on it!
« Pourquoi faire un #refactoring de #NuxtJS vers #HTMX ? » https://notes.sklein.xyz/2024-10-11_1531/zen/
In other #ThingUmbrella related news: I've completed the weekend round — 65+ commits — of restructuring & splitting up some larger packages, with the result of there being nine more of them now. 198 in total! Another side effect of this effort is generally fewer dependencies, incl. for some select other core packages (partially by choosing to intern small functions/functionality, in cases where it made sense...)
The new packages (but existing functionality!) are:
- https://thi.ng/bidir-index : Bi-directional map/index data structure
- https://thi.ng/disjoint-set: Disjoint Set data structure w/ path compression (useful for union-find tasks)
- https://thi.ng/object-utils : Plain JS object & map manipulation
- https://thi.ng/pixel-convolve: Extensible image convolution, preset kernels, normal map generation
- https://thi.ng/pixel-dominant-colors: k-means based dominant color extraction from images
- https://thi.ng/sorted-map: Skiplist-based sorted map & set data structures
- https://thi.ng/sparse-set : Sparse set data structure
- https://thi.ng/trie : Trie-based map data structure w/ prefix search/query
- https://thi.ng/uuid : Binary & string-based UUID v4 generation
The packages which have been split up have received major version updates w/ notices on both readmes & changelogs:
- https://thi.ng/adjacency
- https://thi.ng/associative
- https://thi.ng/pixel
- https://thi.ng/random
In case you missed it, please see this issue for more context:
What has Color ever done for us? - Inkscape Developer Update, Dec 9th 2023
https://friprogramvarusyndikatet.tv/w/3jqZKSJEh1Q1LViojoEnxs
https://github.com/CleanCocoa/DeclarativeTextKit/pull/10
I changed the way a "word range" is detected to be, hopefully!, more readable.
#Refactoring weird code is always an adventure: commit by commit I'm making progress, not knowing what the actual end result will look like. When tests break, revert one step, or at least use the debugger to understand the failure better and maybe fix the faulty logic.
I didn't anticipate that the change would look like *this*.
But it's better than what was there before.
Line must go down! Maintenance weeks are over![1]
Software maintenance, large scale refactoring, creating/improving documentation, deduplicating code are some the most boring & thankless tasks, but also so essential, especially on projects of the scale of https://thi.ng/umbrella (with almost 4100 source files)
Yesterday was #ReleaseFriday, most prominently featuring new major version & expansion of https://thi.ng/geom (and its 20+ support packages) — I will write about it more in coming days.
Part of this major release cycle also included a repo-wide round of various cleanups, incl. updating & reviewing 425 code snippets in doc strings and preparing them for extraction[2], fixing links in docs, enforcing naming conventions for package internals across all 190+ packages, deduplicating and refactoring internals in dozens of projects, updating examples, building tools to generate diagrams for readmes etc.
These have been some intense few weeks, but I'm super glad it's all done (for now)!
Happy coding! :)
[1] The hours of tech debt auto-calculated in this diagram are a bit pointless (completely OTT and containing alot of false positives), but the graph still nicely shows the effort & progress involved... Btw. the chart is from here:
https://codeclimate.com/github/thi-ng/umbrella
[2] Wherever possible, code examples/snippets in project readme's and docstrings embedded in source code can be extracted into their own source files via https://thi.ng/tangle and then run directly (e.g. via https://bun.sh). You can find more info in this section of the main readme:
https://www.darrenmcleod.com/2024/06/tomethodobject-refactoring.html Refactor for Testability. Inspired by @kentbeck I advocate we make the test easy to write and then write the easy test!
#Refactoring #TDD #softwaredevelopment #visualstudio #LegacyCode
Since today is the 20th anniversary of my first blog post, I'm going to embarrass myself by re-publishing it:
Big Refactorings
When attempting a pervasive refactoring in a large system, it's tempting to do the full refactoring in a localized part of the system and leave other parts for another day - perhaps because you run out of time or get bored. You can assuage your conscience by marking the remaining places with todo comments or deprecating old methods.
1/5
#Refactoring tip:
See two hunks of code that look similar?
First, make them identical.
Like @jaredwhite I saw this these ads for Copilot all over Github the other day. "code 55% faster with copilot" https://indieweb.social/@jaredwhite/111207496353593956
What if I spend 90% of my time refactoring? A LLM is not a refactoring tool! That's the topic of my latest youtube video: https://youtu.be/iXGBIX8gudE
Do you agree?
Found this on my hard drive. I think it is from a presentation from @mfowler
from many years back.
The things on the left are bad refactoring. incentives.
Want a nice _and_ reliable #calendar application for #GNOME and #Linux desktops (& #mobile!) in general, based on the @EvolutionGnome data server?
Know some #C #programming and looking for a well-scoped challenge to get your feet wet and put those skills to use in #opensource?
#GNOMECalendar could really use your help to write unit tests, so that we can use #TestDrivenDevelopment #TDD #CI for #refactoring all timezones-related code and make it reliable. Now is the time!
https://fortintam.com/blog/call-for-help-writing-gnome-calendar-compliance-unit-tests/
I need to unify all of these so they can collaborate, plus all the orbit movers and ECS following. :(
Alt text for the image has 1337 characters, that's a good omen! #gamdev #refactoring
Adding past work to a project's Open Collective page as Invoices, even though they won't ever be paid, just to show that past work did actually get completed. I'm wondering how much you would realistically charge for a year-long refactoring/restructuring project of a large multi-repo project/suite?
#opencollective #refactoring #consulting
I'll start... In a previous life I was maintaining a tool in which massive analyses of machine code sequences were being calculated, and then subtly (albeit correctly) ignored. This pointless calculation comprised approximately 90-95% of the tool's runtime, on average. One line change, and led to an excellent postmortem.