Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« Improved Error Messages in PHP 5
Working with PHP 5 in Mac OS X 10.5 (Leopard) »

Keywords and Language Simplicity

October 11th, 2007

Well, I like programming language comparisons, so how could I resist this chart (via) promoting the simplicity of the io language by pointing out how few keywords it has. The interesting thing about this is that Java and PHP are tied on this measure of simplicity with 53 keywords. Perhaps that reflects Java’s heritage as a simplification of C++ (63 keywords) and PHP’s heritage as an amplification of C (37 keywords) toward a specific purpose? As usual, Perl is the poster child for language complexity. Ruby does well with 40 keywords. But, before the Ruby fans get too uppity about the simplicity of their language, they should contemplate the cat walked across the keyboard while I was holding down the shift key predefined variables that they inherited from Perl.

Filed Under

  • PHP

Related Posts

  • Extreme Simplicity
  • The Paradox of Choice
  • Zend PHP Framework not a rumor
  • Sometimes Plain Text is Best
  • James Gosling on PHP
You can leave a response, or trackback from your own site.

30 Responses to “Keywords and Language Simplicity”

  1. Stefan says:
    10/11/2007 at 3:10 pm

    The number of keywords is by no means a good metric for the simplicity of programming languages. PHP just has 53 keywords, fine, but what about the more than 5.000 built-in functions with their inconsistent names? Perl’s sort statement does the same as all the sort, ksort, rsort, asort, ursort functions in PHP. And where is the deeper distinction between a keyword and a built-in function? There is none. So this metric makes no sense.

  2. Stas Malyshev says:
    10/11/2007 at 3:26 pm

    I guess the Whitespace language, having just 3 keywords – space, tab and newline – is one of the most simple ones in existance. Brainfuck, having 8 keywords, comes close and both are so much simpler than PHP ;)

  3. PHPDeveloper.org says:
    10/12/2007 at 7:23 am

    Jeff Moore’s Blog: Keywords and Language Simplicity

  4. developercast.com » Jeff Moore’s Blog: Keywords and Language Simplicity says:
    10/12/2007 at 10:24 am

    [...] Moore has posted and shared an interesting graph showing something I’d never thought about comparing one [...]

  5. Jagan Nath says:
    10/26/2007 at 10:29 am

    I ma very much agree with Stas Malyshev as per my knowledge in this subject

  6. PHP Encoder says:
    2/28/2008 at 10:54 am

    What about assembler? Does it seems to be a simple language? :)

  7. minikperi says:
    3/28/2008 at 5:21 am

    i agree with Stefan . Java libriry have tousands of ready to use functions and classes. if you look for simlicity check prolog (logical prog. lang.) and haskell (functional prog. lang.).

  8. Handy says:
    4/10/2008 at 3:44 am

    Maybe it is the other way round. If you have many predefined and built-in functions it is easier to work with the language.

  9. Programmer says:
    8/26/2008 at 1:29 am

    @Stefan

    If by “built in function” you mean “a primitive” then yes there is most certainly a difference. A keyword is something defined in the language they may work under different rules then the language normally does.

    A primitive is just an ordinary function that happens to be implemented in another language as an optimization (e.g. we had a function for doing PGP encryption but it ran too slow so we coded it in C and provide a primitive for it).

  10. sergio says:
    11/17/2008 at 9:00 am

    Here is (one in a million) an example of a PHP builtin function: apache_request_headers(). And what we see there – a function, that is available only, if we are running PHP as an apache module. In another case – we need to parse _SERVER variable. Its a really weird way to work with HTTP in a language, that is made to work in a WEB environment. Even having a special function – PHP doesn’t make it simple ;)

  11. per Rechnung bestellen says:
    11/24/2008 at 12:32 pm

    Another example is the “SimpleXML” class…really simple functionality but not simple to use…:-(

  12. nokia says:
    7/30/2009 at 4:12 am

    If you have many predefined and built-in functions it is easier to work with the language.

  13. Smartphones says:
    3/31/2010 at 4:56 am

    cant you just try tu use the predefined classes and functions?

  14. web developments says:
    4/10/2010 at 1:38 am

    make more module base class it make your work more easy and save more time.

  15. gadget says:
    10/16/2010 at 8:08 am

    PHP lies about it’s keywords. If you try:

    true = 22;

    You’ll receive a syntax error. Same with false and null.

  16. living well dogpedic sleep system says:
    2/23/2011 at 7:14 pm

    Whats up very nice blog!! Guy .. Beautiful .. Wonderful .. I will bookmark your website and take the feeds additionally…I am glad to find so many useful info right here in the publish, we’d like work out extra techniques on this regard, thanks for sharing. . . . . .

  17. suneel kumar says:
    6/2/2011 at 3:32 am

    Hai guys,

    I hope that you will help to me on solving a problem i found actually when i am coding for yahoo Authentication. My Output will be like–
    I have a website and in that i want to add sign in with yahoo button. when guest visit my site and want to log in into my site, but don’t have an account from my domain.Then if he already have an account from yahoo then he can able to sign in with that yahoo id into my website. After the sign in process completed i have to retrieve the user details from yahoo and those details will have to be store into my database with a session id as unique user id.
    For this i was implemented the code but didn’t get the exact output what i want. So please help me by going thruogh my requirement and forward the code to my mail id suneelkumar438@gmail.com

  18. Immobilienkredit says:
    9/27/2011 at 1:52 pm

    Good web page I took up it directly to my bookmark

  19. Acheter Nike Air Max says:
    11/14/2011 at 2:04 am

    dédouanement. Bon de réduction peut être eu avec ces magasins si vous êtes disposé à régler pour les gants

  20. Chaussre Air Jordan says:
    11/14/2011 at 2:05 am

    vue de face montrant sur un fond blanc. Le visage doit être comprise entre 1 et 1 3 / 8 pouces à partir du menton au sommet de la tête. Chapeaux, coiffures et uniformes, sauf mot de vêtements religieux quotidiens ne peuvent pas être portés.

  21. Saurabh Kumar Singh says:
    11/17/2011 at 9:06 am

    very nice blog!! I will always use this blog and refer to my friends.

  22. mira oil says:
    11/22/2011 at 5:54 pm

    I’m often to running a weblog and i in fact admire your content. The write-up has certainly peaks my interest. I’m going to bookmark your website and maintain checking for new information.

  23. Jamison Urias says:
    1/1/2012 at 7:55 pm

    We’re a gaggle of volunteers and opening a new scheme in our community. Your website provided us with helpful info to paintings on. You’ve done an impressive activity and our whole neighborhood will be thankful to you.

  24. spa says:
    3/15/2012 at 11:45 am

    Applaud the themes published on this Blog. It would be helpful in the event that Articles & Remarks could deal with info on self improvement assist for example losing weight

  25. Hospedagem de sites a partir de R$ 9,99/mês, alugue sua loja virtual, registramos seu dominio... says:
    3/20/2012 at 7:19 pm

    You could certainly see your skills in the work you write. The world hopes for more passionate writers such as you who are not afraid to say how they believe. All the time go after your heart.

  26. find out about ufc weight classes says:
    3/21/2012 at 6:31 am

    My God! Amazing article, man. Thank you, but I full-fledged a problem with ur RSS. I do not know why, can not be consecutive. Does anycombined get rss duplicate problem? Anycombined who knows benign reply.Thnkx

  27. Jamel Whippie says:
    4/24/2012 at 3:09 pm

    Great post!
    I find “expand the Target Dependencies section” in “3. Link with Your Static Library”
    and “expand the Link Binaries with Libraries section” in
    “4. Add your Static Library as a Dependency”
    Guess it’s a small mistake.

  28. modest wedding dresses provo says:
    4/26/2012 at 2:55 am

    Some truly nice and utilitarian information on this site, likewise I believe the layout has good features.

  29. chambre d hotes bourgogne says:
    4/27/2012 at 9:56 pm

    I love your blog.. very nice colors and theme. Did you make this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to create my own blog and would like to find out where u got this from. thanks a lot

  30. Web Center Design.com - Campinas | Criacao de Sites | WebDesign | Publicidade | Propaganda | Marketing | Otimizacao de Sites | Logica Digital | Cartao de visita | Panfletos | Folders | Impressos | Grafica says:
    4/28/2012 at 5:31 pm

    Someone essentially assist to make critically posts I might state. This is the very first time I frequented your website page and so far? I amazed with the research you made to create this particular publish extraordinary. Magnificent job!

Leave a Reply

Click here to cancel reply.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

    Subscribe Feed
    Share Subscribe to this blog…
    Share Bookmark or share this page…
  • About

    My name is Jeff Moore. I'm a PHP programmer living in San Francico and working for a startup.

    More about me…

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (18)
    • Open Source (14)
    • PHP (99)
    • Software Design (29)
    • Usability (14)
    • Web Design (20)
  • Recent Comments

    • The Legality of Republishing RSS Feeds  28
      Tory Rennemeyer, eenicker, Reverse Phone Lookup [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  258
      Tuan Lal, Lavagem de estofados, Edward L. Kind [...]
    • php | tek 2008  36
      how to mend ice machine, Akademija Debelih, Odbacena [...]
    • goto in PHP  59
      kasor, Thomas Valdivieso, Murray Ziadie [...]
    • Firefox Extensions for Web Developers  33
      kasor, Website Design Toronto, mobila bistrita [...]
    • Why PHP is easier to learn than Java  68
      kasor, Justina Calvery, Guy Lipton [...]
    • Meta Tag Refresh Faux Paux  43
      html email templates, E-Juice Reviews, image [...]
    • Improved Error Messages in PHP 5  49
      Carroll Tina, Przeprowadzka, Emery Harari [...]
    • Benchmarking PHP's Magic Methods  33
      kayu oyunlar?,dora,oyun,oyna, Benjamin Bejjani, paypal website [...]
    • Microbenchmarks of single and double qouting.  24
      kefir grains minneapolis, sexshop dildo, tuim688 [...]
  • Recent Posts

    • Richard Thomas
    • ZendCon: Writing Maintainable PHP Code
    • Looking Towards the Cloud
    • Holiday Tech Support
    • Closures are coming to PHP
    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
  • Site

    • Archives
    • Log in
  • Search