36
15
There are various coding standards enforced at software companies which have the goal of increasing code reliability, portability, and, most importantly, readability in code written jointly by different developers.
Two notable examples are the MISRA C, and the C++ standard developed for the JSF project.
These are usually in the following form, after carefully specifying what the words "must", "shall", "should", "might", etc. mean:
Example:
Rule 50: Floating point variables shall not be tested for exact equality or inequality.
Rationale: Since floating point numbers are subject to rounding and truncation errors, exact equality may not be achieved, even when expected.
These coding standards pose restrictions, usually on code which would be legal from the compiler's point of view, but it is dangerous or unreadable, and is therefore "considered harmful".
Now let's abuse this!
You are accepted as a member of a small standardizing committee at your company, which is intended to design the new coding standards every developer at the company will be required to use. Unbeknown to the others, you are secretly in the employ of a sinister organization and have as your mission to sabotage the company. You have to propose one or more entries to the coding standard which will later hinder the developers. However, you must be careful to not make this immediately obvious, otherwise you risk it not being accepted into the standard.
In other words, you must introduce rules to the coding standard which look legitimate and have a good chance of being accepted by the other members of committee. After the projects are started and countless man-hours are invested in the code, you should be able to abuse these rules (for example, by a technicality, or by a very literal interpretation) to flag otherwise normal and good quality code as being against the standard. So they must put a lot of effort in to redesign it, and the rules will hinder them from this point on, but as the rules are active for quite some time now, pure momentum will keep these roles alive, and as there are significant conflicts of interests between different levels of management, the other managers will probably keep the rules alive (they would be foolish to admit their mistake!), therefore hindering the company! Mwahahahahaaa!
Scoring
The highest voted answer after approximately 2 weeks from the first valid entry wins. I have an idea for a good answer, but I will only post it a few days later, as someone else might come to the same idea, and I don't want to rob them from the pleasure. Of course, my own answer will not be accepted above any other, no matter the score.
Voters are encouraged to score answers based on how well the loopholes are hidden, and how frustrating to the developers they would be.
Rules and regulations
- The rule or rules must look professionally written, like in the above example
- The rules should look genuine (so things like "all variables must contain at least one underscore, one upper case letter, one lower case letter and two numbers" are not accepted. They would indeed hinder developers, but would most likely not be accepted by the committee) and if their merit is not immediately obvious, you should give a good rationale.
- You should be able to find a way to use/abuse your rules to sabotage the developers later on. You might abuse any ambiguity in other rules, or you might use multiple rules which are harmless on their own, but diabolical once combined!
- You should post an explanation in spoiler tags at the end of your post about how you could abuse the rules
- The language used must not be an esoteric language. A language widely used in real projects must be chosen, so languages with C-like syntax (instead of things like Golfscript) are preferred.
2
I'm voting to close this question as off-topic because underhanded challenges are no longer on topic: http://meta.codegolf.stackexchange.com/a/8326/45941
– Mego – 2016-04-18T06:02:54.430Just to let you know, there are some rather "unconventional" languages which are used in real projects, like APL. – Martin Ender – 2014-10-30T17:08:16.633
@MartinBüttner : I only wanted to exclude esoteric and joke languages. A language with universally understood syntax is preferred, but not exclusively required. However, I guess most people wouldn't vote on answers which need to explain the basic syntax of the language itself. – vsz – 2014-10-30T17:16:07.327
Why not just standardise tabs in Java? :-) – John Dvorak – 2014-10-30T17:39:33.023
4Python, Ruby, Haskell, Makefile, XML, etc. are some languages used in lots of real projects which don't have a C-like syntax. – kennytm – 2014-10-30T17:48:45.730
@JanDvorak Because that can be fixed with a few lines of program - just replace tabs/spaces with the new version. – None – 2014-10-30T17:55:39.343
1@KennyTM : please read my previous comment. I didn't say the languages on your list are forbidden. – vsz – 2014-10-30T17:56:02.553
7This question appears to be off-topic because it isn't a programming contest. – Peter Taylor – 2014-10-30T18:02:12.730
5@PeterTaylor : the definition includes "Programming puzzles" which doesn't mean the answer must be a piece of software code. Nowhere in the definition of the site is it written that it's only about "programming contests". The definition is : "Code golf / Programming puzzles / Other programming contests or challenges"
" – vsz – 2014-10-30T18:09:24.127
7@PeterTaylor it looks like a contest about programming to me; in cops & robbers challenges the robbers don't code either (and if your argument is that robbers comment, then be sure to comment on the meta post that suggests splitting cops and robbers challenges to two separate questions) – John Dvorak – 2014-10-30T18:13:29.570
@JanDvorak, it looks like a contest about using the English language to me. (As for cops and robbers, I've been ignoring them since the first one, because the conclusion I drew from my participation in that one is that it's not a good format). – Peter Taylor – 2014-10-30T19:18:24.683
1@PeterTaylor It's using the English language to create programming standards. I'm new to PPCG, but i've looked at contests before from the Hot Network Questions list, and i seem to remember other contests regarding English. – Scimonster – 2014-10-30T19:23:58.070
2
Reading both of these pages http://codegolf.stackexchange.com/help/on-topic , http://codegolf.stackexchange.com/help/dont-ask I still don't find any rule regarding questions on this site must have software code as answers. If so, it would be called "programming contest", bit this term only shows up as "other", and "programming puzzles" precedes it. But I don't necessarily want to play a rules lawyer, so I expect from others to not do it either. So, sincerely, what is it what you don't like in this question, and how do you think it could be improved?
– vsz – 2014-10-30T19:30:41.3072@Scimonster, the people who aren't new to PPCG will know that I think that being on the HNQ is negatively correlated with being a good question, and I believe that some of them share that opinion. But I can't recall seeing any other questions like this one. If you can remember enough keywords to find them, I would be interested to see. – Peter Taylor – 2014-10-30T19:38:54.923
@PeterTaylor On the other hand, if requiring the answers to include some software code is what makes questions on-topic, than I can answer that as well. A good answer is expected to have the rule or rules described, and after that, a code example which shows a reasonable code which is clear, useful, and in common style, probably the best way to solve a problem, but which would fail to adhere to the company standard because of the loopholes you built into it. – vsz – 2014-10-30T19:45:14.023
@vsz, I'm not quite sure what you're quoting - none of the instances of other in the pages you link seems to fit the context. The lack of specific wording in the on-topic page doesn't constitute carte blanche: it probably just means that the topic hasn't come up before - this meta question might be the closest we've seen. I'm not sure that the question can be fixed, but if you want to try then I suggest that the place to do it is the sandbox.
– Peter Taylor – 2014-10-30T19:45:57.273@Scimonster: Do you mean Sort a list and write some English!? That question is about disguising code as a business letter.
– Dennis – 2014-10-30T19:49:43.2204@PeterTaylor then why isn't it called "coding contest", or just purely "programming contest". Why puzzles? But we can discuss it, I'm listening to your arguments. Just here and now it seems that you are the one who is just rules-lawyering. Should we ask in meta what constitutes a "programming puzzle"? I think this site would be boring if we only allowed questions like "solve this basic problem in an obscure language with as few characters as possible". Why not include puzzles which are indeed about programming. I doubt this question would be more on-topic on english.stackexchange.com – vsz – 2014-10-30T19:50:55.050
2In fact, it would definitely not be on topic on [english.se]. This seems to be a programming puzzle, that only fits on this SE site. – Scimonster – 2014-10-30T19:55:39.733
If you had let me post my example (which I postponed only to let others figure it out) you would have seen how this question can be answered in an on-topic way, by actually programming / writing code. – vsz – 2014-10-30T20:17:43.393
5I voted to reopen. It seems like we still have some questions where we can't agree on whether they are on topic. This reminds me of that art related one that got closed then reopened twice. I do have an idea for an answer for this question and it is definitely programming related. This question even fits 2 of the tags on the site. – hmatt1 – 2014-10-30T21:18:39.187
2I'm not saying that requiring the answers to include some software code makes questions on-topic: that isn't sufficient, as is being discussed on meta in the context of "art questions". The reason for this site's name is that it was originally created to move code golf questions off StackOverflow, and in area51 and very early meta discussions the scope was widened to include more than just code golf. But that doesn't mean that the scope is widened to include anything which has a connection to programming. – Peter Taylor – 2014-10-30T23:12:15.253
3I agree that this question wouldn't be on topic on english.stackexchange.com, but that doesn't mean that it must therefore be on topic here. There are many questions which aren't on topic on any site in the StackExchange network. – Peter Taylor – 2014-10-30T23:12:54.180
2The first answer only serves to reinforce my feeling that this is only superficially related to programming. – Geobits – 2014-10-30T23:18:06.297
"by a technicality, or by a very literal interpretation" seems reminiscent of code-trolling and the standard loopholes.
– grc – 2014-10-31T02:30:19.357I remember, that in the early days, almost all popularity contests and underhanded challenges (basically everything not a code-golf) were voted to be closed. – vsz – 2014-10-31T03:51:31.433
1I was on the fence about this question, but the clever answer posted by the OP sold me on it as a programming puzzle. – xnor – 2014-10-31T04:35:00.873
1Voting for reopen. It's certainly an on the edge of off topic but I do believe it is related enough and could be fun. At the very least it could serve as an example for either side of the argument on meta. – Ingo Bürk – 2014-10-31T06:20:49.200
1This is so much fun thank you for re-opening! Do my managers secretly play this game? I think so! – ErlVolton – 2014-10-31T16:05:04.957
2@ErlVolton I'm wondering if vsz is playing this game with the rules and regulations in the question, considering the use of "must" and "should". :P (I kid, they're clear to me) – FireFly – 2014-10-31T16:57:46.193