Digest Number 269
2 messages · 2005-05-07 → 2005-05-07 · Yahoo Group era · View archive on archive.org
Participants: Scott A. Rossell, James Diffendaffer
Preserved from the Timex/Sinclair 2068 Yahoo Group (2001–2019), which is no longer online. Text reproduced from the archive.org archive; email addresses masked.
Messages
1. RE: [ts2068] Digest Number 269
Scott A. Rossell · Sat, 7 May 2005 08:44:
On the contrary Mr. D., I believe Mr. Krampitz's use of the world "elegant"
was precisely correct. The exact mentality a coder should have about his
work - code as art.
Elegant: Characterized by or exhibiting refined, tasteful beauty of manner,
form, or style. As in 'elegant handwriting' or 'an elegant mathematical
solution'--simple, precise and lucid.
http://dictionary.reference.com/search?q=elegant
I grant that elegant code can sometimes appear very cryptic in purpose when
attempting to determine it's flow of operation. That's what proper REMarks
are for; to document the code.
I took part in a programming contest back in 1985 where several objectives
were defined of varying difficulty that were to be achieved with the least
amount of code BUT must also be fully documented within the code. It became
a very interesting exercise of balance between extreme coding and lucid
documentation. The solutions that came from this exercise were astonishing.
(Similar to the recent one-line Linux code that decodes DVD's). In the end,
it was agreed that the solutions using the absolute least amount of code
could afford to be documented in detail and still achieve a significant
memory savings. Of course this was twenty years ago when RAM was measured
in K's and not Gig's.
I wish more programmers today thought of themselves as elegant artists of
code and prided themselves on their work. I'm sure there must be some out
there somewhere; just not at Microsoft.
2. Re: Digest Number 269
James Diffendaffer · Sat, 07 May 2005 19:10
--- In [email], "Scott A. Rossell" <scott@r...> wrote:
> On the contrary Mr. D., I believe Mr. Krampitz's use of the world
"elegant"
> was precisely correct. The exact mentality a coder should have
about his
> work - code as art.
>
> Elegant: Characterized by or exhibiting refined, tasteful beauty of
manner,
> form, or style. As in 'elegant handwriting' or 'an elegant mathematical
> solution'--simple, precise and lucid.
>
> http://dictionary.reference.com/search?q=elegant
>
> I grant that elegant code can sometimes appear very cryptic in
purpose when
> attempting to determine it's flow of operation. That's what proper
REMarks
> are for; to document the code.
I really do understand what you are getting at and to some extent I
agree. I belive the phrase 'code as art' is definately appropriate.
Where I disagree is simple.
Code could be considered elegant as far as that BASIC is concerned but
what a programmer is forced to do to make up for limitations in the
language looks downright ugly IF you compare it to later BASICs or
other languages. Without local variables, scope limits, long variable
names, structures, subroutine parameters, return codes, recursion,
objects (if taken to the extreem), etc... a programmer has to make the
code more complex and downright ugly by comparison.
Most of the code is poorly documented. Often it's not because of
lazyness (ok, some was lazyness) but because people couldn't sqeeze
everything into memory with them still in the code. I realize not all
code was that way but I think overall it was. Perhaps I'm looking at
it that way because of the extensive use of documentation I'm used to
seeing in code. With a compiled language you can add all the
documentation you want and it doesn't make the final code any larger.
There's nothing to discourage you from properly documenting code and
code reviews make it manditory.
Elegant:
(From Mathematics) Combining simplicity, power, and a certain
ineffable grace of design. Higher praise than "clever",
"winning" or even cuspy.
I think the Mathematics definition would be most appropriate if you
mean simplicity, power and grace of design as far as *that* BASIC
goes. As far as languages as a whole... no.
> I took part in a programming contest back in 1985 where several
objectives
> were defined of varying difficulty that were to be achieved with the
least
> amount of code BUT must also be fully documented within the code.
Sadly, most people didn't apply documentation rules to their code.
>It became
> a very interesting exercise of balance between extreme coding and lucid
Carefull... "extreme coding" seems to have a number of meanings these
days. I think it's most commonly used as a methodology term for a
form of Rapid Application Development. There seems to be disagreement
beyond that as to what it is.
I don't care for the term. I think it was made up by a bunch of
programmers that wanted to sound cool. It's been done for decades.
> I wish more programmers today thought of themselves as elegant
artists of
> code and prided themselves on their work. I'm sure there must be
some out
> there somewhere; just not at Microsoft.
LOL, no arguments on the Microsoft jab!
Actually, a lot of programmers do think of themselves as code artists.
Sadly comparing most of them to true code artists is like comparing a
child's stick figure to a (fill in the name of any classic artist).
I knew one kid that thought he was a programming genious but he didn't
even know how to sort data... not even a bubble sort.
At MCI I maintained part of a system they were using. It was
originally designed by a team of over 10 people including several
"gurus". It supposedly wouldn't require any changes to the design,
just updates for new stuff. After months of requests a manager
finally let me rewrite my module. In 6 hours (at the most... I had to
wait for the printouts) I cut the executable size by over 25%. It
ended up saveing over 11MB of RAM in the production environment
without adding a single bug. That part was just proper OO
implementation. The 500 times speedup I threw in was art! ;) I could
understand them missing the speedup but there was no excuse for the
poor OO implementation.