Monday, December 19, 2016

Why is PHP so complex?

1. This is Hello World in Assembly Language:
  1. .model small
  2. .stack 100h
  3.  
  4. .data
  5. msg db 'Hello world!$'
  6.  
  7. .code
  8. start:
  9. mov ah, 09h
  10. lea dx, msg
  11. int 21h
  12. mov ax, 4C00h ;
  13. int 21h
  14. end start
2. This is Hello World in C++:
  1. #include <iostream>
  2.  
  3. int main() {
  4. std::cout << "Hello world!\n";
  5. }
3. This is Hello World in PHP:
  1. <?php
  2. print "Hello world!";
  3. ?>
4. This is Hello World in the Big Bang Theory:
From #1 to #3Complexity should not be defined by how many lines of codes an application contains. On the contrary, each language, from #1 to #3, is least complex and makes better applications if used in the right context. For example:
#1. Assembly writes better CPU/GPU processes,
#2. C++ writes better operating systems and video games,
#3. PHP … let’s just say … is versatile and practised by a huge community.
In the wrong context, any languages could become complex. For example, it is difficult and impractical to make a corporate website with Assembly and a video game with PHP. Programming is easiest when the right languages and tool sets are used (see also JavaJavaScriptPythonC language family and Haskell).
Between #3 and #4. Human language is still the most beautiful language ever. Our mind can interpret Hello World in both pictures and letters - more accurately than any computers or computer languages. How is that even possible is another topic all by itself. Yet, that is not to say that human language is not complex. It is.
I look forward to a day when we have the ability to program in human gestures and native languages. Meanwhile, between #3 and #4, that’s the next best thing we have.

No comments:

Post a Comment