Signs your code is unmaintainable
-
How about code meant for testing or practice getting into production? That does happen.
Hey! I just figured out what to use the name "EnterprisePaulaBeans" for! New anti-pattern, WIIGII!
-
@accalia said in Signs your code is unmaintainable:
i saw nothing in the episode to indicate that they couldn't have done it manually
that's the thing though, the number of times you can fold a piece of paper seems to me to be dependant on how much force you can exert on the paper to compact the layers. Machinery can impart more force.
-
@Jaloopa easy. We take it out of the galaxy, so there won't be any debris to hit it
-
@bb36e Just be careful which direction you take it, or you might run into Reapers...
-
@bb36e or we convert all the matter in the Galaxy into the paper we need.
-
@Jaloopa said in Signs your code is unmaintainable:
@bb36e or we convert all the matter in the Galaxy into the paper we need.
...but then there would be nothing left to fold it with!
-
@bb36e said in Signs your code is unmaintainable:
@Jaloopa easy. We take it out of the galaxy, so there won't be any debris to hit it
So....you want to give some one the Eridanus Void as a gift?
-
@masonwheeler there are other galaxies
-
@Jaloopa Yeah, but I heard those are all far, far away and it takes a long time to reach them...
-
@masonwheeler yes. That seems to be the only remaining part of this plan that's likely to cause significant problems
-
@Yamikuronue said in Signs your code is unmaintainable:
t's the thing though, the number of times you can fold a piece of paper seems to me to be dependant on how much force you can exert on the paper to compact the layers. Machinery can impart more force.
eeeh. you just need enough humans working together.
afterall the egyptians built the pyramids without wheels
and thern there's stonehenge.
people in sufficient quantity do amazin things.
-
@accalia yeah, but that's "we can fold" or "ya'll can fold" not "you can fold" ;)
-
@Yamikuronue said in Signs your code is unmaintainable:
@accalia yeah, but that's "we can fold" or "ya'll can fold" not "you can fold" ;)
touchet.
-
@accalia said in Signs your code is unmaintainable:
@Yamikuronue said in Signs your code is unmaintainable:
@accalia yeah, but that's "we can fold" or "ya'll can fold" not "you can fold" ;)
touchet.
Is that like a trebuchet but smaller?
-
@Karla Nah, it's like a sachet, but with a more pleasant texture for touching
-
@Yamikuronue said in Signs your code is unmaintainable:
@Karla Nah, it's like a sachet, but with a more pleasant texture for touching
-
@Yamikuronue said in Signs your code is unmaintainable:
@Karla Nah, it's like a sachet, but with a more pleasant texture for touching
Got it.
-
@Yamikuronue You can't fold a piece of A4 paper in half more than 7 times I think.
-
@lucas1 said in Signs your code is unmaintainable:
@Yamikuronue You can't fold a piece of A4 paper in half more than 7 times I think.
you can, if you allow cutting along the seam to reduce the stress caused by the fold.
or if you fold in a different technique than
10 TAKE SHORT EDGE 20 MATCH TO OTHER SHORT EDGE 30 FLATTEN 40 GOTO 10
-
@lucas1 said in Signs your code is unmaintainable:
@Yamikuronue You can't fold a piece of A4 paper in half more than 7 times I think.
You can if you unfold it between folds.
-
Not code, but I've run into documentation written in DocBook where, in a misguided attempt at modularity, a single book was composed of about 1250 XML files, most of which contained only a single element. Like this:
section_foo_title.xml:
<?xml version='1.0' encoding='utf-8' ?> <!DOCTYPE title PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]> <title>Some Kind of Title</title>
section_foo_indexterm_1.xml:
<?xml version='1.0' encoding='utf-8' ?> <!DOCTYPE indexterm PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]> <indexterm> <primary>Thing</primary> <secondary>How to work with it</secondary> </indexterm>
section_foo_para_1.xml:
<?xml version='1.0' encoding='utf-8' ?> <!DOCTYPE para PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]> <para> This is the first paragraph. There are probably at least 5 more files like this. </para>
And this mess was put together with liberal use of includes, like this:
section_foo.xml:
<section id="section_foo"> <xi:include href="section_foo_title.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> <xi:include href="section_foo_indexterm_1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> <xi:include href="section_foo_para_1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> </section>
This include shit went up to about 8 levels deep.
The reason for this was that the book in question had three distinct parts which largely talked about the same thing, but aimed at different systems - so big chunks of content were identical but not all of it. The person who created this mess wanted to keep the shared content in one place, instead of three, so changing something in one spot would propagate to all three parts. Which is commendable, but at the same time incredibly difficult to work with because any time you changed anything, you'd have to check all places that piece appeared in. At the same time it was incredibly difficult to do anything more involved than fixing typos.
-
@mott555 said in Signs your code is unmaintainable:
@lucas1 said in Signs your code is unmaintainable:
@Yamikuronue You can't fold a piece of A4 paper in half more than 7 times I think.
You can if you unfold it between folds.
You can use the equations derived by Britney Gallivan to determine how many times a paper can be folded.
http://pomonahistorical.org/12times.htm
tl;dr: Consistently folding in the same direction requires less paper for more folds, and adding another fold requires about 4 times more paper.
-
@Yamikuronue said in Signs your code is unmaintainable:
@Karla Nah, it's like a sachet, but with a more pleasant texture for touching
And here I thought it was a sterile hybrid of a Parrot and a Toucan.
-
Signs your code is unmaintainable: reimplementing standard browser functionality in JavaScript because you don't know what the core behaviour is.
E.g. middle click on a link opening in a tab.
E.g. allowing a link in an iframe to open inside that iframe. (Not even domain crossing.)
-
I mean... isn't that "core behavior" identical on all browsers, with the possible exception of Lynx?
-
@blek Yes
The best part is when you argue with said dev, he swears blind that browsers don't do that, followed by admitting he changed it some settings... except when you walk over to his desk and demonstrate, you are completely vindicated. AGAIN.
-
@Arantor said in Signs your code is unmaintainable:
@blek Yes
The best part is when you argue with said dev, he swears blind that browsers don't do that, followed by admitting he changed it some settings... except when you walk over to his desk and demonstrate, you are completely vindicated. AGAIN.
So, the opposite of WOMM, just incorrect?
-
@Arantor I'm being vaguely reminded of why frames securely mediate, by design.
-
@sloosecannon Not exactly. More a case of Works On The Machine In My Mind And I'll Swear That's How It Works In Realityâ„¢ Until Someone Tells Me Otherwise.
-
@blek said in Signs your code is unmaintainable:
frames securely mediate, by design.
it's secure multi-mediation!
@Arantor said in Signs your code is unmaintainable:
@sloosecannon Not exactly. More a case of Works On The Machine In My Mind And I'll Swear That's How It Works In Realityâ„¢ Until Someone Tells Me Otherwise.
Except in this case it's "Doesn't work" because apparently the feature that's been standard on all browsers since... IE7?... apparently doesn't work on his mind-machine?
-
@blek In this particular case, iframe is actually the least retarded solution for the job at hand. Think customer site with a bunch of their stuff on it, and wanting to integrate white-label services into it under their logo etc. but using our platform to do it, and not wanting to use our platform for the rest of it.
(For bonus points, the platform the customer is using that we're hooking into isn't theirs either. They're licensing two completely disparate SaaS platforms, attaching them with SSO and magic to offer a unified set of services to their users - and it even looks like it wasn't entirely smashed together out of multiple things, we actually put effort into styling our shit to resemble theirs.
-
@sloosecannon Apparently it doesn't work because he disabled it. And since he disabled it, apparently, it didn't occur to him that others users might not have, and therefore he needs to reimplement it by hand with jQuery attaching events to every single fucking link, including the ones that for raisins aren't really links but crusty bits of code whose destination is # and have onclick shenanigans attached.
The codebase was unmaintainable enough before he touched it.
-
@Arantor said in Signs your code is unmaintainable:
They're licensing two completely disparate SaaS platforms, attaching them with SSO and magic to offer a unified set of services to their users
So...
SaaS²aaS?
-
@Arantor That sounds horrifying, but then again... think of how many jobs this creates!
-
@blek This particular only created workload for me to fix and maintain.
-
@Arantor Maybe it's your turn to create some jobs then: http://www.bbc.com/news/technology-21043693
-
@blek I actually like writing code and there is fun to be had in making the unmaintainable maintainable. It's like the coder's version of the American Express ads. 'Unmaintainable? It's two letters too long.'
-
@Arantor You could always have a bunch of Chinese people do your job while you spend your time contributing to an open-source project
-
@blek What are the odds I'd only spend my day job fixing their code afterwards? I could just spend that time fixing what I already have and making more not-quite- code. There's enough in the codebase to fix without outsourcing more of it.
-
@Arantor said in Signs your code is unmaintainable:
@sloosecannon Not exactly. More a case of Works On The Machine In My Mind And I'll Swear That's How It Works In Realityâ„¢ Until Someone Tells Me Otherwise.
TIL that @Arantor has a cubicle next to Swampy, or perhaps just a relative of his. You have our sympathies.
-
@ScholRLEA said in Signs your code is unmaintainable:
How about code mean for testing or practice getting into production?
Code meant for demo being used as production.
True story.
-
@Tsaukpaetra said in Signs your code is unmaintainable:
Code meant for demo being used as production.
That's not unmaintainble. It can't be because we've maintained doing that for years!
-
@dkf said in Signs your code is unmaintainable:
@Tsaukpaetra said in Signs your code is unmaintainable:
Code meant for demo being used as production.
That's not unmaintainble. It can't be because we've maintained doing that for years!
Ohhh, that's very agile !
-
@ScholRLEA said in Signs your code is unmaintainable:
Half of it has a Cyclomatic Complexity Metric from 1 - 5, which isn't bad (I guess), but a third of it ranges from 6 - 15, while the rest lies between 16 to 51+. This is bad.
I routinely have to integrate with a third-party library that has only one class spanning 26k lines. The most complex method in it...
- spans 1455 lines
- has Cyclomatic Complexity of 446
- has NPath complexity of 916820154938974547473503936268760459070729055217208720 .
-
@DCoder said in Signs your code is unmaintainable:
I routinely have to integrate with a third-party library that has only one class spanning 26k lines. The most complex method in it...
- spans 1455 lines
- has Cyclomatic Complexity of 446
- has NPath complexity of 916820154938974547473503936268760459070729055217208720 .
KILL IT WITH FIRE.
-
@DCoder said in Signs your code is unmaintainable:
I routinely have to integrate with a third-party library that has only one class spanning 26k lines. The most complex method in it...
- spans 1455 lines
- has Cyclomatic Complexity of 446
- has NPath complexity of 916820154938974547473503936268760459070729055217208720 .
I know some code like that. Bytecode engine cores tend to be horrible in that sort of way, and yes, they're not particularly maintainable. They're also quite resistant to refactoring as they tend to be performance hotspots and need a lot of context to be set up right to function correctly. But most other code doesn't need that level of evil.
-
A single abstract class that implements everything but 11 marker subclasses with instance of if ladders everywhere to determine what to call in the abstract class.
I sense a gap in someone's understanding.
-
@dkf But I expect they are usually generated code, are they not?
-
@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!
-
@wft said in Signs your code is unmaintainable:
But I expect they are usually generated code, are they not?
No, usually they are (very carefully) hand-written. The bytecode that they run will be auto-generated, of course.
It's possible to make some simplifications by using inlined functions heavily, but then that tends run into other problems as most compilers are pretty dumb about how they do inlining on systems of the scale of a production bytecode engine. Bytecode engines are really horrible and are also very hot code; it's one of the few places where you can reasonably get into counting the number of instructions and measuring the size of the stack frame. Most of the time, people are told to avoid a whole bunch of mostly-unmaintable practices, but when the code is critical enough, that goes by the board.