mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

#refactor

0 posts0 participants0 posts today

Level up your refactoring with these 9 articles!

Refactoring is a critical skill in software engineering. Here are some articles to help you level up:
devleader.ca/category/software

Refactoring Techniques:
devleader.ca/2023/11/14/top-10

Remove Control Flags:
devleader.ca/2023/11/19/remove

What & Why For Refactoring:
devleader.ca/2023/11/21/what-i

When to Refactor:
devleader.ca/2023/11/24/when-t
devleader.ca/2023/12/27/when-s

Rewrite vs Refactor:
devleader.ca/2023/11/26/rewrit

Legacy Code:
devleader.ca/2023/11/27/refact

What is Refactoring:
devleader.ca/2023/11/28/what-d

Simplified Refactoring:
devleader.ca/2023/12/04/how-to

Testing With Legacy Code:
devleader.ca/2023/12/20/dealin

I'm also happy to announce that I have an awesome course on all things refactoring, which you can check out here:
dometrain.com/course/from-zero

You'll learn a host of refactoring techniques with real code examples to walk through. Understand how to approach refactoring and when you may want to consider a rewrite!

----
📨 Sign up for my email newsletter!
🗣️ Share with your network!

I refactored the [[Bookcase]] in my wiki … it might be a good topic for a video tutorial someday.

Instead of loading in different stored lists as a way of filtering the content, I now have one list that is filtered dynamically that both list (text) views and cover (image) views adhere to, making for neat on-the-fly re-arranging of the same list, and much more optimized.

gavart.ist/#Bookcase

gavart.istgavart.istGavin Gamboa 🌱 digital garden  work repository  🗂  personal wiki
Continued thread

more ughhhh. been trying to #refactor the code which renders all this stuff for *ages*

i want it as free-standing single-purpose functions, so i can test each one of them more easily

however, i keep running into my reluctance to write code of the sort:

```
fn foo <'a, A, B, C, D> (a: A, b: B, c: C, d: D) -> impl Content + use<'a, A, B, C, D> where A: impl Content, B: impl (Fn()->A) + Send + Sync, C: impl Content, D: impl (Fn()->C)+Send+Sync { ...```

This might be the most obvious of #linktuesday links in ages, but really, I've recently been helped a lot by #rector. So yes, I'm sharing Rector today: getrector.com

If you have not worked with it before, it may seem intimidating, but take some time to get used to it, because it can really make your life a lot easier, especially when working with #legacy code

getrector.comWe'll Speed Up Your Development Process by 300% | Rector - Automated Way to Instantly Upgrade and Refactor any PHP codeRector - Automated Way to Instantly Upgrade and Refactor any PHP code

Because I am

- #agile -y only writing #code that I need immediately
- writing research #software where I don't really know what I want until I see it running
- dumb

I often find I get 90% of the way to somewhere useful and realize I need to #refactor large swaths to get the last 10%.

I missed an abstraction layer. Or rather, I deliberately omitted it because I was "more like DISTRACTION LAYER" at the time. But now I need that layer.

It seems overwhelming, but I have a major #engineer #mentalhealth tool: #git

If it turns into a tar pit, I can just revert.

Tonight's dev log update for Rack Root

I finally finished my refactor from sqlalchemy with sqlite over to SQLModel with PostgreSQL and refactored much of my code. I had a mixture of snake_cake and camelCase which has since been fixed to be all camelCase.

I adjusted many of my imports, classes, database tables, database foreign key relationships, and testing to fit the new design. I also had to adjust some of my tests because my IDs were off by one.

This database focused refactor also gave me all the structure and space I needed to build out the basic IPAM features. When a new network is added, all the associated IP records are created, and marked as 'Available'. If a gateway is set, that gets changed to 'Gateway' and when I implement DHCP ranges, that will be set to 'DHCP'.

I still have some things to do such as make sure the IP records cascade delete when a network is deleted, and fun stuff like that.

Now that the backend is (re)designed, I can get back to the front end side of things.

If you're curious to check out my code for this refactor, it's all up on my GitHub here:

github.com/alongchamps/rack-ro

Refactored the database layer, added IPAM features
GitHubMerge pull request #1 from alongchamps/testing-sqlmodel · alongchamps/rack-root@0fc99dfRefactored the database layer, added IPAM features
Continued thread

TDD is a great _technique_ for guiding you and helping you discover unclear code or designs that could be improved, but you, the developer, have to not only pay attention, you also have to know how to #Refactor and know what better design is so you can refactor in that direction.

last 2-3 weeks, besides a bunch of mostly aimless traveling, were dedicated to this insane 70+-#commit #refactor on the #rust #tui #daw, bouncing between 5 and 512 compile errors...

and i'm still not happy with the code quality... but let's say i've massaged the code around enough, and collected the not-yet-clarified bits in several places rather than all over the place...

my favorite language feature that neither #rustlang nor #ecmascript has? #mixins. there, i said it 😔

Continued thread

... with the codebase, can become quite complex, and therefore must be easy to understand and #refactor when needed. Too many companies try to stick with YAML pipelines, working around limitations by cramming PowerShell or Bash scripts alongside the YAML files—even though there are much better alternatives. This doesn't even take into account the potential need to migrate from one build engine to another, such as moving from Azure DevOps Pipeline to #GitHubActions, or, for a...