Follow

Programming is great because you can just take that huge messy chuck from the middle of your function and hide it away under a new name in a new function and feel good about how you "cleaned up" the original function by abstracting the internals.

This is exactly how I used to clean my room as a kid - I'd refactor all the junk on the floor to be under my bed. Boom - problem solved.

Ok, let's be honest.. that's still how I clean my room.

@bigzaphod Wait … is that not how it is to be done as an adult?! 😬

@bigzaphod Once seem an undergrad have every single expression as a separate function... I imagine it’s what Perl is supposed to look like but this was Java 101...

@bigzaphod i'll take "what is a module boundary" and "what are contracts" each for $5,000, Alex

@bigzaphod this practice shall now be called "sweeping it under the rug". Lol

@bigzaphod its even better you can put it away in a whole different file

if its really bad you can make it into a *module* and publish it and never have to look inside ever again

its great i can never think about all the horrid things i've done out of laziness or spite

@bigzaphod But what did you do if your initial ranges failed to match the floor junk ranges? 🤔 mastodon.social/media/zjqQa4xv

@bigzaphod "yeah, yeah ... I found a new object I hadn't considered before..." 😂

@bigzaphod I've started using code regions instead to remind myself that it's still a mess, and only create separate private methods when I need to reuse code. That's helped keep things actually clean.

@bigzaphod well, that works only so long as you have room under the bed (unless you happen to be hiding a TARDIS under there). :)

Sign in to participate in the conversation
Mastodon

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!