Tuesday, August 17, 2010

What Programming Languages contribute

Each programming language should contribute something new to the programming world, like some kind of new element to the structure of a program, to name a example. An inconvenient I have is that I still see sequential solutions easier to find than a structured ones.

My programming rabbit hole started when I was 14, with slight touches toMS-DOS command prompt. Then I lightly met FoxPro, then COBOL, until I hit Turbo Basic.

I learned that Assembly Language existed, the one I consider the genesis of imperative programming language style. When you notice that Assembler is essentially data movement and comparison, it's hard to imagine something like Warcraft coded in this language. Some time ago I learned that programs are based in a theoretical Turing Machine.

When I saw function and sub statements in QBASIC and the list of commands of the Help, I knew that something different was comming. Something called procedural or structured programming. In college, I saw DBASE III Plus (which I compared with FoxPro), Turbo Pascal and Borland C. I saw in the last two some resemblances to QBASIC, but declaring variables and importing libraries where something new to me.

In the university I learned what was the real importance of C and Pascal, why GOTO is evil, complex typedef struct, and recursion, that by itself was something too abstract for me, not to mention the fact that it's needed for some sorting algorithms (also abstract) like Quick Sort. I wish I had met SmallTalk and LISP at this time... I feel power and flexibility in LISP, but I still neither understand it, nor its macros.

In 1995, the first language I saw after QBASIC was HTML, but I didn't see some statements (no conditions, no loops, no variables). So HTML was not programming language for me, and I rejected it until I learned about JavaScript. Something interesting that I learned with JavaScript is that you can "store" function definitions in variables, but later I learned that what gets stored is a reference, and that C allowed this kind of assigment. About JavaScript events, I heard of the event concept with Visual Basic (QBASIC successor) and Delphi (Pascal's).

OOP... What a headache!! I was doing a lot of HTML, CSS, JavaScript and PHP, before I learned about OOP and Java. I saw C++ before, but I never saw something about Object-Oriented Programming on it. I learned that SmallTalk was an older OOP language than Java. Inheritance, abstraction, polymorphism, encapsulation, imports (I took them like includes, but later I learned that they are namespaces!), collections, threads, bytecodes, and patterns: all of these were part of the tsunami that Java was for me. Some interesting things that I tested with Java for Eclipse were Test-Driven Development and Source Navigation (like navigation in Internet)

If something was difficult after starting to learn Java, it was to learn CakePHP and the concept of MVC Frameworks. It's nice to jail a group of developers into conventions, but the problem is when the framework doesn't provide what you need in a way that is easy, accesible and well documented.

A problem I get with JavaScript is when I want to access some local variable, inside a function called from another function. In C# there is something called closures, designed to avoid this kind of problems.

I wanted to experiment something new, so I looked into Ruby, and then Python. I choose Python because of how it does things and it tends toward procedural and imperative styles easier. Not to mention Python IDLE. What I discovered is that code blocks are delimited by tabs or spaces, but the flexibility of its dynamic typing was a good pay-off for me. I later knew that FORTRAN was also space-delimited for code blocks. Python use import for namespaces, but here, they are are real plus!

The first time I heard the term lambda was when I learned what is the Haskell language. This is a concept vaguely experimented by me, but it's a pending one.

ASSEMBLY speed never will be 100% matched by compiled languages, but his drawback is his bad programming productivity.

FORTRAN was the most used language for Math.
LISP seems so flexible and so abstract that it looks boring.
C focus on Implementations to increase Portability.
SmallTalk was the first famous OOP language.

Now we have Haskell, Scripting Languages, C++ and Java. It seems like including several new libraries and constraints, and also change the semantics of old languages. But how could you use the power of LISP without never ever using parenthesis? or fixed-width? or brackets? or tabs? or begin/end blocks? If you can solve the problem of Hierarchy of Operators without using any of these block delimiters, please show me that novell discovery! But not bring another one.

Now, I think that the next step would be a language that could abstract or force segregation of the many individual areas of a program in a meaningful way. MVC Frameworks are a great example, but not wide and crystal-clear enough. I think that OOP is for Programming the same that Calculus is for Math.

There are things like SSH and HTTPS that are standard and globally "accepted". So, why can't some essential authentication structures come by default in some languages, just the same objects like System, String, Math, Thread, etc. exist?

No comments:

Post a Comment