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. The Lounge
  3. Old code challenge - Today's longest function

Old code challenge - Today's longest function

Scheduled Pinned Locked Moved The Lounge
comquestioncode-reviewlearning
24 Posts 14 Posters 2 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.
  • T tom_dx

    you can't really measure a function since you can include all your code inline in the main() function so you can't really say how much a function has lines + diff people have diff. styles like: int add(int i, int j) { return i + j; } OR int add(int i, int j) { int temp = 0; temp = i + j; return temp; } see the first function does everything that the second one does but has 3x's less lines... see what i mean?:-D IM PROUD TO BE A GMAIL;

    B Offline
    B Offline
    bryce
    wrote on last edited by
    #4

    lets see function start void Optimize() //line 100 in the editor function closing brace "}" found on line 1809 pretty straight forward maths to me its only a bit of fun anyway Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
    Publitor, making Pubmed easy. http://www.sohocode.com/publitor

    Our kids book :The Snot Goblin

    T 1 Reply Last reply
    0
    • B bryce

      lets see function start void Optimize() //line 100 in the editor function closing brace "}" found on line 1809 pretty straight forward maths to me its only a bit of fun anyway Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
      Publitor, making Pubmed easy. http://www.sohocode.com/publitor

      Our kids book :The Snot Goblin

      T Offline
      T Offline
      tom_dx
      wrote on last edited by
      #5

      read my last post again anyways, it must be a pain to debug or 'optimize' your function lol ;P IM PROUD TO BE A GMAIL;

      B L 2 Replies Last reply
      0
      • T tom_dx

        read my last post again anyways, it must be a pain to debug or 'optimize' your function lol ;P IM PROUD TO BE A GMAIL;

        B Offline
        B Offline
        bryce
        wrote on last edited by
        #6

        :rolleyes: yeah i'm not going to even bother ;) madness, total madess Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
        Publitor, making Pubmed easy. http://www.sohocode.com/publitor

        Our kids book :The Snot Goblin

        T 1 Reply Last reply
        0
        • B bryce

          The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
          Publitor, making Pubmed easy. http://www.sohocode.com/publitor

          Our kids book :The Snot Goblin

          S Offline
          S Offline
          Shog9 0
          wrote on last edited by
          #7

          Yeouch! :omg: Thought i had a long one at just over 500 lines... :~
          "The time has come," the Walrus said, "To talk of many things..."

          1 Reply Last reply
          0
          • B bryce

            :rolleyes: yeah i'm not going to even bother ;) madness, total madess Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
            Publitor, making Pubmed easy. http://www.sohocode.com/publitor

            Our kids book :The Snot Goblin

            T Offline
            T Offline
            tom_dx
            wrote on last edited by
            #8

            oh well in good spirit i checked out one of my functions and one of them has a little bit over 10 lines, i converted to .net :rolleyes:, but i remember i used to do graphics programming alot with dx and c++, ( not managed) and i had one function, still have it, that it initializes the mode, sorry, off topic anyways it had about 200 lines, still looking for other functions, i know i had longer ones ;P, damn now im addicted:-D IM PROUD TO BE A GMAIL;

            1 Reply Last reply
            0
            • B bryce

              The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
              Publitor, making Pubmed easy. http://www.sohocode.com/publitor

              Our kids book :The Snot Goblin

              P Offline
              P Offline
              paulb
              wrote on last edited by
              #9

              Heh I got one here thats 14819 lines its written in C for an embedded system can you believe and is absolutely full of #ifdefs which makes it a nightmare to try and understand

              L J 2 Replies Last reply
              0
              • T tom_dx

                read my last post again anyways, it must be a pain to debug or 'optimize' your function lol ;P IM PROUD TO BE A GMAIL;

                L Offline
                L Offline
                l a u r e n
                wrote on last edited by
                #10

                errrrr i dont understand what ur trying to say? if a function has 2000 lines in the source file between start and end then its 2000 lines long ... nobody is trying to say whether its written well or not??!! sheesh


                "there is no spoon"
                biz stuff about me

                P 1 Reply Last reply
                0
                • P paulb

                  Heh I got one here thats 14819 lines its written in C for an embedded system can you believe and is absolutely full of #ifdefs which makes it a nightmare to try and understand

                  L Offline
                  L Offline
                  l a u r e n
                  wrote on last edited by
                  #11

                  a single function? 14000+ lines long? not 13999 lines of whitespace and 1 line of code? :wtf:


                  "there is no spoon"
                  biz stuff about me

                  B 1 Reply Last reply
                  0
                  • B bryce

                    The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                    Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                    Our kids book :The Snot Goblin

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #12

                    Wow - I was recently asked to work on some code and the first thing I insisted on was the right to refactor an 800 line function before adding to it. 1709 has got to be some sort of record. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                    B 1 Reply Last reply
                    0
                    • L l a u r e n

                      a single function? 14000+ lines long? not 13999 lines of whitespace and 1 line of code? :wtf:


                      "there is no spoon"
                      biz stuff about me

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

                      stop being cheeky lauren ;) Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                      Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                      Our kids book :The Snot Goblin

                      L 1 Reply Last reply
                      0
                      • C Christian Graus

                        Wow - I was recently asked to work on some code and the first thing I insisted on was the right to refactor an 800 line function before adding to it. 1709 has got to be some sort of record. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                        B Offline
                        B Offline
                        bryce
                        wrote on last edited by
                        #14

                        i can post if if you like, but i think paul has a bigger one with his post ;) Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                        Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                        Our kids book :The Snot Goblin

                        T 1 Reply Last reply
                        0
                        • B bryce

                          stop being cheeky lauren ;) Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                          Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                          Our kids book :The Snot Goblin

                          L Offline
                          L Offline
                          l a u r e n
                          wrote on last edited by
                          #15

                          :rolleyes:


                          "there is no spoon"
                          biz stuff about me

                          1 Reply Last reply
                          0
                          • B bryce

                            i can post if if you like, but i think paul has a bigger one with his post ;) Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                            Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                            Our kids book :The Snot Goblin

                            T Offline
                            T Offline
                            tom_dx
                            wrote on last edited by
                            #16

                            go ahead. IM PROUD TO BE A GMAIL;

                            1 Reply Last reply
                            0
                            • B bryce

                              The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                              Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                              Our kids book :The Snot Goblin

                              E Offline
                              E Offline
                              El Corazon
                              wrote on last edited by
                              #17

                              I probably do, but finding it may be difficult. I will have to find a function analyzer to see.... I've only got a decade's worth of code in one project. A header function documentation extraction (similar to doxygen) overran a 4 inch binder last year. _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                              1 Reply Last reply
                              0
                              • B bryce

                                The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                                Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                                Our kids book :The Snot Goblin

                                S Offline
                                S Offline
                                spsharma
                                wrote on last edited by
                                #18

                                135 only :( :(

                                1 Reply Last reply
                                0
                                • B bryce

                                  The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                                  Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                                  Our kids book :The Snot Goblin

                                  E Offline
                                  E Offline
                                  El Corazon
                                  wrote on last edited by
                                  #19

                                  I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? uhhh... If I remove the header comment from DrawCallback() it is 1710 lines, it is the most important function I am currently using too. (and has 2 gotos) X| It calls another function (yes it actually calls functions too) that is 786 lines long. (and it has 3 gotos) X| Networking thread is 1386 lines AppProcessing has to have been rewritten (I just don't remember doing it) as it is a measly 732 lines long. (and neither have gotos) that's from a quick 3 minute perusal. _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                                  1 Reply Last reply
                                  0
                                  • B bryce

                                    The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                                    Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                                    Our kids book :The Snot Goblin

                                    P Offline
                                    P Offline
                                    peterchen
                                    wrote on last edited by
                                    #20

                                    May I check back tomorrow @ work? I have a few (!) files containing basically gargantous switch statements of copypasted code. I know that for one, the whole file is >3.5K lines. Duno the actual funciton though.


                                    we are here to help each other get through this thing, whatever it is Vonnegut jr.
                                    boost your code || Fold With Us! || sighist | doxygen

                                    1 Reply Last reply
                                    0
                                    • B bryce

                                      The rules: The longest function you can find , must be in old code code you're working on _today_ I've got here a Function called "Optimize" in the code i'm working on - its 1709 lines long, can anyone beat that ? Bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
                                      Publitor, making Pubmed easy. http://www.sohocode.com/publitor

                                      Our kids book :The Snot Goblin

                                      A Offline
                                      A Offline
                                      Anna Jayne Metcalfe
                                      wrote on last edited by
                                      #21

                                      :wtf: I have this strange urge to indulge in a bit of knife throwing practice when I see code like that!! ;) Anna :rose: Riverblade Ltd - Software Consultancy Services Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                                      1 Reply Last reply
                                      0
                                      • P paulb

                                        Heh I got one here thats 14819 lines its written in C for an embedded system can you believe and is absolutely full of #ifdefs which makes it a nightmare to try and understand

                                        J Offline
                                        J Offline
                                        Jorgen Sigvardsson
                                        wrote on last edited by
                                        #22

                                        14819 lines!? That's a small application all by itself. Is it main()? ;) -- Weiter, weiter, ins verderben. Wir müssen leben bis wir sterben. I blog too now[^]

                                        1 Reply Last reply
                                        0
                                        • L l a u r e n

                                          errrrr i dont understand what ur trying to say? if a function has 2000 lines in the source file between start and end then its 2000 lines long ... nobody is trying to say whether its written well or not??!! sheesh


                                          "there is no spoon"
                                          biz stuff about me

                                          P Offline
                                          P Offline
                                          Paul Watson
                                          wrote on last edited by
                                          #23

                                          I am sure someone could re-write your post in one line... ;) regards, Paul Watson South Africa Michael Dunn wrote: "except the sod who voted this a 1, NO SOUP FOR YOU" Crikey! ain't life grand?

                                          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