That Image Looks Familiar
-
At the top of the article, not in the onebox
-
This is what ugly code looks like. It’s a dependency diagram—a representation of interdependence or coupling (the black lines) between software components (the grey dots) within a program. A high degree of interdependence means that changing one component inside the program could lead to cascading changes in all the other connected components, and in turn to changes in their dependencies, and so on.Programs with this kind of structure are brittle, and hard to understand and fix. This dependency program was submitted anonymously to TheDailyWTF.com, where working programmers share “Curious Perversions in Information Technology” they find as they work. A user commented, “I found something just like that blocking the drain once.”
-
thanks, I'm lazy/missing a large part of a handle of rum.
-
I've posted this before. This is code we inherited when we acquired another company:
-
At least that looks largely stratified. It's when things are not that you've got real problems. If it's an
#include
graph, it needs to be stratified or the compile will not work at all. Class collaboration diagrams are a much better indication of whether things are a horror or not.
-
The code itself is a nightmare and no-one currently at the company has even started trying to get a handle on it...
Largely because 'it works well enough' at the moment, and it's not used that frequently that too many problems have come up that require messing with it. Most of us are treating it as a black box.
But it badly needs refactoring if we're going to continue to use/support it. The alternative is to strip out the functionality we need from it and plug them into the other (in-house) program which it was intended to (but didn't) replace.
-
Hey! We're on Wired? Does that mean we're sort of famous? Just in case:
Hi Wired readers, welcome. We are a very subjective community with different opinions on almost every subject, specially this community platform. Now, if you want to maintain your sanity and some faith in humanity, leave.
-
Hey! We're on Wired? Does that mean we're sort of famous?
Check the date on the article, it's from 9/5. Which makes me wonder how it just came up now.
-
Check the date on the article, it's from 9/5. Which makes me wonder how it just came up now.
02/09/2014, actually
one of my friends posted it yesterday
-
Right, date formatting differences for some users here. Edited September 5th.
-
Can I have a link to one of these tools? The projects I'm thinking about are C++ and Java.
-
IIRC it was simply callgrind, but a google search for 'call graph generator' should get you started.
-
.... Now I have a giant text file, but I wanted a graph :<
$ head callgraph.txt C:appeng.hooks.DispenserBehaviorTinyTNT appeng.hooks.DispenserBehaviorTinyTNT C:appeng.hooks.DispenserBehaviorTinyTNT net.minecraft.dispenser.BehaviorDefaultDispenseItem C:appeng.hooks.DispenserBehaviorTinyTNT net.minecraft.dispenser.IBlockSource C:appeng.hooks.DispenserBehaviorTinyTNT net.minecraft.block.BlockDispenser C:appeng.hooks.DispenserBehaviorTinyTNT net.minecraft.util.EnumFacing C:appeng.hooks.DispenserBehaviorTinyTNT appeng.entity.EntityTinyTNTPrimed C:appeng.hooks.DispenserBehaviorTinyTNT net.minecraft.world.World C:appeng.hooks.DispenserBehaviorTinyTNT net.minecraft.item.ItemStack M:appeng.hooks.DispenserBehaviorTinyTNT:<init> (O)net.minecraft.dispenser.BehaviorDefaultDispenseItem:<init>
-
.... Now I have a giant text file, but I wanted a graph :<
That's what dot is for, isn't it?
Filed under:
cat | sed | dot
-
Filed under: cat | sed | dot
What's cat doing in a pipeline? But yes this seems like a dot problem. A quick google points via SO to https://code.google.com/p/jrfonseca/wiki/Gprof2Dot.
-