#code-refactoring
Explore tagged Tumblr posts
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…
View On WordPress
#code-refactoring#error-handling#exceptions#learn-application-development#micropython#programming#programming-logic#python#software-development#try-except
0 notes
Text
refactoring your own code is so embarrassing. who would ever write this trash pile of - oh...
#today's game dev work was just staring in horror#at the crimes against humanity i have committed#but there is something beautiful about facing your mistakes and fixing them#tomorrow the refactoring will continue#clean code who#anyway it's slightly less spaghetti now#progblr#codeblr#stemblr
31 notes
·
View notes
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
Text
If I could go back in time,
I would have used a state machine.
#me to the entirety of my code#thankyou youtube tutorial that made this possible but now im stuck with your code forever#i think if i try to refactor everythings gonna break#i dont have git on godot#game#gamedev#indie#indie games#indiedev#video games#indie dev#game development
4 notes
·
View notes
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
#barbie.txt#why is our instructor overwriting my code because he refuses to let me explain it to him#pushing TO THE MAIN BRANCH without our consent#‘our’ as in my group members CZ THIS A GROUP PROJECT. A GROUP HE IS NOT IN.#he fucking changed so so so much and broke everything and then fixed each error by hand#meanwhile my fixes were so much smaller and didnt require refactoring the entire fucking project#kiss my fucking ass brother. i was fucking seething while he used my computer to damage everyone’s hard work like it’s nothing#i hope he fucking dies. everybody hates him#&& ppl are telling me he’s being an even bigger hardass on me specifically. WONDER WHY
3 notes
·
View notes
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!!!!
#the guides written by non programmers “join an lgbt coders group”#the guides written by programmers “refactor their code and push it to main while theyre sleeping to piss them off”
4 notes
·
View notes
Text
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.
#including refactor of my current helper addon code that's probably another 1 hour gone lol#but i will be happy everytime i use this so kinda worth it anyways#blender#ramble
14 notes
·
View notes
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…
#and i put a lot of effort into writing acceptance criteria when i was on that team to make sure they translated well into regression tests#and it wasn’t possible or reasonable at least to satisfy them without doing the intended work#honestly though i thought we decided this wasn’t worth the effort years ago#especially when that was about refactoring code I had *just* written#and now it’s been there for years and presumably been built upon
2 notes
·
View notes
Text
I think my commit name is very funny
8 notes
·
View notes
Text
The evolution of a rocket engine

comparing it with the code refactoring...
2 notes
·
View notes
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
Text
copilot calling my code a hack. Okay bestie how about I wave a magnet over your severs and we'll see how you feel.
#lmao shut up haz#before you try and pull my wig for using copilot. congrats for buying into the myth that code gen tools could ever actually replace devs#I use these tools mostly because it's good resume building. they're actually not bad at generating refactors for declarative code.#but once you start doing anything with meaningful complexity they just start confidently spitting out nonsense that doesn't work#copilot is basically just a streamlined version of using stackoverflow. which is great because stackoverflow is complete ass#and searching any code online just exposes you to extreme amounts of medium blog SEO spam
5 notes
·
View notes
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!
#refactoring#making progress#software engineering#3d graphics#vulkan#technical debt#java#coding#software development#lying#tutorial#locs
26 notes
·
View notes
Text
#technical debt#ai code review#refactoring#project analyzer#ai code automation#techolution#legacy application modernization#code quality
0 notes
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 😩
#coding#love seeing my python progress over the past year hell yea#baby-coder!me didn't know so much shit omfg#pandas I owe u my life#the data manipulating software not the animal#I'm working on the refactor to try and eventually re-run all my ship stat code#with the 2024 data set#and maybe later even the tumblr rankings#so I can get to making the video about my findings at some point this year
1 note
·
View note
Text
0 notes