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.

20 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. kim kardashian sex tape price says:
    3/12/2010 at 12:32 am

    Help me to find the, Buy kim kardashian sex tape [url=http://www.comicspace.com/kimkardashiansextape/#1]Buy kim kardashian sex tape[/url], 988134,

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

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

  15. 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.

  16. big tits at work says:
    5/13/2010 at 7:52 pm

    Only, big tits at work free, [url= http://boards.sonypictures.com/boards/member.php?u=79986 ]big tits at work free[/url], nzkhla,

  17. kevin says:
    5/17/2010 at 10:07 pm

    how can i do SEO

  18. Power says:
    5/30/2010 at 9:57 am

    That’s great, in my job just like you descriptioned.

  19. ubattery says:
    5/30/2010 at 10:56 am

    agreen much. come on more

  20. amy fisher sex tape says:
    7/14/2010 at 8:24 am

    :-( , http://www.earthday.org/users/42974 Cheapest amy fisher sex tape, abjslb,

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 (17)
    • Open Source (14)
    • PHP (98)
    • Software Design (29)
    • Usability (14)
    • Web Design (20)
  • Recent Comments

    • Programming Language Trends via Google  19
      Craigslist pva, jessica, Scott [...]
    • Looking Towards the Cloud  35
      bentonville multiple listing, cosmetic dental, Sam Brodish [...]
    • PHP versus ASP  8
      Marhta Blight, Ravi, Ryan Brooks [...]
    • How to Transfer Mac OS X Application Data between Computers  59
      Website Migration, harry the computer support guy, Dotty Salvage [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  157
      lehuuphuc, Robert Parthemer, Lingerie Intimate [...]
    • PHP Games  25
      jessica, Tennille Cranor at Chilli Plants, Lucas Ortell [...]
    • un-PEAR-ing  5
      jessica, Eugene Panin, Arnaud [...]
    • The Legality of Republishing RSS Feeds  23
      kevinxiao, Marissa Miscovich, Quick Student Loans [...]
    • Faster Page Loading  4
      jessica, angular cheilitis, Aaron Rosenfeld [...]
    • PDO versus MDB2  15
      jessica, kevinxiao, Gavin [...]
  • Recent Posts

    • 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
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)
  • Site

    • Archives
    • Log in
  • Search