0

When I am coding an application, I like to start by outlining a certain code standard which I follow. However, if I am working on a big project I tend to change my coding standard through the code.

I was just reading over my code, and the thought of a code swing came to mind when I was looking at one function which has a code standard that differs (with regards to programming semantics) from another.

Is this phrase valid?

  • 1
    deviation is more standard – JMP Sep 6 '17 at 7:23
  • There are nowhere near as many hits on a Google search for "code swing" as there are for "mood swing", and most of them seem false positives (eg ... and long code. Swing provides ...) anyway. However, there's no rule against using unusual modification if it seems logical and isn't unclear. The snag here is that 'code swing' wouldn't be clear to many (outside the trade, at least): codes may be written to communicate, or imposed to control. – Edwin Ashworth Sep 6 '17 at 7:23
  • @JonMark Perry That's appalling. – Edwin Ashworth Sep 6 '17 at 8:32
  • 1
    @EdwinAshworth: As someone who's in the trade, it isn't clear to me either. Until OP explained his reasoning and linked it to "mood swing", and even then it wasn't clear that he was focusing about the adherence to standards as opposed to the general quality or efficiency of the code. There's a lot of detail missing in the neologism itself, that is still an essential part of the intended definition. – Flater Sep 6 '17 at 8:35
  • @EdwinAshworth; thanks! i was going to answer the question with 'No.' – JMP Sep 6 '17 at 8:59
1

Not applying a standard universally (a), or changing the standard itself as you go (b), leads to either an inconsistent adherence to the standard (a) or adherence to an inconsistent standard (b).
To forgo the ambiguity between these two very similar options, I would simply call that inconsistency.

Inconsistent
adjective

  1. Not staying the same throughout.
    ‘the quality of the material was often inconsistent’

    1.1. Acting at variance with one's own principles or former behaviour.
    ‘parents can become inconsistent and lacking in control over their children’

  2. (inconsistent with) Not compatible or in keeping with.
    ‘he had done nothing inconsistent with his morality’


Although I understand your reasoning for drawing analogies between "code swing" and "mood swing", I would also argue that it's not the code that swings back and forth, but rather the adherence to the coding standard.
So it would be more accurate to call it "coding standard adherence swing". In the case where you adjust the coding standard, it's "coding standard swing". Or if you consider not adhering to coding standards to be an issue of code quality, you can argue that it's also "code quality swing".

I can't tell you it's not allowed to coin a new phrase, but I can tell you that I would not have understood what you meant by any of these neologisms, and I'm a software developer who very much gets annoyed at half-assed adherence to coding standards.

So in the interest of clear communication, I would suggest you avoid this particular neologism. It's not clear what you mean, and you'll have to end up explaining it to people anyway, thus defeating the purpose.

  • This will be good to refer back to when there are other D-I-Y suggestions. Very cogent and well presented. – Edwin Ashworth Sep 6 '17 at 8:36
  • Thank you for clearing up my confusion. Accepted this answer. – bobbybrown6969 Sep 6 '17 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.