Programación en Internet

Blog de la asignatura de la titulación Ingeniero en Informática

26 marzo 2018
by Sergio Luján Mora

Hemos logrado llegar a la Luna pero no hemos logrado entender el juego de caracteres

El juego de caracteres es la pesadilla de los informáticos.

No es que sea difícil, no se puede comparar a las ecuaciones diferenciales de segundo orden. Y sin embargo…

Con McDonalds y el juego de caracteres tengo una pequeña obsesión:

Pasan los años y la situación no mejora. El otro día me encontré los mismos problemas, en un Mcdonald’s de España y en uno de Portugal:

Sin embargo, encontré otro McDonald’s en el que sí que se imprimían bien las cosas. A la izquierda está el justificante de Portugal, sin errores; a la derecha el justificante de España, con errores:

Y para terminar, la “guinda del pastel”, ¿qué es lo que pone aquí?:

19 marzo 2018
by Sergio Luján Mora

La nueva etiqueta

En Meet the New Dialog Element se explica la nueva etiqueta <dialog> que está definida en HTML 5.2 que es recomendación desde el 14 de diciembre de 2017:

The <dialog> element represents a part of an application that a user interacts with to perform a task, for example a dialog box, inspector, or window.

The open attribute is a boolean attribute. When specified, it indicates that the dialog element is active and that the user can interact with it.

En esta página web se puede probar su funcionamiento.

12 marzo 2018
by Sergio Luján Mora

El ciclo de vida brutal de los frameworks de JavaScript

Según el artículo The Brutal Lifecycle of JavaScript Frameworks:

JavaScript UI frameworks and libraries work in cycles. Every six months or so, a new one pops up, claiming that it has revolutionized UI development. Thousands of developers adopt it into their new projects, blog posts are written, Stack Overflow questions are asked and answered, and then a newer (and even more revolutionary) framework pops up to usurp the throne.

Using the Stack Overflow Trends tool and some of our internal traffic data, we decided to take a look at some of the more prominent UI frameworks: Angular, React, Vue.js, Backbone, Knockout, and Ember.

There was a time when jQuery was the darling of JavaScript tags on Stack Overflow, accounting for almost 8% of new questions. This picture quickly changed as AngularJS and later React were released, cannibalizing jQuery’s mindshare amongst the community. Then starting around 2016, there is a quick shift from AngularJS to Angular, which represents the subsequent versions (Angular 2+), as developers began to migrate to the latest and greatest flavors of the popular framework from Google.

26 febrero 2018
by Sergio Luján Mora

HTML semántico

A estas alturas de la película, todavía hay gente que usa HTML mal y hace cosas como escribirlo todo con etiquetas <div> en vez de usar las etiquetas semánticas que existen. Esto siempre ocurrirá, porque siempre habrá gente nueva que aprenda HTML y lo aprenda mal. Para los que estén en esta situación, un par de páginas en las que explican qué es y para qué sirve el etiquetado semántico:

21 febrero 2018
by Sergio Luján Mora

¿Por qué el desarrollo web es complejo?

Porque se basa en una montaña de errores. Eso podemos leer en Why is web development so complex?:

Mainly because it’s built on a tower of mistakes.

HTML was a screwup, CSS was probably worse, and don’t get started on JavaScript.

If the web was to be redesigned from scratch, with no thought to backwards compatibility, it would be nothing like what we have today.

It’s complex due to simply piling on more cruft onto something that should have been thrown away and restarted decades ago, but we’re stuck with it now.

Start simple, just do a small amount of HTML, and style it up with CSS, and work your way up from there.


15 febrero 2018
by Sergio Luján Mora

Cuándo me convertí en un experto

Ayer me hicieron una pregunta en Twitter que me ha gustado:

@sergiolujanmora estoy iniciando el mooc de desarrollo web, ¿cuanto tiempo te costó , desde que te iniciaste en este mundo , hasta que lo dominaste para tener un nivel experto?. Sé que las tecnologías digitales estan en constante cambio, pero tengo curiosidad.

Y mi respuesta fue:

Mi primera página la hice en 1998 y afortunadamente no queda rastro de ella, estaba plagada de GIF animados; 20 años después, sigo aprendiendo todos los días, pero también me pasa con otras cosas como el inglés o incluso el español.

No creo que sea experto en español, mucho menos en inglés. Con la tecnología me pasa lo mismo.

14 febrero 2018
by Sergio Luján Mora

PHP es bueno

Me ha gustado la respuesta dada a la pregunta Everybody is saying don’t learn PHP. Learn JS frameworks but I find them too tough. I like PHP and its easy for me. I am understanding its concepts. Should I ignore them and learn PHP?:

PHP is an awesome tool. Like others. It has its strong and its weak points, like others.

I mainly develop in PHP, Java, Python, C/C++, C# (and Javascript, only when expressly requested)… and I have to say when I want something actionable and done fast, it’s either PHP or Python and that’s it.

PHP is best for web backends, Python is more general, comes with some awesome A.I. and analysis libraries.

I tell you why “everybody” tells you something wrong:

  • half of them are “language activists” (usually for Python or Javascript), most of them are not even professionals, otherwise they would just deal with the fact we are talking about tools, not ideologies.
  • several are “opportunity hoppers”, only looking websites that tell what language earns the highest income. I would never hire such guys, because they are unreliable. Developing is serious business, you don’t want a guy that after 6 months switches job because language XYZ, in year ABCD, potentiallyearns him $2k a year more.
  • the remaining ones, are ignorant. Ignorant in the literal sense. They read some polemics on some blogs (usually “language purist” blogs) in 2011 and never cared to read updated information.
    Now, 2011 knowledge is stale by any standard. PHP did a drastic change starting from version 5.5, that is since about 2013 (4 years ago) and implemented tons and tons of “cool developer guy” syntax facilities and structures.

    Since version 7, PHP is twice as fast and implemented so many new features, that Java itself got behind in some niche constructs.
    Nowadays you can develop PHP backends that really “taste like Java”.
    From lambda / closures / anon functions to iterators, from nice interfaces to factories, from classic patterns to unit testsprofilingand code coverage statisticsmock upstraitscontinuous integration (still rough), from depenencies packages to bigdata access, large (SymfonyLaravelWordPress(!) (powering millions of websites)), medium (Yii and others) and small (Fat Free Framework and more) MVC / REST frameworks. Just name a feature, it’s very possible today’s PHP got it.
    PHP even gets decent (NetBeansEclipseCodeLobster) to awesome development environments (PHPStorm – payware).

    Plus – and no other language beats PHP at this, since the beginning PHP got blazing fast, ultra-extra-mega-flexible key-value arrays (technically: ordered maps) and tons and tons of arrays management functions.

    So… beware, check PHP out and make yourself an idea. It’s actually very quick to check PHP out and see if it’s the tool for you. Just download one of zillions free “LAMP” or “WAMP” or “MAMP” (Linux / Windows / Mac) distributions, that is pre-configured packages including web server, database server and PHP. Some of those are terrific and include debuggers, control panels, additional services and much more.