Other Software > Developer's Corner
Is Beautiful Code A Succubus
mrainey:
Is "beautiful code" the same thing as "elegant code"?
mouser:
Is "beautiful code" the same thing as "elegant code"?
--- End quote ---
yes.
app103:
Thank you. I am glad someone has finally given me an answer that makes sense and doesn't confuse me more.
jgpaiva:
According to my teachers, good code follows several aspects:
- readability: a glance at the code can give you a general idea of the behaviour of the program)
- self-describing names (variables and functions): a += temp3; isn't good code ;)
- traceability: when you look at a function, you can have some idea of where it's used
- following of norms (depending on company/language, the indentation/names of variables can change)
- small, self-describing functions: each function should only be responsible for one part of the program
- disconnected components: so that you can replace components without affecting the others <- this is directly related to OO programming. using setters and getters is a better idea then accessing directly to the contents of other objects
- organized code: the program should be read in the source file from top to bottom of the source
This is all i can remember from the top of my head. I'm sure others could add a more complete answer :)
Eóin:
You gotta be careful though, good code is not necessarily beautiful. Beautiful is only a subset of good code!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version