Mobile app version of vmapp.org
Login or Join
Frith110

: How can I convey complexity of source code without showing code? I just created a big web application, and I need a way to present it. I want to allow people to visualize the amount and

@Frith110

Posted in: #PresentationDesign

I just created a big web application, and I need a way to present it. I want to allow people to visualize the amount and complexity of code I coded ("wow this is a giant bunch of code" and "wow this code is sooo complex(independent of the fact that complex code is bad quality)"), but in a style readable for those not familiar with programming. It would be nice if this visualization is also optically pleasing.

Because it needs to show the complexity and amount of work I put into it, I do not want a simple pie-chart. Are there any tools I can use to do this? How do you think I should present it?

This is not about being proud of much/complex code and code refactoring tools. This is about visualizing amount/complexity of code/programs for non programmers in a visually pleasing way.

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith110

4 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

One thing that comes to mind for me is the way certain IDE's display code. Using colors and lines to connect matching sets of begin...end, if...then, and loops makes reading code easier for programmers, so why not for non-programmers? You could show nested loops, case statements, and compound if..else sets in a neat and clean way.

In the same vein, but different, you could color code functions, methods, and procedures by their time and/or perceived complexity. This way, a reader can quickly scan through and see "problem areas" or more complex areas of code.

I agree with the other answers/comments about pointing out "complexity" of code. However, I understand that you may be trying to point out reasons why you can't "just change it" or how a simple fix would actually touch a significant amount of the program in question.

10% popularity Vote Up Vote Down


 

@Yeniel278

Please don't take offense to this, but when a coder is proud of the complexity of his/her code (like your sentence says "wow this code is sooo complex"), most of the time it is a sign of a really bad design.

I say this because it's what I have experienced in my 14 years of professional programming. It's easy to write code that is complex and more difficult to write code that is easy to read, understand, and maintain.

You don't want to be proud of complex code; it means you have not succeeded in making it easy to understand, it means you still have a lot to learn programming-wise.

There is a bunch of software for code quality, qualimetry, that measures complexity of functions, classes, modules. But contrary to what you think, the more parts are awarded red or high complexity scores, the more they need to be re-written.

Personally I focus on Mc Cabe complexity < 10, and that's already a high complexity, and function length of less than 40 lines of code.

It's incredible the pace at which functions are guilty of becoming non-maintainable due to their complexity. And if you use a complex function with another complex function, you end with something even more complex, non-maintainable, and prone to error when modified. And that grows exponentially if you have even more complex layers on complex layers. In software engineering we call it technical debt.

Maybe you should invest in one of those software metrics application. Google "Software Metrics" and the languages of your choice.

If you want it to be maintainable code, rewrite it so that it is not complex; don't be too proud or attached to your code.

Remember, code is written once, but it is read hundred of times.

10% popularity Vote Up Vote Down


 

@Caterina889

Off-hand I'm thinking knots.



(image from www.math.buffalo.edu/)
Knots offer a wide array of complexity degrees. From the simple square knot to some very complex, multi-line, knots. And the multi-line knots could be used to show integration between different languages if needed. These could be used or integrated into a design to show the complexity of an application.

10% popularity Vote Up Vote Down


 

@Twilah924

It may depend on what do you mean by complexity. If your code has a lot of nesting constructs and loops, perhaps you can first properly indent the code, and then replace the actual lines of code by rectangles, as to visualize the indentation and nesting. Some especially interesting parts could be done in another color, and made into active links, so you could click on them and be taken to another slide that further elaborates on that part of the code.

If you use a mix of languages (php, html, xml, sql), you could have an overview of a code with different languages in different colors, again with clickable links that would reveal details.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme