Slashdot Mirror


Visual Studio Gets Achievements, Badges, Leaderboards

bonch writes "Microsoft has introduced a gamification plugin for Visual Studio that lets users win achievements and badges as they compete on leaderboards by writing code. The full list of achievements includes gems like 'Go To Hell' for using goto, and 'Potty Mouth' for using five different curses in one file. This is another example of Gamification, one of the latest trends to hit social media."

15 of 353 comments (clear)

  1. I miss GOTO...there I said it by elrous0 · · Score: 5, Insightful

    I know that the established programmer hierarchy would have me burned at the stake for even hinting at it, but I miss my old GOTO statement. Call it sloppy if you like, but a simple one line statement beats the shit out of the acrobatics I often have to do in Java to SIMPLY JUMP OUT OF THIS METHOD/LOOP TO A SINGLE SPECIFIC POINT IN THE PROGRAM.

                      break;}
              break;}
          break;}
    return;} //shit, still doesn't go where I need it to

    Now, cue the voices of 1,000 programmers looking for a non-existent "disagree" mod and screaming at the top of their girlie lungs on why GOTO is EVIL, EVIL, EVIL--as they parrot the professors who taught them that.

    --
    SJW: Someone who has run out of real oppression, and has to fake it.
    1. Re:I miss GOTO...there I said it by The+MAZZTer · · Score: 5, Insightful

      I would skip GOTO in favor of putting some of that logic into a function. Then I can simply return; from it instead of using a GOTO to break out of as many levels of logic as I need, back to the calling function.

    2. Re:I miss GOTO...there I said it by piripiri · · Score: 5, Insightful

      Maybe you shouldn't nest these control structures like this... Flat programming, rings a bell?

      Oblig. KXCD

    3. Re:I miss GOTO...there I said it by gilwooden · · Score: 5, Funny

      You can use labels in java to break out of nested loops!

    4. Re:I miss GOTO...there I said it by Anonymous Coward · · Score: 5, Informative

      Was why GOTO is a bad idea every explained to you?

      The honest fact is that, if you go low level enough, it (equivalent) is the only method of not proceeding to the next instruction, so you'd think that it would make sense to have it in all the higher languages.
      However, the difference there is each label is (generally) only used once, and the state of all registers will be the same before and after. The problem with goto is that it requires the compiler to work out the meaning of all the variables at the point it jumps to, and to deal with loading those all into memory as part of the jump operation. At least with breaking out of a loop, you're going to be in the same scope as leaving it through the loop's condition becoming false. Returning from that context will move up (or, if you view things the other way, down) a scope, which is reasonable to deal with

      GOTOs, on the other hand, used to allow jumps into noticeably different scopes, where variable contexts could lead to information not having the right meaning. And, that's where the raptors break through.

      [citations needed]

    5. Re:I miss GOTO...there I said it by Sponge+Bath · · Score: 5, Funny

      ...when your code screams for a goto, use it!

      When your code anthropomorphizes, hit the delete key.

    6. Re:I miss GOTO...there I said it by swillden · · Score: 5, Insightful

      The Linux kernel uses goto statements. About 95000 times..

      In the absence of exceptions, goto is a great tool for simplifying and clarifying error handling.

      In a language with exceptions, goto is much less useful. I won't say it's never useful, but if I'm ever tempted to use goto for anything other than jumping to an error handling block, I know I need to take a step back and rethink the structure of the code, because there's almost certainly a better way.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    7. Re:I miss GOTO...there I said it by Twylite · · Score: 5, Informative

      Judicious use of GOTO can dramatically simplify resource cleanup when exception handling is not supported. A function that must grab N resources in order (and free them in reverse order on success or failure) requires N nested blocks if you don't use GOTO (and no nesting if you do use GOTO). Often the only way to refactor such logic into sub-functions is by using continuation passing style, which is clear as mud.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    8. Re:I miss GOTO...there I said it by Twylite · · Score: 5, Informative

      [citations needed]

      Citations won't be found, because the explanation is incorrect. There is no technical issue with compilers implementing 'goto' so long as the destination is in the same lexical scope (C has this limitation). Nor is it worth considering execution context at the level of the CPU, as any high-level loop or branch instruction must be translated into one of a limited number of conditional or non-conditional, relative or absolute jumps. Ultimately whether you use 'goto' or some other control construct you are attempting to express the same programmatic flow, and the compiled instruction stream will be sufficiently similar that it's not worth splitting hairs over.

      The reason 'goto' is "considered harmful" is because structured programming theorizes that any computable function can be expressed by combining simpler programs using sequence, selection and iteration; and this provides the opportunity for a constructive approach to program correctness. Dijkstra argues that we are cognitively limited and can benefit from code that is structured so that we can tell at any point where we are and where we have come from (a gross paraphrasing of what Dijkstra calls "coordinates"). But "[t]he unbridled use of the go to statement has as an immediate consequence that it becomes terribly hard to find a meaningful set of coordinates in which to describe the process progress". In other words careless use of 'goto' makes it hard to reason about your code.

      Knuth contended that one could created structured programs with 'goto' statements, and provided examples of how 'goto' make the program more elegant.

      It is important to realise that the claimed advantages of structured programming are undone by the use of break, continue, or exception handling. There are limited forms of goto, and using them prevents proofs of correctness (under the assumptions of structured programming; other techniques may be available) and reasoning using Dijkstra's "coordinates".

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    9. Re:I miss GOTO...there I said it by Rary · · Score: 5, Insightful

      People misunderstand the point of the whole "goto is evil" thing. It's not that jumping around in code is evil. No program of any real value can run sequentially from start to finish. You have to jump around to do anything useful. Conditional processing, iteration, function calls, and exception handling all involve jumps of one kind or another. Whether the language calls it "goto" or gives it a different name doesn't change the fact that it's a jump.

      However, there are a set of logical, structured jump patterns that have been well defined over the decades which produce readable, understandable, debuggable, extendable, logical code. These patterns include the constructs I described previously. Some languages have specific keywords for these constructs, while others rely on the keyword "goto" for their implementation. There's nothing wrong with using "goto" to implement one of these logical patterns, if that's how the pattern is implemented in that particular language.

      However, it is possible in languages that have a "goto", to execute a jump that is outside of these known patterns. These illogical, seemingly random jumps result in code that is confusingly obfuscated, and consequently more error-prone, as well as harder to extend.

      So, when people say "goto is evil", they're really saying "unstructured jumps are evil". Using such a construct might accomplish what you're trying to accomplish, but it will generally do so at the expense of readability, maintainability, and extendability of the code.

      And yes, any language, whether it has a "goto" or not, can be abused by a properly (un)skilled programmer to create a chaotic mess of spaghetti code.

      --

      "You cannot simultaneously prevent and prepare for war." -- Albert Einstein

  2. Re:Actually... by Deus.1.01 · · Score: 5, Funny

    *even grammar*

    --
    My -1 Troll is actually a +1 funny. And my -1 flame is actually a +1 insightfull.
  3. Resume builder? by ashmon · · Score: 5, Funny

    So, is this going to be a good thing to put on your resume?

    * Stay focused and attentive to work.
    * Hard worker
    * Level 32 Visual Studio Achievements
    * Stays on task

    Uhhhh...

  4. Obvious isn't it? by Viol8 · · Score: 5, Funny

    Huge hideous bugs!

  5. Re:seriously — they're totally missing the p by virgnarus · · Score: 5, Insightful

    There are plenty of individuals out there - including myself - that would go in a frenzy and would attempt to earn all the achievements, regardless if they're bad or not.

  6. WTF? by gstoddart · · Score: 5, Insightful

    Why would I want my dev environment to have leaderboards and be "gamified"?

    I'm glad it's only a plugin, but to me this is part of the annoying trend that everything we do needs to be tied into social media ... I mean, "they can also brag about their achievements on Facebook and Twitter". Why on earth does everything we do nowadays need to be tied into Facebook and Twitter?

    I'm waiting for the first wave of toilets with integration to those sites ... then we will truly widespread "Twitter Shitters" and other bits of stupidity.

    Then again, maybe I'm just old and uncool, and all of the cool kids are doing this ... but to me this just sounds like something which is utterly pointless.

    --
    Lost at C:>. Found at C.