Categories > Etc > Software & Hardware >

[Q] Making My Code More Maintainable?


New Reply

Posts: 1232

Threads: 64

Joined: Feb, 2020

Reputation: 69

  • 0

Posted

It's been a few years and I have a few big project codebases (most are private, but my Starlight project is a good example). Some of my projects go up to five thousand lines of code and 40+ source files. Anyways, what I've noticed is that it's extremely difficult for me to add features to my code without rewriting from the ground up. Sometimes my code becomes such a rat's nest that I give up and take a break. I don't think I write bad code, per se, but rather I don't organize it well. Do any of you have project design/layout conventions that could help keep my code clean and maintainable when adding new features?

ishanjit321

Ishanjit C. Mitter

Mention

Posts: 485

Threads: 78

Joined: Mar, 2022

Reputation: 12

  • 0

Replied

I dont know if you do this or not.
I try creating classes for each semi major or a major function.
and i also use trello to organize what i do and what i can say is using trello has increased my productivity and that in return has made my code a tad bit more organized

https://cdn.discordapp.com/attachments/1047697447838830673/1051632062798495834/siggy.png

ThatPhoenix

Dopemine Addict

Mention

Posts: 2892

Threads: 63

Joined: May, 2020

Reputation: 30

  • 0

Replied

programmers are like that, we're lazy because it works better for us. 

Astronemi#8419 | DM me if you need help or have any questions! <3

Posts: 1187

Threads: 81

Joined: Feb, 2021

Reputation: 58

  • 0

Replied

Alr another bot time to ban it 

https://media.discordapp.net/attachments/1013939973671624917/1027279180192292944/unknown.png
https://media.discordapp.net/attachments/996322272547704845/1016492646820233246/standard.gif

Posts: 1232

Threads: 64

Joined: Feb, 2020

Reputation: 69

  • 0

Replied

@Hiroku bruh 💀

SeizureSalad

i love femboys

Mention

Posts: 974

Threads: 62

Joined: Mar, 2021

Reputation: 30

  • 0

Replied

i find like folders n stuff pretty confusing and don't understand why people make useless classes unless it's like oop or something but whatever

"Questionable intellegence, but I like the mystery" - CubeFaces

https://cdn.discordapp.com/attachments/908778288426651739/928478435066642492/siggy_1.png

JumpingJerboa

Hoping to Help People

Mention

Posts: 14

Threads: 1

Joined: Jan, 2023

Reputation: 4

  • 0

Replied

One approach that may help is using design patterns and conventions to promote encapsulation and separation of concerns, making it easier to add new features. Also, implementing a consistent naming convention, file organization, and version control can aid in code maintenance.

 

It's also important to review your code regularly and take breaks to avoid burnout. Remember, code organization is an ongoing process and takes time and practice to develop good habits.

"It is more effective to provide individuals with the necessary knowledge and skills to address problems independently, rather than solely providing them with ready-made solutions."

Posts: 1232

Threads: 64

Joined: Feb, 2020

Reputation: 69

  • 0

Replied

@JumpingJerboa Yeah, I do all of that. It still gets quite messy.

JumpingJerboa

Hoping to Help People

Mention

Posts: 14

Threads: 1

Joined: Jan, 2023

Reputation: 4

  • 0

Replied

@RealNickk

I totally get that it can still be tough to keep things organized even when you're doing everything right. One thing that could help is regularly going through your code and cleaning it up, so it's easier to understand.

 

There are also tools that can help you visualize your code, which can make it easier to spot problem areas. If all else fails, don't be afraid to ask for help. Sometimes, a fresh set of eyes can see something you missed.

"It is more effective to provide individuals with the necessary knowledge and skills to address problems independently, rather than solely providing them with ready-made solutions."


New Reply

Users viewing this thread:


( Members: 0, Guests: 1, Total: 1 )