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. Beautiful Code

Beautiful Code

Scheduled Pinned Locked Moved The Lounge
question
9 Posts 7 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.
  • O Offline
    O Offline
    outside cosmic
    wrote on last edited by
    #1

    I'm currently reading Beautiful Code Edited by Andy Oram, Greg Wilson (oreilly) It got me thinking, what's the most beautiful code I have every written. This is the best I could come up with 10 Print "you smell" 20 GOTO 10 I did think that the use of a goto seems to be unfavourable in the modern programming world so I updated it while(true) { console.writeLine("you smell"); } But it's just not as beautiful Anybody else remember any beautiful code from there younger years?

    T R S D P 5 Replies Last reply
    0
    • O outside cosmic

      I'm currently reading Beautiful Code Edited by Andy Oram, Greg Wilson (oreilly) It got me thinking, what's the most beautiful code I have every written. This is the best I could come up with 10 Print "you smell" 20 GOTO 10 I did think that the use of a goto seems to be unfavourable in the modern programming world so I updated it while(true) { console.writeLine("you smell"); } But it's just not as beautiful Anybody else remember any beautiful code from there younger years?

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      have you noticed we had a Coding Horrors Forum[^] ? you will find plenty and worst over there...

      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      1 Reply Last reply
      0
      • O outside cosmic

        I'm currently reading Beautiful Code Edited by Andy Oram, Greg Wilson (oreilly) It got me thinking, what's the most beautiful code I have every written. This is the best I could come up with 10 Print "you smell" 20 GOTO 10 I did think that the use of a goto seems to be unfavourable in the modern programming world so I updated it while(true) { console.writeLine("you smell"); } But it's just not as beautiful Anybody else remember any beautiful code from there younger years?

        R Offline
        R Offline
        Rocky Moore
        wrote on last edited by
        #3

        Remembing On .. Goto and On .. Gosub :)

        Rocky <>< Recent Blog Post: Only answer to fuel problems

        1 Reply Last reply
        0
        • O outside cosmic

          I'm currently reading Beautiful Code Edited by Andy Oram, Greg Wilson (oreilly) It got me thinking, what's the most beautiful code I have every written. This is the best I could come up with 10 Print "you smell" 20 GOTO 10 I did think that the use of a goto seems to be unfavourable in the modern programming world so I updated it while(true) { console.writeLine("you smell"); } But it's just not as beautiful Anybody else remember any beautiful code from there younger years?

          S Offline
          S Offline
          Simon P Stevens
          wrote on last edited by
          #4

          Beauty in code is archived through a combination of simplicity and scope. A beautiful piece of code should be serenely simple, easy to read and comprehend, but gigantic in scope, and detailed in it's intricacies. The classic example from mathematics: e^{i \pi} + 1 = 0[^] Simple, yet complex. I find this code[^] rather beautiful. It's symmetry makes it look simple, but the simplicity hides a depth of thought that it must have taken to arrange the pattern.

          vv < <
          2
          ^ v<
          v1<?>3v4
          ^ ^

          ?> ?>5^
          v v
          v9<?>7v6
          v v<
          8
          . > > ^
          ^<

          In applications I often find the parts of code that are most beautiful are those in library functions, or base parts of a framework. Small sections of code that provide the basis for an entire project.

          Simon

          J 1 Reply Last reply
          0
          • O outside cosmic

            I'm currently reading Beautiful Code Edited by Andy Oram, Greg Wilson (oreilly) It got me thinking, what's the most beautiful code I have every written. This is the best I could come up with 10 Print "you smell" 20 GOTO 10 I did think that the use of a goto seems to be unfavourable in the modern programming world so I updated it while(true) { console.writeLine("you smell"); } But it's just not as beautiful Anybody else remember any beautiful code from there younger years?

            D Offline
            D Offline
            Dy
            wrote on last edited by
            #5

            outside cosmic wrote:

            I'm currently reading Beautiful Code Edited

            I've been tempted to pick up a copy of that - is it any good?

            - Dy

            O 1 Reply Last reply
            0
            • D Dy

              outside cosmic wrote:

              I'm currently reading Beautiful Code Edited

              I've been tempted to pick up a copy of that - is it any good?

              - Dy

              O Offline
              O Offline
              outside cosmic
              wrote on last edited by
              #6

              I'm only about 4 chapters in. But what I have read so far I have enjoyed, it's not changed the way I think about code, just reassured me that other people also enjoy the elegance of code. I guess it's what makes me tick, seeing a complicated problem solved with simple code so that's why I'm enjoying it so much. (I also spend a lot of time looking at rubbish code so it makes a change to see some good code)

              1 Reply Last reply
              0
              • S Simon P Stevens

                Beauty in code is archived through a combination of simplicity and scope. A beautiful piece of code should be serenely simple, easy to read and comprehend, but gigantic in scope, and detailed in it's intricacies. The classic example from mathematics: e^{i \pi} + 1 = 0[^] Simple, yet complex. I find this code[^] rather beautiful. It's symmetry makes it look simple, but the simplicity hides a depth of thought that it must have taken to arrange the pattern.

                vv < <
                2
                ^ v<
                v1<?>3v4
                ^ ^

                ?> ?>5^
                v v
                v9<?>7v6
                v v<
                8
                . > > ^
                ^<

                In applications I often find the parts of code that are most beautiful are those in library functions, or base parts of a framework. Small sections of code that provide the basis for an entire project.

                Simon

                J Offline
                J Offline
                Johnny
                wrote on last edited by
                #7

                Simon Stevens wrote:

                I find this code[^] rather beautiful [some mumbo-jumbo cut]

                Beautiful hmmm? To be honest it looks like someone sneezed on the keyboard!

                S 1 Reply Last reply
                0
                • J Johnny

                  Simon Stevens wrote:

                  I find this code[^] rather beautiful [some mumbo-jumbo cut]

                  Beautiful hmmm? To be honest it looks like someone sneezed on the keyboard!

                  S Offline
                  S Offline
                  Simon P Stevens
                  wrote on last edited by
                  #8

                  Johnny ² wrote:

                  [some mumbo-jumbo cut]

                  :laugh: :laugh: I thought the same at first, but there's a kind of elegance to befunge that makes it very interesting. It's kind of like 2 dimensional assembly. Your program counter is a [x,y] coordinate, and you can dictate which direction it will run in. Totally useless, but interesting.

                  Simon

                  1 Reply Last reply
                  0
                  • O outside cosmic

                    I'm currently reading Beautiful Code Edited by Andy Oram, Greg Wilson (oreilly) It got me thinking, what's the most beautiful code I have every written. This is the best I could come up with 10 Print "you smell" 20 GOTO 10 I did think that the use of a goto seems to be unfavourable in the modern programming world so I updated it while(true) { console.writeLine("you smell"); } But it's just not as beautiful Anybody else remember any beautiful code from there younger years?

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

                    outside cosmic wrote:

                    code from there younger years

                    Waaay back in college, in a class on "Organization of Programming Languages", there was an exercise to implement a simple emulator (interpreter) for a retro- pseudo- card-oriented programming language. (From the textbook -- "Principles of Programming Languages, Second Edition", 1987, Bruce J. MacLennan) As I recall, I was the only one in the class to actually have a working implementation (in Pascal, early 1989 (I still have the source code, but it's undated (come to think of it, I was undated at that time too))). While I was unemployed in 2003 I wrote an implementation in C, I may yet write a C# implementation. Here's an example of a program:

                    +0000000000
                    +0000000001
                    +0000000002
                    +0000000003
                    +0000000004
                    +0000000005
                    +0000000006
                    +0000000007
                    +0000000008
                    -0000000000
                    +3009003002
                    -8009000000
                    +3009002003
                    -8009000000
                    -3009004002
                    -8009000000
                    -3009008003
                    -8009000000
                    +9999999999
                    -0000000000

                    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