JavaScript ha cambiado mucho desde que apareció por primera vez en Netscape Navigator en 1995. En The Modern JavaScript Tutorial explican cómo se debe emplear JavaScript en la actualidad.
Tag: JavaScript
Lo que la gente decía en el año 1995 sobre JavaScript
Muy interesante la lectura de Here’s what people in tech had to say about JavaScript when it debuted in 1995.
Los monstruos que crea JavaScript
Muy graciosas las respuestas que se han publicado en Quora a la pregunta Why is VSCode nearly 300 megabytes while Sublime Text is just 16 megabytes?:
Because Visual Studio Code is based on Electron, which is a horribly, horribly bloated framework that combines the Chromium rendering engine with the Node.js runtime. Writing an application to execute in a web browser is the worst imaginable way to develop software. It’s way over-engineered and overly complicated. And Node.js (JavaScript) is typically 2–6X slower than C++.
Visual Studio Code is a web browser with a code editor glued onto the side using expired epoxy.
VSCode is built on the Chromium rendering engine, which is made to render webpages, and is likely rendering this answer right now. The entire application is written using the duct tape monster that is Javascript. It’s a surprise that it is just 300 megabytes.
Using bloated web based frameworks to implement a desktop application does not make much sense, but .. anyway…
Obsesionados con JavaScript
Uso de null y undefined en JavaScript
Los valores null y undefined suelen dar muchos dolores de cabeza a los programadores. En el artículo Handling null and undefined in JavaScript se explica cómo se deben usar en JavaScript:
One aspect of JavaScript development that many developers struggle with is dealing with optional values. What are the best strategies to minimize errors caused by values that could be null, undefined, or otherwise uninitialized at runtime?
Some languages have built-in affordances for those circumstances. In some statically typed languages, you can say that null and undefined are illegal values, and let your programming language throw a TypeError at compile time, but even in those languages, that can’t prevent null inputs from flowing into the program at runtime.
To get a better handle on this problem, we need to understand where these values can come from. Here are some of the most common sources:
User input
Database/network records
Uninitialized state
Functions which could return nothing
Hoja de trucos de la consola de JavaScript de los navegadores
Muy interesante el artículo Console cheat sheet for JavaScript developers que explica cómo usar la consola de JavaScript que incluyen la mayoría de los navegadores web.
Cómo manipular los colores CSS con JavaScript
Un excelente artículo How to manipulate CSS colors with JavaScript:
I know you’re here to learn about manipulating colors — and we’ll get there. But before we do, we need a baseline understanding of how CSS notates colors. CSS uses two different color models: RGB and HSL.
Both the RGB and HSL color models break down a color into various attributes. To convert between the syntaxes, we first need to calculate these attributes.
With the exception of hue, each value we have discussed can be represented as a percentage. Even the RGB values are byte-sized representations of percentages. In the formulas and functions below, these percentages will be represented by decimals between 0 and 1.
I would like to note that I will not cover the math for these in depth; rather, I will briefly go over the original mathematical formula and then convert it into a JavaScript formula.
JavaScript, ese lenguaje malo malo malo
Lenguaje malo y con programadores ignorantes, según podemos leer en Quora en la siguiente respuesta a la pregunta Which commonly used programming language has the most ignorant programmers on average?:
Hands-down, it’s JavaScript. The number of really, really bad JS devs out there staggers the mind. They are responsible for the huge number of crap JS libraries, especially in the npm repositories.
They actually believe that JavaScript is sprinkled with fairy dust. They think JavaScript is somehow unique in terms of features and capabilities, when, in fact, there is absolutely nothing new nor special about this poorly designed language. Dynamic typing? Prototypes? Lambdas? Asynchronous programming? We’ve seen them all before in other languages.
[…]
I agree with Ryan Gedwill’s answer. “JavaScript is the most ignorant community because they don’t understand the word simple.”
La guía definitiva para trabajar con fechas en JavaScript
En THE DEFINITIVE GUIDE TO JAVASCRIPT DATES se explica cómo trabajar con fechas en JavaScript. Explica:
- The Date object.
- Initialize the Date object.
- Timezones.
- Date conversions and formatting.
- The Date object getter methods.
- Editing a date.
- Get the current timpestamp.
- Format dates according to the locale.
- Compare two dates.