13
\$\begingroup\$

As a community, are we willing to accept graphical notation as a form of code that is subject to code review?

I recently answered a question that asked for review of a database model as presented in an entity-relationship diagram. With this question, the the OP's intention would be clear to anyone who is familiar with ERM notation. However, because it was not encoded with symbols contained within the Unicode Standard, it was closed as off topic. Understanding that many Code Review users may be unfamiliar with ERM, I edited the question by providing SQL CREATE TABLE statements that were directly analogous to the OP's ERM diagram. I then flagged a moderator for reopening. My edits were subsequently deleted. If anyone is interested, the (now-deleted) referenced question is here.

Graphical modeling has been recognized as a valid form of encoded logic since the late 1800s. As a developer and architect, I often use visual models to clarify and effectively communicate complex concepts. ERM has been a standard in the software industry since the 1970s. UML has been common place since the 1990s. The Code Review FAQ states that Code Review is "the right place" for questions about design pattern usage. The seminal textbook on design pattern usage contained multiple diagrams for each design pattern as well as an appendix for modeling notation.

In addition to the established, historical usage of modeling in software development, there is significant evidence that suggests that a shift in methodologies towards graphical programming would greatly improve developer productivity.

Should we continue to ban interchange about modeling from Code Review? Or, does it make more sense to permit questions that express software designs through standardized, graphically encoded notation?

\$\endgroup\$
  • \$\begingroup\$ The issue that I see as potentially problematic is the requirement that code be working before it submitted here. What would that mean in terms of these diagrams? \$\endgroup\$ – Winston Ewert Oct 9 '12 at 17:05
  • 3
    \$\begingroup\$ Possible exception: programs in Piet :-) \$\endgroup\$ – svick Oct 9 '12 at 18:20
  • 3
    \$\begingroup\$ @WinstonEwert Isn't that requirement there more to exclude the “How can I make this code work?” kind of questions, even if it isn't worded that way? \$\endgroup\$ – svick Oct 9 '12 at 18:25
  • 1
    \$\begingroup\$ @svick, yes, that's part of it. But I think it also serves to force people to have put effort in before showing it to us. See this question: meta.codereview.stackexchange.com/questions/594/… \$\endgroup\$ – Winston Ewert Oct 9 '12 at 19:41
  • \$\begingroup\$ @WinstonEwert, How is "working code" defined? Compilable? Dereferenceable? \$\endgroup\$ – smartcaveman Oct 9 '12 at 19:47
  • 4
    \$\begingroup\$ dereferenceable? what? In the case of code, I expect it to be compile and be tested such that the author believes it to be bug free. \$\endgroup\$ – Winston Ewert Oct 9 '12 at 20:17
  • 1
    \$\begingroup\$ The problem with this kind of post is that it promotes working/viable answers. This means that the person answering the post needs to come up with all the code and the OP has learned nothing. They have done no legwork or research, no coding, no experimenting, nothing except thinking about it. Diagrams are fine when discussing strategy, but then those kind of questions are better suited for Programmers.SE. If the questions used diagrams for clarity that would be fine, but the code is necessary to determine if the OP understands the topic. \$\endgroup\$ – mseancole Oct 10 '12 at 13:43
  • 1
    \$\begingroup\$ @mseancole I think you're not considering that diagrams can very easily be the final step in programming a class. For example, I routinely create UML diagrams visually and then run a code-generator to produce the object-model, database and mappings. With something like this, I already know the output compilable code will 'work', and the only part that I have to consider or might want reviewed is the design. \$\endgroup\$ – smartcaveman Oct 10 '12 at 14:24
  • \$\begingroup\$ @WinstonEwert, (1) That would make all markup code off-topic. (2) Would you be more accepting of an .svg xml document that created the visual diagram, even if (a) the visual diagram was all that I wanted reviewed in the first place, and (b) the visual diagram is much more simple to interpret? \$\endgroup\$ – smartcaveman Oct 10 '12 at 15:27
  • \$\begingroup\$ @smartcaveman, no it wouldn't make markup code off-topic. In the case of HTML, the poster would be expected to have something which displays correctly. \$\endgroup\$ – Winston Ewert Oct 10 '12 at 16:25
  • 3
    \$\begingroup\$ The issue isn't text vs visual. If you were using an actual visual programming language I probably wouldn't object. The fact that the artifact is displayed in a visual format isn't the issue, my concern is whether the artifact is really reviewable in the first place. \$\endgroup\$ – Winston Ewert Oct 10 '12 at 16:31
  • 1
    \$\begingroup\$ @smartcaveman: If you are using a program to generate the code from a diagram, then there is nothing to review but the strategy. So my point still stands. This is not a "code review", but a review of the selected strategy, which is more appropriate for Programmers.SE. \$\endgroup\$ – mseancole Oct 10 '12 at 21:22
  • \$\begingroup\$ @YannisRizos: Programmers.SE is the only site I know of that specifically says in their FAQ that they allow questions about design patterns and structures. Besides, how is it too localized? Its a concept. It hasn't been applied to anything yet. It should still be vague enough to be helpful in many different situations. Or am I misinterpreting it? Please let me know, I don't want to keep sending people to the wrong site if this is truly an issue. But if it is, where then do I send them? This is a topic I believe should be allowed somewhere, and everywhere else dismisses it. \$\endgroup\$ – mseancole Oct 12 '12 at 4:48
  • 1
    \$\begingroup\$ @mseancole, by that logic, C# is "nothing but strategy" because I am using a program (the jitter) to generate code (CIL) from it. So, I guess higher level languages should be off topic as well? \$\endgroup\$ – smartcaveman Oct 12 '12 at 8:26
  • 1
    \$\begingroup\$ @smartcaveman: There are a couple of problems with that assumption. The diagram-to-code generator you mentioned expresses a design concept. Correct me if I'm wrong, but it is more or less a scaffolding. So the base code it generates is still an "idea". From my vastly naive experience with code generators for C# you are still "coding", just with an immensely intricate GUI. Besides, C# is not JUST dynamically generated. There are people who hard code it as well. C# and UML or ERM are completely different. This is kind of hard to express in words, so my apologies if I'm not doing it adequately. \$\endgroup\$ – mseancole Oct 12 '12 at 13:57
5
\$\begingroup\$

I understand that this is a late response, but this question hasn't yet been answered.

Simply-put: questions lacking code from the asker are off-topic.

I was also the one who deleted this question sometime ago. Had it been possible, I probably would've migrated it to Database Administrators instead. You've also added your own code to the question, which was (rightfully) reversed. Before it was reversed, you reviewed it, even though it was not technically code written by the asker, which is currently required under site policy. Adding your own code based on a visual or something else does not change this at all. Instead, the asker should be directed to the correct site if one exists (or just migrated to the correct site), and the current question should be closed.

\$\endgroup\$
0
\$\begingroup\$

I think the real question is: When is something considered 'code' and when is something considered 'conceptual code'? The first should be asked here whereas the other should be redirected to Programmers.

If 'code' is 'text that can be compiled and run' then ERM should be considered valid. A lot of software suites do exactly that, 'compile' ERM diagram language to a lower-programming language (e.g. SQL). Just as PHP can be translated to C++ (HipHop). The argument 'you need software to translate' is a non-argument since you need software for nearly every language to translate it to a working program (no your CPU doesn't understand SQL, neither does your SSD).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .