Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Val Grind (the wrong kind)

Val Grind (the wrong kind)

Scheduled Pinned Locked Moved The Weird and The Wonderful
23 Posts 12 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Member 4608898

    I've seen code like x = 0 - y; which, apparently was a workaround for a compiler bug which sometimes generated the wrong code for x = -y; I've also seen lots of legacy code of the type you've described but not in VB. The thing is that the concatenation operator is & so think about why they've used + before you change it. Sometimes there is a reason for using the +. Just make sure the item on the right is a string: it may not always be a string. When it isn't, what is happening and what are they doing?

    Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #21

    Member 4608898 wrote:

    what is happening and what are they doing?

    No one really knows... There's lots of obscure bugs in code like that :) Luckily, one of the other 'magical solutions for all your problems' is the wonderful On Error Resume Next command. Really, if it was allowed people would've used On Error Resume Next + "" :laugh:

    It's an OO world.

    public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }
    }

    1 Reply Last reply
    0
    • R Rob Grainger

      ...and in my replies above I've already indicated why it is unnecessary to convert long->string->long.

      C Offline
      C Offline
      cpkilekofp
      wrote on last edited by
      #22

      I'm still boggled a bit by the number of people who responded "this is a common idiom" without actually analyzing what was written. It's not that I'm not familiar with why it happens, it's just that so many who reply this way are being paid good money to manage code bases.

      "Seize the day" - Horace "It's not what he doesn't know that scares me; it's what he knows for sure that just ain't so!" - Will Rogers, said by him about Herbert Hoover

      R 1 Reply Last reply
      0
      • C cpkilekofp

        I'm still boggled a bit by the number of people who responded "this is a common idiom" without actually analyzing what was written. It's not that I'm not familiar with why it happens, it's just that so many who reply this way are being paid good money to manage code bases.

        "Seize the day" - Horace "It's not what he doesn't know that scares me; it's what he knows for sure that just ain't so!" - Will Rogers, said by him about Herbert Hoover

        R Offline
        R Offline
        Rob Grainger
        wrote on last edited by
        #23

        cpkilekofp wrote:

        I'm still boggled a bit by the number of people who responded "this is a common idiom" without actually analyzing what was written.

        Good, it's not just me then.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups