Code not readable

shadowranger94

Junior Member
Joined
May 20, 2011
Messages
98
Reaction score
5
Hi All,

I have seen lots of spaghetti code in my current company.

Wanna know if the current market doesnt care about clean code or whether it is maintainable?

Mind you I am having lots of enhancement and the code is not readable. If I refractor, there will be other bugs coming out.

Should I stay or leave? Or everywhere is the same all got spaghetti code.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Hi All,

I have seen lots of spaghetti code in my current company.

Wanna know if the current market doesnt care about clean code or whether it is maintainable?

Mind you I am having lots of enhancement and the code is not readable. If I refractor, there will be other bugs coming out.

Should I stay or leave? Or everywhere is the same all got spaghetti code.

This is the code base of an open source project I am involved in highly modifying it during my early days as a junior software engineer.
You can download from here at
cvs -z3 -d:pserver:anonymous@a.cvs.sourceforge.net:/cvsroot/assp co -P asspV1
Read assp.pl

Glimpses to part of the code
UpxbQ9P.png

blziO5K.png

5Kj4zMb.png


No proper documentation of the code and also it is design as event driven approach, which means the flow will jump all over the place.

If you think unclean code is the reason for you to jump ship ?
I hope you can find "beautiful" places in your life all the time and sh.t never hits the fan.
:)
 
Last edited:

shadowranger94

Junior Member
Joined
May 20, 2011
Messages
98
Reaction score
5
This is the code base of an open source project I am involved in highly modifying it during my early days as a junior software engineer.
You can download from here at
cvs -z3 -d:pserver:anonymous@a.cvs.sourceforge.net:/cvsroot/assp co -P asspV1
Read assp.pl

Glimpses to part of the code
UpxbQ9P.png

blziO5K.png

5Kj4zMb.png


No proper documentation of the code and also it is design as event driven approach, which means the flow will jump all over the place.

If you think unclean code is the reason for you to jump ship ?
I hope you can find "beautiful" places in your life all the time and sh.t never hits the fan.
:)
Thanks for the advice. I am not complaining about anything. I just find that while I am eager to achieve clean code here, the senior developers take no regard. Or I am just a foolish person in thinking that clean code is achievable?
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Thanks for the advice. I am not complaining about anything. I just find that while I am eager to achieve clean code here, the senior developers take no regard. Or I am just a foolish person in thinking that clean code is achievable?
Yes clean code is achievable if the company you join has established workflows. However be mindful that legacy codes that doesn't follow the modern ways of development may exist. So what you should be looking at is processes if that is what you want.

That being said, I would highly advise not to be too anal about it. Clean code is not free. It takes effort, time and cost to maintain. Thus if projects are not costed properly to provide for such processes, it can be rather difficult.
:)
 

Trader11

Banned
Joined
Oct 14, 2018
Messages
15,698
Reaction score
5,233
Yes clean code is achievable if the company you join has established workflows. However be mindful that legacy codes that doesn't follow the modern ways of development may exist. So what you should be looking at is processes if that is what you want.

That being said, I would highly advise not to be too anal about it. Clean code is not free. It takes effort, time and cost to maintain. Thus if projects are not costed properly to provide for such processes, it can be rather difficult.
:)
Once awhile, there is this fresh grad who just read Uncle Bob or Martin Fowler and come lecture about clean code and refactoring
 

Trader11

Banned
Joined
Oct 14, 2018
Messages
15,698
Reaction score
5,233
Meaning ? there is no software company now that adopts clean code? So everything about clean code is just a dream?
Clean code exists if you are a consultant that sells clean code ideas….people like Robert Martin or Martin Fowler don’t work in enterprise system building anymore…..
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Once awhile, there is this fresh grad who just read Uncle Bob or Martin Fowler and come lecture about clean code and refactoring
It's always good to have a clear direction, but it is also important to learn practicality. Takes time to learn what to compromise and what not to. :)
 

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,719
Reaction score
529
@davidktw,
At the very least leave some comment for each block. ;)
Codes that I written several years ago without comment is causing nightmare when random errors pop up. Now, I will leave a few lines of comment for each block.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
The code should explain itself

Trust me when I say that is a fallacy. E=mc^2 doesn’t explain itself easily among those that doesn’t appreciate theoretical physics. Likewise there exist easy looking codes that need a lot of knowledge to appreciate. But that doesn’t mean the code is bad, it just means you need someone whom knows enough to appreciate. It is actually quite subjective to claim a piece of code is looking bad at times.

What I said doesn’t mean one shouldn’t write readable codes. But this shouldn’t be an axiom. Comments are there to help with reading too. Choosing others over it when it can do a good job isn’t necessarily better. I have seen a lot of developers trying too hard to conform and neglected what is the real reason to do so. They just blindly follow what those static code analysers recommend like some biblical quotes, but don’t really fully understand why. Understanding is the key.

:)
 
Last edited:

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
@davidktw,
At the very least leave some comment for each block. ;)
Codes that I written several years ago without comment is causing nightmare when random errors pop up. Now, I will leave a few lines of comment for each block.

There are various approaches at which codes can be made easy to read.

Commenting is just one way, and it has to be done where it is hard for codes to explain itself easily. Some codes are performant and hard to explain itself because of the sheer amount of context knowledge required. In this case, comments helps.

But there are also times when coding itself can be made easy to read because good compartmentisation and good naming conventions, good formatting, and good placement within the architecture. Even good documentation helps.

I never think code alone tells the whole story. A story is good because of how it is setup to be good. Even the story teller matters.

:)
 

leonlee1

Banned
Joined
Feb 28, 2022
Messages
330
Reaction score
242
This is what sets good and bad companies or developers apart.

Clean readable code has little need for documentation.
Just simple comments within the code and overall design documentation is good enough.
 
Last edited:
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top