[Qgis-user] coding practices (was: Re: Problems with ubuntu-unstable again)

Dave Peterson davep at iit.edu
Tue Jul 19 12:46:39 PDT 2016


Copied from QGIS-user Digest, Vol 125, Issue 51:

> Date: Mon, 18 Jul 2016 22:17:13 +0200
> From: "Bernd Vogelgesang" <bernd.vogelgesang at gmx.de>
> To: "qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>
> Subject: Re: [Qgis-user] Problems with ubuntu-unstable again
> Message-ID: <op.yktbyzuwl2i25i at bernd-terra-pc>
> Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes

> The download page for debian/ubuntu reflects the coders motto: Minimize  
> the code!
> But people who are not used to read code have really difficulties getting  
> the picture there.

<rant>

Speaking as a (retired) professional coder and also a comp sci instructor:  In that motto lies the root of many coding problems.  When writing code, all  too many coders try to optimize writing, but the best code is optimized for reading.  Each line of code is typically written once, but read many times after it is written:  By the original coder, whev he or she picks up the unfinished code and must add more code that has to play correctly with already written stuff.  By the next stuckee who has to add to it, if the original coder needs a follow-on.  Bt the guy who has to tie all these individual pieces into a coherent whole.  By the documenter.  Etc., ertc., etc.

Lazily writing code without regard for the subsequent readers may be initially faster, but the resulting illegible code winds up with more than its share of obscure patches and built-in, hard-to-find errors.  It's a disservice to every reader, not just those "not used to read[ing] code".

That motto encourages another fallacy:  A single coder trying to optimize each line of code will often not do as well as a good optimizing compiler.  Better to look at the almost-finished system and hand-optimize the few areas where it'll make some significant difference.

</ rant> 

--
Dave Peterson

davep at iit.edu





More information about the Qgis-user mailing list