453
got him (lemy.lol)
submitted 1 month ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 20 points 1 month ago

The number one thing that gets in my way of refactoring to function is figuring out what to name the functions takes too long.

[-] [email protected] 8 points 1 month ago

Then perhaps the code you are trying to extract doesn't make a clear and cohesive procedure. Maybe include more or less of the code, or rework the code into logical pieces or steps. Write the algorithm in human language first, then implement the steps using functions.

🤷‍♂️ Or fnck it.

[-] [email protected] 1 points 1 month ago* (last edited 1 month ago)

Sometimea the smallest logical unit of an algorithm uses more than 3 levels of indentation

[-] [email protected] 2 points 1 month ago

Pick something and change it when inspiration strikes. Sometimes you need a big picture view of something to get the right abstractions or even just name things.

this post was submitted on 09 May 2024
453 points (92.3% liked)

Programmer Humor

31214 readers
269 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS