Signs your code is unmaintainable
-
-
@marczellm That guy badly needs an IDE. All of his variable naming strategies can be solved by a simple right-click -> refactor.
-
@bbolli said in Signs your code is unmaintainable:
@Yamikuronue Two years ago, I took over a 12+ years old codebase in "C++". I have to put this in quotes because in all the .h and .cpp files, there was not one single instance of the keyword
class
... But hey, at least the// single line comments
compile!Boss: Hey, all our code is still C. We need to upgrade to C++
Intern:ren *.c *.cpp
Intern: Done!
-
The number of supported branches is of the same magnitude as the number of customers.
-
@Greybeard said in Signs your code is unmaintainable:
The number of supported branches is of the same magnitude as the number of customers.
are the branches named after the customers or are the customers referred to by the branch version they are on?
if yes to either..... FUCKING RUN!
-
I didn't realize you {do|used to} work with @Arantor ...
-
I am working with a local government application and I have a naming scheme that uses hungarian notation in a form builder.
I am also being trained this week on said application and even the trainer from the company that produces the software is apologizing to us.
-
@izzion I don't. Not from direct experience.
-
@blakeyrat said in Signs your code is unmaintainable:
All of his variable naming strategies can be solved by a simple right-click -> refactor.
Maybe, if you can figure out what they're for. Otherwise you won't have anything better to call them.
-
@izzion half our customers' stuff isn't in VCS because special while the rest is completely harmonised across the other customers.
-
@Arantor Yeah, I should have said "versions" instead of "branches". The latter incorrectly assumes version control.
-
@Greybeard said in Signs your code is unmaintainable:
@Arantor Yeah, I should have said "versions" instead of "branches". The latter incorrectly assumes version control.
The former, however, permits a sane approach to maintaining those versions. The later is known to be totally insane.
-
@accalia said in Signs your code is unmaintainable:
@Greybeard said in Signs your code is unmaintainable:
The number of supported branches is of the same magnitude as the number of customers.
are the branches named after the customers or are the customers referred to by the branch version they are on?
if yes to either..... FUCKING RUN!
What if it's both? Our newer clients get the new version, but our older clients keep the version they started with unless they choose to pay for an upgrade. If they want a new instance, we'll either put it on a new version or on their existing version. So we have multiple instances of our software running a range of versions, and every client/version combination has its own instance. My job is customizing each instance to fit each client's spec for that instance. Thankfully, the core product has hooks into the most commonly customized portions, so it's a bit easier.
-
You find a program where...
- The user enters a 3-character transaction code
- The program uses the transaction code to determine a charge code
- The transaction code is moved to a 2-character history code, chopping off the 3rd character
- The transaction code is then discarded, leaving posterity to guess which one it was
-
@CoyneTheDup That's not really the code being unmaintainable, though. It's your transaction history that's a mess. The code will be fine (as far as the reported part goes) once the history code is updated to be three characters.
-
@Scarlet_Manuka said in Signs your code is unmaintainable:
The code will be fine
Will it? It certainly might, but since there is already one huge of recording the transactions incompletely, I would not be so sure there are no other.
-
@Scarlet_Manuka said in Signs your code is unmaintainable:
The code will be fine (as far as the reported part goes)
That's why I wrote the highlighted bit there. Yes, other things could potentially be wrong, but there's no evidence either way.
-
@CoyneTheDup Strictly that's the process that's a and nothing you've said indicates that the code itself is maintainable or not. If it was stripping the character by calling out to a web service hosted in the back of beyond and costing the earth while having unreliable network and DNS, that would be more of the sort of stupidity this thread is about. Especially if the fact that this is happening is “soft-coded” while still completely distorting the code to heck and back in order to make it possible at all.
-
Silly and obnoxious naming practices, such as, well, the ones I used on my first semi-professional programming project. They may be funny and may make sense to you now, but they won't make much sense years later, and you will look like an idiot the minute you show the code to someone else.
Mind you, I was new to 'serious' programming and working alone on a project that was sort of on the spur of the moment anyway (I thought it was silly for a computer store to use hand-written carbon sheets for receipts, and the owner agreed but didn't want to buy a Point-of-Sale system, so I convinced him to let me try to write one, which he did on the stipulation I use the specific software and hardware he gave me for it), and using tools which were already dusty and covered in cobwebs by the time I tried to used them. That doesn't really excuse it, though. The program was a POS in more than one sense. I described it as 'well-written' in the write up, which is from around 2000, but that was pure wishful thinking; it was truly bad code in several ways, andI am far more than just 'slightly embarrassed' by it now.
-
@dkf said in Signs your code is unmaintainable:
@CoyneTheDup Strictly that's the process that's a and nothing you've said indicates that the code itself is maintainable or not. If it was stripping the character by calling out to a web service hosted in the back of beyond and costing the earth while having unreliable network and DNS, that would be more of the sort of stupidity this thread is about. Especially if the fact that this is happening is “soft-coded” while still completely distorting the code to heck and back in order to make it possible at all.
You just aren't thinking along the right lines:
- Auditor asks you to prove system assigned correct charge code. Nope, can't, no record of what the user entered.
- User asks you to provide history of code use. Nope, can't, no record of what the users entered.
Well, maybe you can take the charge code and the two characters you have and try to reverse map...
Bottom line: You can't maintain code when you have no means of auditing that it does the right thing.
-
@CoyneTheDup said in Signs your code is unmaintainable:
Bottom line: You can't maintain code when you have no means of auditing that it does the right thing.
There's a lot of code where “do what it does now” is defined as The Right Thing, no matter how wrong it is.
-
@dkf said in Signs your code is unmaintainable:
There's a lot of code where “do what it does now” is defined as The Right Thing, no matter how wrong it is.
So "maintenance" consists of not touching anything. Sounds pretty easy to me.
-
@HardwareGeek said in Signs your code is unmaintainable:
So "maintenance" consists of not touching anything. Sounds pretty easy to me.
Yes, except you've got to change things anyway, perhaps because the old 16-bit version of Windows you were relying on is no longer able to run on any hardware you can actually buy, or perhaps because the regulatory environment has changed, or perhaps because the customer wants everything to work just the same as before except for this one little thing…
-
@dkf said in Signs your code is unmaintainable:
the same as before except for this one little thing
-
@HardwareGeek Well, that's sort of the point - while maintenance on new versions is usually dominated by bug fixes, most maintenance in mature projects of the type you described is due to changing requirements or platform changes.
Besides, dealing with is simply part of the job. Has anyone here ever had a project scheduled for longer than three weeks that didn't have at least one requirement or regulatory change come in after the halfway point? I doubt it.
-
@HardwareGeek said in Signs your code is unmaintainable:
@dkf said in Signs your code is unmaintainable:
the same as before except for this one little thing
Natch.
-
@Groaner said in Signs your code is unmaintainable:
@antiquarian said in Signs your code is unmaintainable:
This one bit me in the ass yesterday:
INSERT INTO table2 SELECT * FROM table1
I spent a few months a couple years ago fixing the couple hundred stored procedures in our codebase that did that. It got to the point where people were intentionally making tables with extra
varchar
columns (think UserDefined01, UserDefined02, ... UserDefined20), and every so often, you'd see someone sending a company wide email to ask, "I'm storing order status in UserDefined11 and ship date in UserDefined17 - is anyone else using those columns for anything?"This is plague in lot of code I have seen. This kind of "UNRELIABLE DATA" is often impossible to migrate.
I am wishing an AI to be developed for this kind of stuff.In one "Phone" field, it said "Call Marcos na extensão 21". The "ã" mangled up stuff even more.
-
@Nagesh said in Signs your code is unmaintainable:
I am wishing an AI to be developed for this kind of stuff.
That'd be cruelty to computers.
-
Okay, everyone. Look back at the code you wrote 2 years ago. Can you maintain it?
-
@Lorne-Kates More easily than a lot of the stuff they make me work on...
-
@Lorne-Kates Two years ago, almost to the day (according to commit logs), I was modifying a function that I modified again a couple of weeks ago (and that, as far as I remember, hasn't been significantly changed in between).
I did manage to both understand what I had done the first time and how to change it, so I guess that's a "yes, I can maintain it".
(no, don't look at those other commits I did at about the same time... I'm sure that if I haven't changed that code since then, it's just that it was perfect the first time, not that I don't want to look at it!)
-
@Lorne-Kates said in Signs your code is unmaintainable:
Okay, everyone. Look back at the code you wrote 2 years ago. Can you maintain it?
Nope. I don't have access to my old employer's repos.
-
@Lorne-Kates said in Signs your code is unmaintainable:
Okay, everyone. Look back at the code you wrote 2 years ago. Can you maintain it?
Mine's 16 years old. And yes, and still do (open source).
Do I like all the decisions I made then? No. But the majority have actually aged quite well.
-
@Lorne-Kates said in Signs your code is unmaintainable:
Okay, everyone. Look back at the code you wrote 2 years ago. Can you maintain it?
I can and I am doing. I also have code from around 20 years ago that… has aged well in parts. The design decisions I'd make now are a bit different, but the code is still there and still working. (I've also stuff from 15 years ago in production and that I'm still very happy with. It's been built on top of since, but it was always supposed to be so that's No Problem.)
-
Two years ago today I wrote a function for text replacement which I have been reusing in various forms across nearly every other project made since then. I don't know if that counts as maintainable, but I do know that I tried to add regex to it and failed.
-
@pie_flavor said in Signs your code is unmaintainable:
I tried to add regex to it
and failed.
(I'm not sure that really communicates "relieved," but that's what it says on the tin.)
-
@HardwareGeek said in Signs your code is unmaintainable:
(I'm not sure that really communicates "relieved," but that's what it says on the tin.)
I imagine that's the kind of relieved face one would make after a huge maintenance.
-
@Lorne-Kates said in Signs your code is unmaintainable:
Look back at the code you wrote 2 years ago.
Oh, my.
A wiki engine, contained in a single executable script, written in Perl 5.
"Guess a chord / triad / key step (not sure about the correct term here)" training application, written in C99.
Can you maintain it?
Yes. I even have some new features in mind for the wiki engine, but no free time to implement them. (Besides, even I almost stopped using it.)
-
@Lorne-Kates Apart from it having been sodomized by offshore LPCs that evaluate their own performance, and not being on the project anylonger and thus being locked out of the codebase, yes.
There is one project I did a few years ago that was massively overcomplicated entirely needlessly because of other systems it integrated with was dumb as fuck. It was a pretty small microservice though, not even having a database of it's own so with enough wetware allocatable space you could hold the entire flow structure in your head... I told them lots and lots of times that the requirements and platform design were but alas, they persisted.
If I ended up as the maintainer for that particular bit of code, I'd do my best to get the other systems to change the way they integrated with it, so 9/10th of the code could be thrown away.
-
@Tsaukpaetra said in Signs your code is unmaintainable:
@HardwareGeek said in Signs your code is unmaintainable:
(I'm not sure that really communicates "relieved," but that's what it says on the tin.)
I imagine that's the kind of relieved face one would make after a huge maintenance.
"A huge maintenance" would be a pretty good euphemism.
-
@Gąska That's also what I thought, although I'm not entirely sure an euphemism for what it would be (at least two ideas come to mind, and this being from @Tsaukpaetra, I really don't want to have more information about it).
Some things are best left unsaid.
-
This post is deleted!
-
@Gąska said in Signs your code is unmaintainable:
"A huge maintenance" would be a pretty good euphemism.
are you saying it isn't?
-
@Luhmann with him, it's quite possible he used it very literally.
-
And I screwed up topics. Earlier I thought I'm in WTF Bites thread.
-
-
@Luhmann said in Signs your code is unmaintainable:
@Gąska said in Signs your code is unmaintainable:
with him
yeah maybe he needs a huge maintenance
Every morning even. Though, considering one of the facilities is still decorated (I think they forgot about it when removing the Halloween stuff)....
-
@Tsaukpaetra It looks like an angry Moomin.
-
@Tsaukpaetra can't tell if the brown smear is part of the decoration.
-
@Gąska said in Signs your code is unmaintainable:
@Tsaukpaetra can't tell if the brown smear is part of the decoration.
Which one?