Good code is as often ingenious as it appears to be obvious. Its elegance masks the programmer's labor, like a ballerina twirling on stage. Good code frequently makes comments unnecessary, yet they conveniently appear in complex passages to assist the reader. Good code reflects a programmer's agility in cycling between the macro and micro views of his code; better programmers are both astronomers and particle physicists. They are also artists.
Good code is equally usable by other coders and by users of the program. It is always the work of an optimist because it represents an investment for the future, a proud bet the coder's effort is worth it because his code will last. If it does, it will shine as good code does when it must be revisited by its author or someone else.
Like wine, good code sits in silence during its making. Aging code allows us to shape missing elements and recognize superfluous bits. Code reveals the intimate nature of its maker. It brings to light an author's thought processes and how he expresses them. Only good humans can write good code, people who care for their work, and for those who will use its result.
This is the code we used to create this chart:
//@version=4 //@author=LucF, for PineCoders study("Good Code", "", true, scale = scale.none, max_labels_count = 500) f_randomNumber(_range) => // [symbol=thx]Thx[/symbol] to Maestro (@RicardoSantos) for the initial code of this function. var _return = 1.0 + timenow _return := (3.14159 * _return % (bar_index + 1)) % _range i_charsPerLine = input(300, step = 50) i_lines = input(160, step = 50, maxval = 499) TEXT_LENGTH = 8 t = array.new_string(8) array.set(t, 0, "G") array.set(t, 1, "o") array.set(t, 2, "o") array.set(t, 3, "d") array.set(t, 4, "C") array.set(t, 5, "o") array.set(t, 6, "d") array.set(t, 7, "e") // Create i_lines strings of i_charsPerLine randomly selected characters from our array. if barstate.islast // Cover the chart with random pattern of characters. for _i = 1 to i_lines textLine = "" for _j = 1 to i_charsPerLine textLine := textLine + array.get(t, int(f_randomNumber(TEXT_LENGTH))) label.new(bar_index, _i, textLine, style = label.style_none, size = size.normal) // Overprint the larger text in the middle a few times to gain density. label.new(bar_index, i_lines / 2, "Good Code", style = label.style_none, size = size.huge, textcolor = color.blue) label.new(bar_index, i_lines / 2, "Good Code", style = label.style_none, size = size.huge, textcolor = color.black) label.new(bar_index, i_lines / 2, "Good Code", style = label.style_none, size = size.huge, textcolor = color.black)