1) A good module/namespace/package system. Polluting a global namespace is a terrible idea. Sometimes you’ll see a function in code and have no context for where it’s coming from and it could very likely be ambiguous in a language like php.
2) Static Typing is a required feature despite the increased verbosity because it makes functions well-defined. They take very specific inputs and produce very specific outputs. Without this restriction you must rely on the programmer to not make the mistake of returning different types. For example, in Elgg core which is written in php, a function that fetches objects will either return an array of objects or… false. If you write code that uses this function it’s retarded to write a special case check for “false” instead of iterating over an empty array.
3) Regular expressions and strings library – doing this stuff by hand is a pain in the ass and has been done a million times. Every language should make this extremely easy to do and special case it so its not ridiculously verbose to do as well. (ahem, Java).
4) First class/anonymous functions – this allows for some particularly simple code. e.g. map(func(x){},array()) turns multiline code into one line. It also allows for concurrency, i.e. concurrent_map(heavy_function, big_array);
5) Large, well written library – why rewrite the wheel?
6) Community/Open Source – learn how to write this language well by reading others code.
…and more to come
0 Responses to “What Makes a Good Programming Language”