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. Unique function name. Globally.

Unique function name. Globally.

Scheduled Pinned Locked Moved The Weird and The Wonderful
20 Posts 16 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.
  • L Offline
    L Offline
    Lutoslaw
    wrote on last edited by
    #1

    '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

    Yep, this is an actual function signature in production code. (Erlang)

    R B A B Sander RosselS 7 Replies Last reply
    0
    • L Lutoslaw

      '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

      Yep, this is an actual function signature in production code. (Erlang)

      R Offline
      R Offline
      RugbyLeague
      wrote on last edited by
      #2

      Makes more sense than some of the COBOL procedure and variable names I used to be faced with

      OriginalGriffO 1 Reply Last reply
      0
      • L Lutoslaw

        '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

        Yep, this is an actual function signature in production code. (Erlang)

        B Offline
        B Offline
        BillW33
        wrote on last edited by
        #3

        That does look to be a unique name, but certainly not the best choice of a method name; sadly not the worst method name I have ever seen either X|

        Just because the code works, it doesn't mean that it is good code.

        1 Reply Last reply
        0
        • L Lutoslaw

          '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

          Yep, this is an actual function signature in production code. (Erlang)

          A Offline
          A Offline
          Anurag Gandhi
          wrote on last edited by
          #4

          Hmm, Should be considered as a best practice in JavaScript kind of language. :laugh:

          Life is a computer program and everyone is the programmer of his own life.

          1 Reply Last reply
          0
          • L Lutoslaw

            '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

            Yep, this is an actual function signature in production code. (Erlang)

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

            :wtf: That's crazy! I am glad I don't use Erlang!

            What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

            M B 2 Replies Last reply
            0
            • B Brisingr Aerowing

              :wtf: That's crazy! I am glad I don't use Erlang!

              What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              Just reading the title of the reference book[^] confirms that I would want nothing to do with that!

              Never underestimate the power of human stupidity RAH

              H N 2 Replies Last reply
              0
              • L Lutoslaw

                '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

                Yep, this is an actual function signature in production code. (Erlang)

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

                Well crap, I've used that exact function name just yesterday... :sigh:

                Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.

                Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

                Regards, Sander

                1 Reply Last reply
                0
                • B Brisingr Aerowing

                  :wtf: That's crazy! I am glad I don't use Erlang!

                  What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                  B Offline
                  B Offline
                  Brady Kelly
                  wrote on last edited by
                  #8

                  Someone using that as a function name is certainly no fault of Erlang, but that of a coder who should by up on disciplinary proceedings.

                  Do what thou wilt shall be the whole of the Law. - Liber AL vel Legis 1:40, Aleister Crowley

                  D L 2 Replies Last reply
                  0
                  • B Brady Kelly

                    Someone using that as a function name is certainly no fault of Erlang, but that of a coder who should by up on disciplinary proceedings.

                    Do what thou wilt shall be the whole of the Law. - Liber AL vel Legis 1:40, Aleister Crowley

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

                    Brady Kelly wrote:

                    Someone using that as a function name is certainly no fault of Erlang, but that of a coder who should be up on disciplinary proceedingshanged by the neck until dead, then hung from the lamppost outside work as a warning to others.

                    FTFY :)

                    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
                    • L Lutoslaw

                      '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

                      Yep, this is an actual function signature in production code. (Erlang)

                      E Offline
                      E Offline
                      Ed Korsberg
                      wrote on last edited by
                      #10

                      I oddly like this. This function is presumably generated and used by some automated code generator and not something a human programmer would have to reference.

                      G L 2 Replies Last reply
                      0
                      • E Ed Korsberg

                        I oddly like this. This function is presumably generated and used by some automated code generator and not something a human programmer would have to reference.

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

                        Yes, but some poor schmuck may have to deal with it. There should be a way to generate a friendly unique name based on the original source construct that caused the name to be generated. If nothing else, it could be based on the source file path and line number, just as an example.

                        Software Zen: delete this;

                        1 Reply Last reply
                        0
                        • B Brady Kelly

                          Someone using that as a function name is certainly no fault of Erlang, but that of a coder who should by up on disciplinary proceedings.

                          Do what thou wilt shall be the whole of the Law. - Liber AL vel Legis 1:40, Aleister Crowley

                          L Offline
                          L Offline
                          Lutoslaw
                          wrote on last edited by
                          #12

                          Well, it's me who did it. It was approved by all coworkes though. In Erlang we have many single-use one-liner overloads to take advantage of pattern matching. Such code is repeated in so many places that this kind of joke doesn't really hurt anyone. More code:

                          compute_price('POST', [], User) ->
                          '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, User:role_atom()).

                          '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, some_atom) ->
                          {JsonProps, Product} = process_request(Req, User),
                          RangesFromJson = calendar_lib:json_ranges_to_month_records(proplists:get_value(<<"ranges">>, JsonProps)),
                          UserClickCounts = [ Range:click_count() || Range <- RangesFromJson],
                          ...

                          This is a very good language to implent any buisness logic or algorithms, but terrible if you try to interact with a front-end in web development

                          1 Reply Last reply
                          0
                          • M Mycroft Holmes

                            Just reading the title of the reference book[^] confirms that I would want nothing to do with that!

                            Never underestimate the power of human stupidity RAH

                            H Offline
                            H Offline
                            Herbie Mountjoy
                            wrote on last edited by
                            #13

                            I'm sure Yoda will understand that.

                            I may not last forever but the mess I leave behind certainly will.

                            1 Reply Last reply
                            0
                            • E Ed Korsberg

                              I oddly like this. This function is presumably generated and used by some automated code generator and not something a human programmer would have to reference.

                              L Offline
                              L Offline
                              Lutoslaw
                              wrote on last edited by
                              #14

                              Ed Korsberg wrote:

                              This function is presumably generated and used by some automated code generator

                              It's not.

                              1 Reply Last reply
                              0
                              • M Mycroft Holmes

                                Just reading the title of the reference book[^] confirms that I would want nothing to do with that!

                                Never underestimate the power of human stupidity RAH

                                N Offline
                                N Offline
                                nanovad
                                wrote on last edited by
                                #15

                                There's a similar book for learning Haskell, I believe. "Learn You a Haskell for Great Good"[^]

                                1 Reply Last reply
                                0
                                • L Lutoslaw

                                  '4d568c9e-cb32-4db1-a276-26cb06cc3f6f'(User, SomeVar)

                                  Yep, this is an actual function signature in production code. (Erlang)

                                  A Offline
                                  A Offline
                                  Amarnath S
                                  wrote on last edited by
                                  #16

                                  Not only that; there are three other functions, within the same file, with names:

                                  4d568c9e-cb32-4db1-a276-26cb06cc3f6**g(User, SomeVar),
                                  4d568c9e-cb32-4db1-a276-26cb06cc3f6
                                  h(User, SomeVar),
                                  4d568c9e-cb32-4db1-a276-26cb06cc3f6
                                  j**(User, SomeVar),

                                  Maybe they should add this functionality to Intellisense: string matching from the trailing end :-)

                                  1 Reply Last reply
                                  0
                                  • R RugbyLeague

                                    Makes more sense than some of the COBOL procedure and variable names I used to be faced with

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

                                    FORTRAN was always good too: six character variable and subroutine names...got a little cryptic in large projects. :laugh:

                                    Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

                                    "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

                                    R 1 Reply Last reply
                                    0
                                    • OriginalGriffO OriginalGriff

                                      FORTRAN was always good too: six character variable and subroutine names...got a little cryptic in large projects. :laugh:

                                      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

                                      R Offline
                                      R Offline
                                      RugbyLeague
                                      wrote on last edited by
                                      #18

                                      I wrote my first compiler in Fortran IV - that was fun

                                      F 1 Reply Last reply
                                      0
                                      • R RugbyLeague

                                        I wrote my first compiler in Fortran IV - that was fun

                                        F Offline
                                        F Offline
                                        Forogar
                                        wrote on last edited by
                                        #19

                                        FORTRAN IV... ah, that brings back old memories... not good ones, but old memories nonetheless!

                                        - I would love to change the world, but they won’t give me the source code.

                                        R 1 Reply Last reply
                                        0
                                        • F Forogar

                                          FORTRAN IV... ah, that brings back old memories... not good ones, but old memories nonetheless!

                                          - I would love to change the world, but they won’t give me the source code.

                                          R Offline
                                          R Offline
                                          RugbyLeague
                                          wrote on last edited by
                                          #20

                                          arrays of 16 bit integers to store strings and bit shifting and masking to access individual characters. Always fun

                                          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