December 2007
  Sun Mon Tue Wed Thu Fri Sat  
              1  
  2 3 4 5 6 7 8  
  9 10 11 12 13 14 15  
  16 17 18 19 20 21 22  
  23 24 25 26 27 28 29  
  30 31            

Archives

December 2009 (2)
November 2009 (4)
September 2009 (4)
August 2009 (2)
July 2009 (7)
June 2009 (9)
May 2009 (2)
April 2009 (4)
March 2009 (3)
February 2009 (2)
January 2009 (2)
December 2008 (2)
November 2008 (4)
October 2008 (6)
September 2008 (4)
August 2008 (1)
July 2008 (3)
June 2008 (5)
May 2008 (5)
April 2008 (7)
March 2008 (4)
February 2008 (2)
January 2008 (7)
December 2007 (9)
November 2007 (6)
October 2007 (3)
September 2007 (8)
August 2007 (5)

December 15, 2007

User-friendly Code

[en] The World-Wide Web has made the world a virtual community. What underpins the internet? Code. Programs. Programmers provide the threads of the web; they tie us all together, and give us the ability to communicate. Lately I've seen some really user-friendly code out there. User-friendly because a user may actually be able to read and understand it. The variables and comments can be read with ease, because they're in Esperanto. The finer points of English are beyond a lot of people, but anyone can learn and comprehend Esperanto. So when someone reads someone else's code that is commented in Esperanto, or even better, also has the variable names in Esperanto, the chances of understanding the functioning of the program are increased. An example is Paturage, which is a beautiful photo/document album.

[eo] La interreto ŝanĝis la mondon en virtualan komunumon. Kio estas la fundamenta framo de la interreto? Kodo. Programoj. Programistoj provizas la fadenojn de la reto; ili kunligas nin, kaj donas la eblon por komuniki. Lastatempe mi vidas kodon kiu vere estas afabla -- afabla ĉar oni ja havas ŝancon legi kaj kompreni ĝin. La variablojn kaj komentojn oni povas legi facile, ĉar ili estas en Esperanto. La subtilaĵoj de angla estas preter la kompreno de multaj personoj, sed ĉiu povas lerni kaj kompreni Esperanton. Tial, kiam vi legas kodon kiun programisto komentis en Esperanto, aŭ eĉ pli bone, ankaŭ havas Esperantigitajn variablonomojn, la ŝancoj ke vi komprenos la funkciadon de tiu programo pliiĝas. Jen, ekzemplo kiun mi donos estas Paturage, kiu estas bela foto/dokumentoalbumo:

$kunteksto = new PGKunteksto('lumbildo');

$datumbazo = new PGDatumbazo();

$datumbazo->konektu();

if($kunteksto->chuAdministristo()) {

// Laŭnecese, ĝisdatigu artiklon

if($kunteksto->leguArgumentonPriFarendaRedaktOperacio() != 'NENIO') {
require_once('redakta-kontrolisto.php');

ghisdatiguArtiklon();

}

}

$artiklo = $kunteksto->leguArgumentonPriArtiklo();

if(!$kunteksto->chuGasto() || !$artiklo->chuPrivata()) {

// Se vidigado estas permesita, kreu vidaĵon kaj vidigu la paĝon

$vidajho =PGFabriko::leguLumbildanVidajhonPorArtiklo($artiklo); $kadro = new PGLumbildoKadraVidajho($vidajho); $kadro->vidigu();

} else {

// Se vidigado ne estas permesita, reiru al la patra paĝo

// kaj vidigu erarmesaĝon

header("Location: ".$kunteksto->leguURLonAlPatraPagho('epriv')); }

 

 

 
Published at 15:07 / 1 comment / 1366 visits
This post is public

( 1 post )

 

Català | Čeština nové | 中文 | Deutsch | English | Español | Esperanto | Ελληνικά | Français | Galego | Italiano | Nederlands | Português | More...