#code-refactoring
Explore tagged Tumblr posts
spindlecrank · 1 year ago
Text
Building Resilient Applications: Python Error Handling Strategies
Python error handling is crucial for building robust and user-friendly applications. This guide details various techniques, starting from basic try...except blocks to advanced methods like exception chaining and custom exceptions. Proper error handling
From “Oops” to “Oh Yeah!”: Building Resilient, User-Friendly Python Code Errors are inevitable in any programming language, and Python is no exception. However, mastering how to anticipate, manage, and recover from these errors gracefully is what distinguishes a robust application from one that crashes unexpectedly. In this comprehensive guide, we’ll journey through the levels of error handling…
Tumblr media
View On WordPress
0 notes
orthogonal-slut · 4 months ago
Text
refactoring your own code is so embarrassing. who would ever write this trash pile of - oh...
31 notes · View notes
frog707 · 22 days ago
Text
Slimming down
Like all software metrics, "lines of code" shouldn't be applied blindly.
Today my software WIP's LoC metric is rapidly declining because I've created C++ macros to generate boilerplate code. I'm talking code I used to copy and paste every time I needed it.
This is the kind of refactoring I love, because it means less code to maintain in the future. Fewer chances for coding errors. Less scrolling through source code to find the interesting parts.
And in this case, I believe it also uncovered (and solved) a bug. So a big win all around.
But from a strict "lines of code" perspective, this would be considered a step backward.
4 notes · View notes
akyrahaiato · 1 month ago
Text
If I could go back in time,
I would have used a state machine.
4 notes · View notes
compnion · 2 months ago
Text
i dont want this bootcamp to turn me into a misandrist but being the smartest girl is truly worth dirt because almost EVERY man there thinks he’s fucking better than me i am SO exhausted
3 notes · View notes
turnedpalefromlackofsun · 4 months ago
Text
i found a guide on how to find a girlfriend as a lesbian in tech and it says to join as many open source projects as possible
do people actually talk when doing open source work? dont people just argue in the pull requests? ive never seen a single sentence without an insult or a slur in it in the discussions
or just a passive aggressive "RESOLVED" every time someone comments anything and without a link to the fix
"consider platforms such as github and stackoverflow" HELP ME
im losing it
is this serious? unironically? NO!!!!
4 notes · View notes
kaiserouo · 1 year ago
Text
Tumblr media Tumblr media
Sick of setting up the scene, adjust all settings, and render 8 images individually by hand for every character i want reference for
Spend >2 hours coding the functionality to do the whole procedure in like 5 clicks
Spend more time just to code something that saves time? Sure why not.
14 notes · View notes
la-principessa-nuova · 7 months ago
Text
ewww… i just got a notification that the new product owner on my old team updated a user story i wrote like 3-4 years ago and used AI to generate acceptance criteria
and it’s soooo bad. like it’s not even acceptance criteria, it’s just my explanation of the issue formatted with given/when/then
but like the given is supposed to be the state prior to testing the criterion, but this is the explanation for why the work needs to be done
and the when is supposed to be the action to test the criterion but it’s just “when we decide which approach to implement” in more words basically
and the then is supposed to be the outcome to be tested for acceptance and it’s just a list of options.
i really hope she was just playing around with the AI and then going to work on it with the team bc this is… not it…
2 notes · View notes
dontcode · 2 years ago
Text
Tumblr media
I think my commit name is very funny
8 notes · View notes
stevegy-sh-cn · 11 months ago
Text
The evolution of a rocket engine
Tumblr media
comparing it with the code refactoring...
2 notes · View notes
cauldronofmorning · 2 years ago
Text
Aya just feels like home you know? Like I feel safe and happy with her, and I want to know all the paintings in it and understand what they mean.
2 notes · View notes
otter-byte · 2 years ago
Text
Tumblr media
copilot calling my code a hack. Okay bestie how about I wave a magnet over your severs and we'll see how you feel.
5 notes · View notes
frog707 · 2 years ago
Text
refactoring
I lied when I said I was going to work next on loading a 3-D model. Sorry, old habit! Actually, I went straight into refactoring. Let me explain...
The English Wikipedia defines refactoring as "the process of restructuring existing computer code . . . without changing its external behavior", which is fairly accurate, though lacking in motivation.
My back-of-mind definition would be "changes to code whose primary purpose is not to add features or solve issues, but to make the codebase easier to maintain".
Back when I worked for corporations, I got in the habit of never mentioning refactoring around anyone who wasn't a software developer. If my boss (or my boss's boss) knew I was making changes (and spending work hours) on something other than approved features or known issues, awkward questions would arise. (Like, do we have a billing code for that?)
Anyone who's worked intimately with a large software project knows that if changes are made only for features and issues, the project will accumulate "technical debt" that makes it difficult to maintain: hard to explain/learn/understand/remember how it works and hard to make changes without introducing bugs.
Both of today's refactorings focussed on the BaseApplication class, which became unwieldy weeks ago. Last night the source file for the class reached 1901 lines of Java code (not counting blanks, comments, and javadoc). I don't place a hard limit on lines of code in a class, but a file containing 1901 LoCs positively screams technical debt. It's especially painful these days, since I'm working on a laptop with a tiny screen and using a track pad instead of a mouse. (I spend lots of time scrolling back and forth, hunting for the lines I need to change.) Cramming as much as possible into a single file makes some sense for a tutorial, but I see the V-Sport project as something I'll be maintaining for many years.
First I split off all the code that deals with physical devices and put that in a new PhysicalDevice class. The change greatly clarified which properties of the physical device matter and how that information is accessed.
Then I split off all the code that deals with texture data into a new Texture class. The new class bundles up 3 related Vulkan resources and provides a clear lifecycle of create/use/destroy. I expect it to minimize duplication of code when the project transitions (sometime in the near future) from a single texture to multiple textures.
I'm subjectively pleased with how smoothly today's refactoring went. One measure of its success is that BaseApplication shrank from 1901 to 1650 lines of code. Still plenty of room for improvement, though!
26 notes · View notes
Text
0 notes
dkettchen · 1 month ago
Text
I'm refactoring some code I wrote last year during bootcamp and I just narrowed down long ass code from like 3 data cleaning stages (=a lot of clunky code!) to a few tiny helper functions to apply to a dataframe (=very little, neat code!) in one afternoon 😩
1 note · View note
techenthuinsights · 2 months ago
Text
0 notes