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."

28 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 Robadob · · Score: 4, Informative

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

    3. 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

    4. 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!

    5. 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]

    6. 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.

    7. Re:I miss GOTO...there I said it by jps25 · · Score: 4, Informative

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

    8. 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.
    9. Re:I miss GOTO...there I said it by VGPowerlord · · Score: 4, Informative

      Oddly enough, GOTO does have a legitimate use in C#. Switch statements in C# don't fall through. If you want a switch statement to fall through, you have to use a goto ; to force the fall through.

      Unless it's an empty switch statement. Those are allowed to fall-through.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    10. 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
    11. Re:I miss GOTO...there I said it by gstoddart · · Score: 4, Informative

      Interesting comment, but I'm with Dijkstra on this one:

      One of my profs once laughed at me when I said his code had a goto and we shouldn't do it that way (because that's what we'd been taught in class).

      Then he sat me down and walked through the code, and explained what the code was doing, and the failure modes that made it necessary to use a goto. This was OS-level code, and performing some very fiddly things, and several layers deep in looping structures. You'd have had to put in twice as much code to check the error conditions necessary to peel out of that, and since it was essentially working on bare metal, there was simply no room to add much more overhead.

      He did manage to convince me that a goto isn't something you do because it's convenient, but that in some code, in some languages there simply isn't a better alternative to bail out of some code in the event of a failure.

      I have worked in a couple of languages (one being C, the other proprietary) in which a goto was the cleanest/only way to get out of the code, and get to a place where you could do all of your cleanup and get out cleanly.

      It has its place, but it should definitely be used sparingly. Blindly saying never use a goto doesn't always give you the best solution.

      --
      Lost at C:>. Found at C.
    12. Re:I miss GOTO...there I said it by AaronLS · · Score: 4, Insightful

      Sometimes algorithms have complex break conditions. You are arrogant to judge so quickly when all you have is a code snippet. I love these people who glance at some code and then say "you should refactor/redesign that" and offer no more than vague suggestions. In situations where I have the authority, I respond by assigning them the task they themselves suggested. Guess what I do when they fail at the very task they themselves so derogatorily suggested?

    13. 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
    14. 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. seriously — they're totally missing the poin by mattdm · · Score: 4, Insightful

    The idea of gamification is to give little awards for postitive behavior — or at least active engagement with the site/product/tool/whatever. A few of these fit that (the badge for working on a Saturday or Friday night), but most of them are labels of shame for doing things like writing a single line of code that is several screens too wide.

  3. 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.
  4. 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...

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

    Huge hideous bugs!

  6. Possible badges for good code by tucuxi · · Score: 4, Interesting

    I for one would find these badges nice:

    • compiled without warnings (cumulative for "N times in a row")
    • doxygen-compliant comment coverage (percentage-wise cumulative)
    • safe programming practices (always compares constant == lvalue, initializes all values, ...)

    On the other hand, IDEs like Netbeans and Eclipse are getting better and better at nagging users about such issues (and auto-generating code to fix many of them). Do we really need the badges?

  7. Gotta get 'em all by Lunaritian · · Score: 4, Insightful

    There are many players who simply have to collect every single achievement. Considering what these achievements are like (use 20 single-letter variables, write a 300-character line etc.) I hope their behavior won't carry over to programming...

  8. Only 5 curses in one file? by Coisiche · · Score: 4, Funny

    Clearly my code commenting technique is slightly different from the norm.

  9. 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.

  10. man, not vendor by mapkinase · · Score: 4, Insightful

    Achievements should be defined by management, not the software vendor.

    --
    I do not believe in karma. "Funny"=-6. Do good and forbid evil. Yours, Oft-Offtopic Flamebaiting Troll.
  11. 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.
  12. I've been trying to recover from decades of hating by Nelson · · Score: 4, Insightful

    Seriously, I have been trying to get over the MS hate that I've had since Windows 3. They're just another big company, trying to do what they can and at least they try to compete in new markets even though they routinely get shelled by the competition when they stray off the desktop.

    But WTF?!?. Badges in Visual Studio? For real? They have no idea what they are doing. Are they chasing 15 year old developers to be? This is a company with 10s of billions in cash that can subsidize products like Xbox for years and years. This is fucking Bob in the IDE.

  13. Maybe the real reason.... by Dcnjoe60 · · Score: 4, Funny

    Maybe the real reason for the badges and leaderboards is so inept managers who know more about marketing than programming have some way to evaluate what the programmers are doing.

  14. Re:I've been trying to recover from decades of hat by geekoid · · Score: 4, Interesting

    I'm many decades past 15 and this looks awesome.

    If you stopped and looked around for moment instead of assume you know what's going on you would realize how powerful achievements are. There are many, many good outcomes to this. The biggest will be more knowledgeable and experience developers.

    You can't have been around that long if you think this is MS Bob.
    That said, MSBob had a great start, but someone future wife was put in charge and basically managed it to shit.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect