photog.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for your photos and banter. Photog first is our motto Please refer to the site rules before posting.

Administered by:

Server stats:

250
active users

#refactoring

0 posts0 participants0 posts today

#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.

What is refactoring, why is it important and how can you get really good at it? In this Making Tech Better podcast episode, I spoke to @emilybache about enhancing the skills and culture of your teams, to make your code easier to understand and cheaper to modify.

You can listen here (subtitles on screen): youtu.be/ZcEz8cA017M?si=tYhdCb

In recent years every spring seems to turn into a period of _massive_ refactoring & restructuring in #ThingUmbrella — maybe it's a form of spring cleaning, even though the reasons[1] are not seasonal... Currently spending my nights reworking the thi.ng/vectors package (likely one of the most comprehensive vector packages available for TS/JS) and trying out different splits/structures, testing their impact on package sizes and usability in existing downstream packages. Currently over 3000 source files with uncommitted changes... aaaarrrgghh! 🤯

Most functions (vector operations) in this package exist in multiple versions (many code generated, but now in need to be updated): Generic n-dimensional, loop-free, optimized 2D/3D/4D versions and strided versions for manipulating vectors views of larger nD data buffers (supporting all kinds of data layouts, incl. AOS, SOA, hybrid...)

[1] mastodon.thi.ng/@toxi/11429644

thi.ng/vectorsOptimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts

One thing for my job I’m looking forward to about #AI: Refactoring large systems

Doing a refactoring that involves hundreds of classes and multiple changes of infrastructure has been a thing that can take weeks, even months.

However, if you have good test coverage, you can let an LLM can do the drudge work for you and just verify it did what it said it did.

TTD is a must anyway, if you use LLM’s for helping you werite code.
#programming #refactoring #unittests