this post was submitted on 09 May 2024
445 points (92.2% liked)

Programmer Humor

32558 readers
375 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] dariusj18@lemmy.world 20 points 6 months ago (3 children)

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

[โ€“] victorz@lemmy.world 8 points 6 months ago (1 children)

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.

[โ€“] Feathercrown@lemmy.world 1 points 6 months ago* (last edited 6 months ago)

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

[โ€“] zea_64@lemmy.blahaj.zone 2 points 6 months 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.