Beautiful Code
-
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?
-
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?
have you noticed we had a Coding Horrors Forum[^] ? you will find plenty and worst over there...
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
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?
Remembing On .. Goto and On .. Gosub :)
Rocky <>< Recent Blog Post: Only answer to fuel problems
-
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?
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
-
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?
-
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
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)
-
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
-
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!
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
-
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?
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