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. Don't know whether it's weird, or wonderful

Don't know whether it's weird, or wonderful

Scheduled Pinned Locked Moved The Weird and The Wonderful
12 Posts 8 Posters 1 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.
  • P Offline
    P Offline
    phil o
    wrote on last edited by
    #1

    I just replaced

    Math.PI

    with

    Trigo.π

    Trigo being a static class and π a const double. It works for ϕ (the Golden Number) also. I tried that with ℮ also (the base of natural logarithms), but this is not a valid identifier character.

    I never finish anyth

    D D P 3 Replies Last reply
    0
    • P phil o

      I just replaced

      Math.PI

      with

      Trigo.π

      Trigo being a static class and π a const double. It works for ϕ (the Golden Number) also. I tried that with ℮ also (the base of natural logarithms), but this is not a valid identifier character.

      I never finish anyth

      D Offline
      D Offline
      Daniel Pfeffer
      wrote on last edited by
      #2

      X| If this becomes widespread, reading code will be even more difficult than it is now. Leaving aside Chinese ideograms, Kanji, etc., how many of you would understand the following code (not the algorithm, its purpose):

      double[] מחיר = new double[100];
      double[] כמות = new double[100];
      ...

      double סהכ;
      for (auto אינדקס ;100 > אינדקס ;0 = אינדקס++)
      [אינדקס]מחיר * [אינדקס]כמות =+ סהכ;

      Do we really want to have to read code with Google Translate open in a separate window?

      If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

      P Kornfeld Eliyahu PeterK N N 4 Replies Last reply
      0
      • D Daniel Pfeffer

        X| If this becomes widespread, reading code will be even more difficult than it is now. Leaving aside Chinese ideograms, Kanji, etc., how many of you would understand the following code (not the algorithm, its purpose):

        double[] מחיר = new double[100];
        double[] כמות = new double[100];
        ...

        double סהכ;
        for (auto אינדקס ;100 > אינדקס ;0 = אינדקס++)
        [אינדקס]מחיר * [אינדקס]כמות =+ סהכ;

        Do we really want to have to read code with Google Translate open in a separate window?

        If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

        P Offline
        P Offline
        phil o
        wrote on last edited by
        #3

        That's not a Math.PI replacement proposal, is it? I was just exploring aroung Unicode and variable names and found out that using greek letter is allowed for identifiers. But I'm not saying that it should be done. Of course having localized variable names would be a nightmare.

        I never finish anyth

        D 1 Reply Last reply
        0
        • P phil o

          I just replaced

          Math.PI

          with

          Trigo.π

          Trigo being a static class and π a const double. It works for ϕ (the Golden Number) also. I tried that with ℮ also (the base of natural logarithms), but this is not a valid identifier character.

          I never finish anyth

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

          Using escape characters is also fun:

          public const double \u0050\u0049 = 3.14;
          public const double PI = 3.14; //error CS0102: The type `Test' already contains a definition for `PI'

          P 1 Reply Last reply
          0
          • P phil o

            That's not a Math.PI replacement proposal, is it? I was just exploring aroung Unicode and variable names and found out that using greek letter is allowed for identifiers. But I'm not saying that it should be done. Of course having localized variable names would be a nightmare.

            I never finish anyth

            D Offline
            D Offline
            Daniel Pfeffer
            wrote on last edited by
            #5

            phil.o wrote:

            That's not a Math.PI replacement proposal

            I stand corrected. I thought that this was something that you had actually encountered in production code. :omg:

            If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

            1 Reply Last reply
            0
            • D Dennis_E

              Using escape characters is also fun:

              public const double \u0050\u0049 = 3.14;
              public const double PI = 3.14; //error CS0102: The type `Test' already contains a definition for `PI'

              P Offline
              P Offline
              phil o
              wrote on last edited by
              #6

              That pretty much leads to code obfuscation :) Even π is more readable than \u03C0. But, again, I don't want to defend the use of extended unicode characters for type and member names. That was just a trial-for-fun, I'm exploring C# 6.

              I never finish anyth

              1 Reply Last reply
              0
              • D Daniel Pfeffer

                X| If this becomes widespread, reading code will be even more difficult than it is now. Leaving aside Chinese ideograms, Kanji, etc., how many of you would understand the following code (not the algorithm, its purpose):

                double[] מחיר = new double[100];
                double[] כמות = new double[100];
                ...

                double סהכ;
                for (auto אינדקס ;100 > אינדקס ;0 = אינדקס++)
                [אינדקס]מחיר * [אינדקס]כמות =+ סהכ;

                Do we really want to have to read code with Google Translate open in a separate window?

                If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu Peter
                wrote on last edited by
                #7

                I do! :laugh:

                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                1 Reply Last reply
                0
                • P phil o

                  I just replaced

                  Math.PI

                  with

                  Trigo.π

                  Trigo being a static class and π a const double. It works for ϕ (the Golden Number) also. I tried that with ℮ also (the base of natural logarithms), but this is not a valid identifier character.

                  I never finish anyth

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #8

                  No! No public single-character identifiers! :omg:

                  P 1 Reply Last reply
                  0
                  • P PIEBALDconsult

                    No! No public single-character identifiers! :omg:

                    P Offline
                    P Offline
                    phil o
                    wrote on last edited by
                    #9

                    I know :)

                    I never finish anyth

                    1 Reply Last reply
                    0
                    • D Daniel Pfeffer

                      X| If this becomes widespread, reading code will be even more difficult than it is now. Leaving aside Chinese ideograms, Kanji, etc., how many of you would understand the following code (not the algorithm, its purpose):

                      double[] מחיר = new double[100];
                      double[] כמות = new double[100];
                      ...

                      double סהכ;
                      for (auto אינדקס ;100 > אינדקס ;0 = אינדקס++)
                      [אינדקס]מחיר * [אינדקס]כמות =+ סהכ;

                      Do we really want to have to read code with Google Translate open in a separate window?

                      If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                      N Offline
                      N Offline
                      Nicolas Dorier
                      wrote on last edited by
                      #10

                      at least you don't need to spend money on an obfuscator.

                      D 1 Reply Last reply
                      0
                      • N Nicolas Dorier

                        at least you don't need to spend money on an obfuscator.

                        D Offline
                        D Offline
                        Dan Neely
                        wrote on last edited by
                        #11

                        Dunno about that, if I had to work on that codebase, I think starting by running it through a bottom end obfuscator that replaced all the variables with 'a', 'b', 'c', etc. would be a good start.

                        Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                        1 Reply Last reply
                        0
                        • D Daniel Pfeffer

                          X| If this becomes widespread, reading code will be even more difficult than it is now. Leaving aside Chinese ideograms, Kanji, etc., how many of you would understand the following code (not the algorithm, its purpose):

                          double[] מחיר = new double[100];
                          double[] כמות = new double[100];
                          ...

                          double סהכ;
                          for (auto אינדקס ;100 > אינדקס ;0 = אינדקס++)
                          [אינדקס]מחיר * [אינדקס]כמות =+ סהכ;

                          Do we really want to have to read code with Google Translate open in a separate window?

                          If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                          N Offline
                          N Offline
                          Nguyen H H Dang
                          wrote on last edited by
                          #12

                          Im working at Japan, so 1 day my task is review some code of the internship, and he naming variables with Kanji (im not Japanese). Its like a pain in the a.. :doh:

                          In code we trust !

                          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