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. What's missing?

What's missing?

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
31 Posts 17 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.
  • G Gary Wheeler

    if (_Framework.DuplexPlatform)
    {
    Synchronize.Visibility = Visibility.Visible;
    }
    {
    Synchronize.Visibility = Visibility.Collapsed;
    }

    *face-palm*

    Software Zen: delete this;

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #2

    :laugh: I have gone the other way too many times, relying on the indentation...

    if (_Framework.DuplexPlatform)
    Synchronize.Visibility = Visibility.Visible;
    Synchronize.Visibility = Visibility.Collapsed;

    This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    G B 2 Replies Last reply
    0
    • OriginalGriffO OriginalGriff

      :laugh: I have gone the other way too many times, relying on the indentation...

      if (_Framework.DuplexPlatform)
      Synchronize.Visibility = Visibility.Visible;
      Synchronize.Visibility = Visibility.Collapsed;

      This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

      G Offline
      G Offline
      Gary Wheeler
      wrote on last edited by
      #3

      I'm one of those insecure types who always uses braces, unless the if() fits on a single line.

      Software Zen: delete this;

      OriginalGriffO D G L 4 Replies Last reply
      0
      • G Gary Wheeler

        I'm one of those insecure types who always uses braces, unless the if() fits on a single line.

        Software Zen: delete this;

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #4

        So am I, because I got caught before, back in my early C days...and it took ages to work out what the heck I had done wrong! :-O Nowadays, about the most I will let myself get away with is:

        if (value > maxRange) break;

        Everything else gets curly brackets :laugh:

        This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        G 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          So am I, because I got caught before, back in my early C days...and it took ages to work out what the heck I had done wrong! :-O Nowadays, about the most I will let myself get away with is:

          if (value > maxRange) break;

          Everything else gets curly brackets :laugh:

          This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

          G Offline
          G Offline
          Gary Wheeler
          wrote on last edited by
          #5

          Do you fully parenthesize too? I'm lazy, and never want to remember the precedence rules.

          Software Zen: delete this;

          OriginalGriffO 1 Reply Last reply
          0
          • G Gary Wheeler

            Do you fully parenthesize too? I'm lazy, and never want to remember the precedence rules.

            Software Zen: delete this;

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #6

            Not always: I'm happy with

            if (a == 1 && b == 2)

            But I'd use em for

            if (a == 1 && (b == 2 || c == 3))

            Or

            if ((a == 1 && b == 2) || c == 3)

            Just to make it obvious what I meant.

            This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            F 1 Reply Last reply
            0
            • G Gary Wheeler

              if (_Framework.DuplexPlatform)
              {
              Synchronize.Visibility = Visibility.Visible;
              }
              {
              Synchronize.Visibility = Visibility.Collapsed;
              }

              *face-palm*

              Software Zen: delete this;

              N Offline
              N Offline
              Nagy Vilmos
              wrote on last edited by
              #7

              Mandatory code fix post - Why you not do inline:

              Synchronize.Visibility = _Framework.DuplexPlatform ?
              Visibility.Visible : Visibility.Collapsed;

              :-D

              speramus in juniperus

              G L 2 Replies Last reply
              0
              • N Nagy Vilmos

                Mandatory code fix post - Why you not do inline:

                Synchronize.Visibility = _Framework.DuplexPlatform ?
                Visibility.Visible : Visibility.Collapsed;

                :-D

                speramus in juniperus

                G Offline
                G Offline
                Gary Wheeler
                wrote on last edited by
                #8

                I posted a summarized fragment.

                Software Zen: delete this;

                1 Reply Last reply
                0
                • OriginalGriffO OriginalGriff

                  :laugh: I have gone the other way too many times, relying on the indentation...

                  if (_Framework.DuplexPlatform)
                  Synchronize.Visibility = Visibility.Visible;
                  Synchronize.Visibility = Visibility.Collapsed;

                  This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

                  B Offline
                  B Offline
                  Bernhard Hiller
                  wrote on last edited by
                  #9

                  A colleague of mine is rather fond of not using {} - even over several levels, i.e.

                  if (...)
                  if (...)
                  for (...)
                  if ()
                  doSomething();
                  doSomeOtherthing();

                  That's why I use the Edit - Advanced - Format Document feature of Visual Studio very often...

                  OriginalGriffO G B I 4 Replies Last reply
                  0
                  • B Bernhard Hiller

                    A colleague of mine is rather fond of not using {} - even over several levels, i.e.

                    if (...)
                    if (...)
                    for (...)
                    if ()
                    doSomething();
                    doSomeOtherthing();

                    That's why I use the Edit - Advanced - Format Document feature of Visual Studio very often...

                    OriginalGriffO Offline
                    OriginalGriffO Offline
                    OriginalGriff
                    wrote on last edited by
                    #10

                    You threw me there for a moment - I use CTRL+K, D (which does the same thing) :laugh:

                    This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                    1 Reply Last reply
                    0
                    • B Bernhard Hiller

                      A colleague of mine is rather fond of not using {} - even over several levels, i.e.

                      if (...)
                      if (...)
                      for (...)
                      if ()
                      doSomething();
                      doSomeOtherthing();

                      That's why I use the Edit - Advanced - Format Document feature of Visual Studio very often...

                      G Offline
                      G Offline
                      Giuseppe Tollini
                      wrote on last edited by
                      #11

                      wow, that's... that's horrible

                      1 Reply Last reply
                      0
                      • G Gary Wheeler

                        I'm one of those insecure types who always uses braces, unless the if() fits on a single line.

                        Software Zen: delete this;

                        D Offline
                        D Offline
                        Dennis_E
                        wrote on last edited by
                        #12

                        Me too, but a colleague uses different code formatting and he always auto-formats files so the one-line if-statements turn into 2-line if-statements (with no braces).

                        1 Reply Last reply
                        0
                        • B Bernhard Hiller

                          A colleague of mine is rather fond of not using {} - even over several levels, i.e.

                          if (...)
                          if (...)
                          for (...)
                          if ()
                          doSomething();
                          doSomeOtherthing();

                          That's why I use the Edit - Advanced - Format Document feature of Visual Studio very often...

                          B Offline
                          B Offline
                          BuggyTimes
                          wrote on last edited by
                          #13

                          Seen a couple of those in an older code base :) Wasn't always a happy debugging experience :)

                          1 Reply Last reply
                          0
                          • B Bernhard Hiller

                            A colleague of mine is rather fond of not using {} - even over several levels, i.e.

                            if (...)
                            if (...)
                            for (...)
                            if ()
                            doSomething();
                            doSomeOtherthing();

                            That's why I use the Edit - Advanced - Format Document feature of Visual Studio very often...

                            I Offline
                            I Offline
                            Ingo
                            wrote on last edited by
                            #14

                            That's really awful! In our company we altogether made a programming styleguide and {} has to used everytime (and it has to follow the structure and shall not be places on the next line). I like this styleguide! We have good readable code everywhere now. :rolleyes:

                            SharePoint Consultant and Developer at acocon Author of Primary ROleplaying SysTem I'm the ninth in a row of seven!

                            Richard DeemingR 1 Reply Last reply
                            0
                            • I Ingo

                              That's really awful! In our company we altogether made a programming styleguide and {} has to used everytime (and it has to follow the structure and shall not be places on the next line). I like this styleguide! We have good readable code everywhere now. :rolleyes:

                              SharePoint Consultant and Developer at acocon Author of Primary ROleplaying SysTem I'm the ninth in a row of seven!

                              Richard DeemingR Offline
                              Richard DeemingR Offline
                              Richard Deeming
                              wrote on last edited by
                              #15

                              ihoecken wrote:

                              shall not be places on the next line

                              Philistine! Allman style[^] is the only way to go. ;P And while we're at it, it's tabs every time. Anyone who uses spaces to indent their code shall be shot.


                              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                              "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                              I 1 Reply Last reply
                              0
                              • Richard DeemingR Richard Deeming

                                ihoecken wrote:

                                shall not be places on the next line

                                Philistine! Allman style[^] is the only way to go. ;P And while we're at it, it's tabs every time. Anyone who uses spaces to indent their code shall be shot.


                                "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                                I Offline
                                I Offline
                                Ingo
                                wrote on last edited by
                                #16

                                Richard Deeming wrote:

                                Philistine!

                                And proud about it!

                                Richard Deeming wrote:

                                Allman style[^] is the only way to go.

                                Eh. In my eyes it's ridiculous. Thousand lines between the code that make it unreadable. X|

                                Richard Deeming wrote:

                                And while we're at it, it's tabs every time. Anyone who uses spaces to indent their code shall be shot.

                                Agree! :thumbsup:

                                SharePoint Consultant and Developer at acocon Author of Primary ROleplaying SysTem I'm the ninth in a row of seven!

                                H 1 Reply Last reply
                                0
                                • OriginalGriffO OriginalGriff

                                  Not always: I'm happy with

                                  if (a == 1 && b == 2)

                                  But I'd use em for

                                  if (a == 1 && (b == 2 || c == 3))

                                  Or

                                  if ((a == 1 && b == 2) || c == 3)

                                  Just to make it obvious what I meant.

                                  This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

                                  F Offline
                                  F Offline
                                  Freak30
                                  wrote on last edited by
                                  #17

                                  A colleage of mine always does if ((a == 1) && (b == 2)) while I always do if (i < (n - 1)) Fortunately regarding other styles we use the same format.

                                  The good thing about pessimism is, that you are always either right or pleasently surprised.

                                  OriginalGriffO 1 Reply Last reply
                                  0
                                  • G Gary Wheeler

                                    if (_Framework.DuplexPlatform)
                                    {
                                    Synchronize.Visibility = Visibility.Visible;
                                    }
                                    {
                                    Synchronize.Visibility = Visibility.Collapsed;
                                    }

                                    *face-palm*

                                    Software Zen: delete this;

                                    B Offline
                                    B Offline
                                    Bernhard Hiller
                                    wrote on last edited by
                                    #18

                                    Now I see: it is a ";" - and nothing else:

                                    if (_Framework.DuplexPlatform) ; // <= here the ; was missing
                                    {
                                    Synchronize.Visibility = Visibility.Visible;
                                    }
                                    {
                                    Synchronize.Visibility = Visibility.Collapsed;
                                    }

                                    G 1 Reply Last reply
                                    0
                                    • F Freak30

                                      A colleage of mine always does if ((a == 1) && (b == 2)) while I always do if (i < (n - 1)) Fortunately regarding other styles we use the same format.

                                      The good thing about pessimism is, that you are always either right or pleasently surprised.

                                      OriginalGriffO Offline
                                      OriginalGriffO Offline
                                      OriginalGriff
                                      wrote on last edited by
                                      #19

                                      Fortunately C# cured me of that one - it won't let you write

                                      if (1 && 2)

                                      Because that applies a boolean operation to two integers, so there is no confusion possible with

                                      if (a == 1 && b == 2)

                                      But in C and C++, I used to use the brackets as well! :laugh:

                                      This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

                                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                      1 Reply Last reply
                                      0
                                      • B Bernhard Hiller

                                        Now I see: it is a ";" - and nothing else:

                                        if (_Framework.DuplexPlatform) ; // <= here the ; was missing
                                        {
                                        Synchronize.Visibility = Visibility.Visible;
                                        }
                                        {
                                        Synchronize.Visibility = Visibility.Collapsed;
                                        }

                                        G Offline
                                        G Offline
                                        Gary Wheeler
                                        wrote on last edited by
                                        #20

                                        :laugh:

                                        Software Zen: delete this;

                                        1 Reply Last reply
                                        0
                                        • G Gary Wheeler

                                          if (_Framework.DuplexPlatform)
                                          {
                                          Synchronize.Visibility = Visibility.Visible;
                                          }
                                          {
                                          Synchronize.Visibility = Visibility.Collapsed;
                                          }

                                          *face-palm*

                                          Software Zen: delete this;

                                          B Offline
                                          B Offline
                                          Brisingr Aerowing
                                          wrote on last edited by
                                          #21

                                          What else would be missing? :-\

                                          Keep Clam And Proofread -- √(-1) 23 ∑ π... And it was delicious.

                                          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