#code refactoring
Explore tagged Tumblr posts
Text
The evolution of a rocket engine

comparing it with the code refactoring...
2 notes
·
View notes
Text
Top 10 ChatGPT Prompts For Software Developers

ChatGPT can do a lot more than just code creation and this blog post is going to be all about that. We have curated a list of ChatGPT prompts that will help software developers with their everyday tasks. ChatGPT can respond to questions and can compose codes making it a very helpful tool for software engineers.
While this AI tool can help developers with the entire SDLC (Software Development Lifecycle), it is important to understand how to use the prompts effectively for different needs.
Prompt engineering gives users accurate results. Since ChatGPT accepts prompts, we receive more precise answers. But a lot depends on how these prompts are formulated.
To Get The Best Out Of ChatGPT, Your Prompts Should Be:
Clear and well-defined. The more detailed your prompts, the better suggestions you will receive from ChatGPT.
Specify the functionality and programming language. Not specifying what you exactly need might not give you the desired results.
Phrase your prompts in a natural language, as if asking someone for help. This will make ChatGPT understand your problem better and give more relevant outputs.
Avoid unnecessary information and ambiguity. Keep it not only to the point but also inclusive of all important details.
Top ChatGPT Prompts For Software Developers
Let’s quickly have a look at some of the best ChatGPT prompts to assist you with various stages of your Software development lifecycle.
1. For Practicing SQL Commands;
2. For Becoming A Programming Language Interpreter;
3. For Creating Regular Expressions Since They Help In Managing, Locating, And Matching Text.
4. For Generating Architectural Diagrams For Your Software Requirements.
Prompt Examples: I want you to act as a Graphviz DOT generator, an expert to create meaningful diagrams. The diagram should have at least n nodes (I specify n in my input by writing [n], 10 being the default value) and to be an accurate and complex representation of the given input. Each node is indexed by a number to reduce the size of the output, should not include any styling, and with layout=neato, overlap=false, node [shape=rectangle] as parameters. The code should be valid, bugless and returned on a single line, without any explanation. Provide a clear and organized diagram, the relationships between the nodes have to make sense for an expert of that input. My first diagram is: “The water cycle [8]”.
5. For Solving Git Problems And Getting Guidance On Overcoming Them.
Prompt Examples: “Explain how to resolve this Git merge conflict: [conflict details].” 6. For Code generation- ChatGPT can help generate a code based on descriptions given by you. It can write pieces of codes based on the requirements given in the input. Prompt Examples: -Write a program/function to {explain functionality} in {programming language} -Create a code snippet for checking if a file exists in Python. -Create a function that merges two lists into a dictionary in JavaScript.
7. For Code Review And Debugging: ChatGPT Can Review Your Code Snippet And Also Share Bugs.
Prompt Examples: -Here’s a C# code snippet. The function is supposed to return the maximum value from the given list, but it’s not returning the expected output. Can you identify the problem? [Enter your code here] -Can you help me debug this error message from my C# program: [error message] -Help me debug this Python script that processes a list of objects and suggests possible fixes. [Enter your code here]
8. For Knowing The Coding Best Practices And Principles: It Is Very Important To Be Updated With Industry’s Best Practices In Coding. This Helps To Maintain The Codebase When The Organization Grows.
Prompt Examples: -What are some common mistakes to avoid when writing code? -What are the best practices for security testing? -Show me best practices for writing {concept or function} in {programming language}.
9. For Code Optimization: ChatGPT Can Help Optimize The Code And Enhance Its Readability And Performance To Make It Look More Efficient.
Prompt Examples: -Optimize the following {programming language} code which {explain the functioning}: {code snippet} -Suggest improvements to optimize this C# function: [code snippet] -What are some strategies for reducing memory usage and optimizing data structures?
10. For Creating Boilerplate Code: ChatGPT Can Help In Boilerplate Code Generation.
Prompt Examples: -Create a basic Java Spring Boot application boilerplate code. -Create a basic Python class boilerplate code
11. For Bug Fixes: Using ChatGPT Helps Fixing The Bugs Thus Saving A Large Chunk Of Time In Software Development And Also Increasing Productivity.
Prompt Examples: -How do I fix the following {programming language} code which {explain the functioning}? {code snippet} -Can you generate a bug report? -Find bugs in the following JavaScript code: (enter code)
12. Code Refactoring- ChatGPt Can Refactor The Code And Reduce Errors To Enhance Code Efficiency, Thus Making It Easier To Modify In The Future.
Prompt Examples –What are some techniques for refactoring code to improve code reuse and promote the use of design patterns? -I have duplicate code in my project. How can I refactor it to eliminate redundancy?
13. For Choosing Deployment Strategies- ChatGPT Can Suggest Deployment Strategies Best Suited For A Particular Project And To Ensure That It Runs Smoothly.
Prompt Examples -What are the best deployment strategies for this software project? {explain the project} -What are the best practices for version control and release management?
14. For Creating Unit Tests- ChatGPT Can Write Test Cases For You
Prompt Examples: -How does test-driven development help improve code quality? -What are some best practices for implementing test-driven development in a project? These were some prompt examples for you that we sourced on the basis of different requirements a developer can have. So whether you have to generate a code or understand a concept, ChatGPT can really make a developer’s life by doing a lot of tasks. However, it certainly comes with its own set of challenges and cannot always be completely correct. So it is advisable to cross-check the responses. Hope this helps. Visit us- Intelliatech
#ChatGPT prompts#Developers#Terminal commands#JavaScript console#API integration#SQL commands#Programming language interpreter#Regular expressions#Code debugging#Architectural diagrams#Performance optimization#Git merge conflicts#Prompt engineering#Code generation#Code refactoring#Debugging#Coding best practices#Code optimization#Code commenting#Boilerplate code#Software developers#Programming challenges#Software documentation#Workflow automation#SDLC (Software Development Lifecycle)#Project planning#Software requirements#Design patterns#Deployment strategies#Security testing
0 notes
Text
Techniques to Perform Code Refactoring
Red green refactoring
Refactoring by abstraction
Composing method
Simplifying methods
Moving features between objects
Preparatory refactoring
#technology#digital transformation#tech#it consulting#mobile app developers#software development#technology trends#business#it services#code#code refactoring
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
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
#technical debt#ai code review#refactoring#project analyzer#ai code automation#techolution#legacy application modernization#code quality
0 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
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