web developer & system programmer

coder . cl

ramblings and thoughts on programming...


who should learn programming?

published: 20-05-2012 / updated: 20-05-2012
posted in: development, programming, projects, tips
by Daniel Molina Wegener

Programming is for those persons which are capable to understand how serious is this activity. «The purpose of programming is to create a set of instructions that computers use to perform specific operations or to exhibit desired behaviors». But is not a subject of just placing those instructions, you need a deep background on how and where to place those instructions. Just learning the meaning of each instruction is not enough, mainly due to the kind of abstractions that we using on real world programming activities. So, learning a language, few instructions and doing a small program that can insert data into some RDBMS and extract data from that RDBMS does not mean that you know how to program.

For example we can use a popular language to review what I am talking about. The past year I have handled a project made with PHP. The project itself was not hard to handle, due to my knowledge, PHP programming for me is easy. But there was a big problem with that specific project. The project goal was to implement a workflow related to the documentation of certain company, but the first programmer that have handled the project was that kind of programmer that was knowing just how to place instructions, and seems that he does not have a good background on theoretical computer science.

The resulting code of that programmer, was a messy jungle of PHP templates and code with one of the highest cyclomatic complexity that I ever seen, due to the amount of if, else and else-if conditional that were placed to treat the workflow. The lack of a model, and the proper programming techniques have made that project a headache. At my side I was thinking to use dynamic programming and states machines to hold the workflow model, also to be able to change the workflow model dynamically. But changes with that size was not covered by the current budget, because most money was invested with the previous programmer. This is one of the main reasons why I have left PHP programming.

So, here comes my criticism. Programming is for those persons which are able to understand that programming is a serious activity that requires the proper theoretical background. Not just about placing instructions. You cannot really learn to program in two years, I think that it is a career that requires at least four years to acquire the proper theoretical background. Also learning only one programming paradigm, like Object Oriented Programming, is not enough, mainly due to the heavy tendencies of the latest years of all languages to become multi-paradigm. C++11x has introduced functional elements, Scala is almost a multi-paradigm language. Including Perl, Python, Ruby and PHP, all of them are now capable to use some functional elements like closures and lambda-expressions.

One of my latest projects is about to handle some machinery configurations dynamically from a processing station. The project is being programmed in C and C++, using a framework API to handle that kind of processing, where it has — in some manner — an emulated behavior of a PLC program, with scan-execute cycles. Due to the amount of devices that are being handled, I am almost completely sure that we will require dynamic programming, states machines, some divide and conquer design principles and few cases should be covered by approximation algorithms. This is very different from that project where I have implemented a DSL in C++ to create dynamic parsers in run-time, not compiled, like those made with some BNF enabled tools, which requires different programming techniques.

Due to the complexity of the project, I will do something that is not covered by the project cost, but is something I really want to do, because this project and everything related to my responsibility cannot fail. So, I have decided to build a processing model based on few state machines and I will validate that model using Promela, just to ensure the correctness of that project. Here trial and error is not the correct approach, I cannot make any mistake. Where did I learned about Promela?, is just a subject of interest. Programming is for interested and responsible people, not for those who wants to play a little with computers. Oh, probably you are thinking that «rocket technology is not required», do you really?.


4 comments to “who should learn programming?”

  1. Usted ¿como definiría “proper theoretical background”? Me interesa saber la opinión de un programador profesional, más que las mallas que plantea la academia.

    Saludos

  2. Eso depende del objetivo. Lo incial seria identificar las 2 grandes ramas de la programacion: funcional e imperativa, luego la mezcla o multi-paradigma. Se deberian explorar ambas areas desde lo que es el cálculo lambda para lo funcional y teoría de automatas para la imperativa, la máquina universal por ejemplo. Pero la ciencia de la computacion es muy amplia, yo creo que lo básico ya esta cubierto, aún asi faltan algunas materias, como cálculo lambda, logica combinatorial, etc. Más que nada poner en práctica lo teorico, como ejemplo definir una maquina de estados a base a un automata, hacer una redución β para optimizar una función, cosas de ese tipo, aplicar una redución α para refactorizar código, etc.

    Creo que el principal problema es saber vincular lo teorico con lo practico, creo que ahí esta la principal falla hoy por hoy.

  3. “…Creo que el principal problema es saber vincular lo teorico con lo practico, creo que ahí esta la principal falla hoy por hoy…” Ese yo pienso que es un problema sistémico del modelo educativo tradicional, pues en otras áreas de la ciencia también se reclama lo mismo.

    Gracias por su respuesta, es interesante la programación funcional, ya varias personas me han recomendado aprender eso, pero se me hecho muy difícil hacerlo.

    Saludos

  4. De nada, pero si te aconsejé respecto a la programación funcional, es debido a que la mayoria de los lenguajes apuntan a ser multiparadigmas, son pocos los lenguajes puristas que se mantienen, Haskell por ejemplo es 100% funcional, pero OCaml tiene elementos OOP, Python es multiparadigma (soporta elementos funcionales con base OOP), lo mismo que Ruby, nacio Scala que es 100% multiparadigma, etc. Ejemplos hay varios y para todos los gustos…

    Si te indico como consejo que te acerques a lo funcional, es nada más porque se usan bastante algunos enfoques en lo que es la programación moderna, por ejemplo ahora que entramos en la era multi-core, te podria nombrar Node.js, que usa elementos funcionales en JavaScript, que es un lenguaje multiparadigma también, para implementar I/O asíncrono. Por dar otro ejemplo mas, a C++11x le agregaron lambda expressions y closures, y podria seguir nombrando varios ejemplos más…

post a comment

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>