Vitaly es el Gerente de Marketing Digital en CodeMonkey. Su maestrĆa en InformĆ”tica, combinada con su experiencia como padre de dos hijos, le permite crear contenido enfocado en la formación en programación.
Are you reading these words on a computer? Or maybe on a tablet, or smartphone? All of these devices are powered by code: millions of lines of words and numbers whirring away behind the scenes. Code is everywhere. Our lives depend on it.
But not many people know how it works. For many of us, code has a mystical quality ā we know it exists, but it floats beyond the edge of understanding. It’s like gravity, or DNA, or the way that an airplane stays in the sky. We accept these things, but we can’t make sense of them. It hurts our brains to try.
This guide won’t help with those other things. We don’t understand them either.
But it will definitely help with coding. The fundamental principles are surprisingly simple, and easy enough to learn. Hopefully, by the time you finish reading this, the idea of code won’t feel quite so mystical. Weāll also let you know what steps to take if you want to explore it more.
What is code?
It’s good to start with a definition. You can’t be expected to learn about something if you don’t know what that something is.
In simple terms, code is the language of computers. If a person knows how to write code, they can give instructions to a computer. Thatās what computer programmers do. They write strings of code that tell a computer how itās meant to behave, like opening a website when youāve clicked a link, or deleting a file when youāve pressed delete.
It’s the same as talking to a human. If you give them instructions in their native language, they’ll know what youāre talking about. If you try to give instructions in another language? They might not understand. Computers work in the exact same way. If you don’t use code to write their instructions, they won’t know what theyāre meant to do.
Just to be clear, when we say ‘computer’, we’re not just talking about laptops. A mobile phone is a type of computer. So is a tablet. A smartwatch. A washing machine. Behind the scenes, every one of these digital devices is controlled by code, and all of this code was written by programmers to tell the devices exactly how to behave.
Basic principles
Anyone can learn to code. It’s just like learning any language ā with enough time and practice, even a complete beginner will start to get the hang of it. As with anything, itās good to start with some basic principles. Letās look at a few of those now.
Human languages are often vague and organic and leave plenty of things unsaid. If you ask a friend to “buy some milk,” they know exactly what to do. You won’t need to give them any extra instructions, like “bring the milk home” and “put it in the fridge.”
But computers need those extra instructions. If you really wanted to code a computer to collect some milk, you would need to say something like this:
> open the door > leave the house > walk to the shop > buy some milk > bring the milk home > put the milk in the fridge
Unfortunately, these instructions wouldn’t actually work. Theyāre written in English, so a computer wouldn’t understand them.
But theyāre still a useful way to demonstrate the principle of clear, step-by-step instructions. In the context of coding, we call a set of instructions an algoritmo. If your algorithm misses an important step, the computer will crash, or do something it wasn’t supposed to. It might try to leave the house without opening the door, or forget to come home after buying the milk.
The order of the steps is important too. Computers will always follow instructions in the order they were given, exactly the same as following a recipe in a cookbook. This principle is known as secuenciación. If the steps of the algorithm are in the wrong order, that could also cause the computer to crash.
If the computer does crash, youāll probably need to look back at the code and identify the cause of the problem. Maybe one of the steps is unclear, or arranged in the wrong order. This process is called depuración: searching for errors in a failed algorithm, then trying to fix them.
Now, letās make this a bit more complicated. What if we only wanted the computer to buy some milk when the previous bottle was empty? Weād have to use something called a conditional statement:
> IF the previous bottle is empty > THEN open the door > leave the house > walk to the shop > buy some milk > bring the milk home > put the milk in the fridge
Using IF and THEN takes an algorithm to the next level. Suddenly, your instructions feel a lot more dynamic. This is how a lot of devices are programmed. IF this button is pressed THEN start a 10-minute wash cycle.
What if we wanted the computer to buy a new bottle of milk, not just once, but every single time that the previous bottle was empty? Weād have to use a loop, which is when we tell the computer to return to the start of the algorithm:
> IF the previous bottle is empty > THEN open the door > leave the house > walk to the shop > buy some milk > bring the milk home > put the milk in the fridge > REPEAT
Visual blocks
Now that you know some basic principles, itās time to put them into practice. Visual coding blocks are an essential tool for any absolute beginner. You can find them on websites like RasguƱo y Blockly. Both of these sites are free.
Visual blocks let you play with code without having to worry about typing. You can drag and drop them into different positions, working out how different functions interact. This is a great way to explore those basic concepts, like sequencing, loops and conditional statements.
In theory, visual coding blocks are designed for children, but don’t let that put you off. All of us need to start somewhere. And don’t forget that the basic principles of visual blocks are also applicable to higher levels of coding. Even the most advanced programmers will be constantly thinking about algoritmos, sequencing and debugging.
It’s like reading a book. Youāre still using the same basic alphabet that you learned when you were small. Coding works in the exact same way. No matter the project, the basic principles will never change.
Lenguajes de programación
When you feel comfortable with the principles of visual coding blocks, you’ll be ready to graduate to something more advanced.
Earlier on, we compared code to a language, but it’s actually a bit more complicated than that. There isn’t a single lenguaje de codificación, and different people write their code in very different ways. Some people use a language called Python. Others use JavaScript or C++. There are plenty of options, which are known collectively as programming languages.
There’s no such thing as a ‘best programming language’. They all have different strengths and weaknesses. Some of them are simple, and great for beginners. Others are complex, and perfect for someone more advanced. Some of them are better for game development, or web development, or app development. It really depends on personal taste, and what you’re looking to achieve.
We won’t get into the nuances here, but if you’d like to learn about the different languages, you can read our post from earlier this year. In summary: JavaScript is always a good place to start. Another option is CoffeeScript ā the language we use at CodeMonkey.
Coding resources
Once youāve chosen a language, itās time to learn how it works. One of the great things about coding is the sheer amount of resources. Whatever your favorite style of learning, youāre sure to find something that matches your tastes.
One of our personal favorites is Khan Academy. Its coding courses are clear, concise, and completely free. Each lesson is delivered using a ‘talk-through’, a kind of interactive video which lets you pause at any time and play with some code on-screen. In terms of programming language, Khan Academy teaches JavaScript, HTML/CSS and SQL.
Codecademy is another option. It’s very similar to Khan Academy, but with a wider range of courses, which include computer science, software development, game development and more. Codecademy offers courses in 15 different programming languages, including JavaScript, Python and Ruby.
YouTube is also a great place to look for coding tutorials. FreeCodeCamp.org has a great channel, with a wide range of series dedicated to different programming languages. You can check out The Net Ninja and WebDevSimplified too.
If you’re looking for something a little less formal, there are plenty of educational coding games, which will help you to learn the basics of coding without feeling like you’re back at school.
There are mobile games out there too. LightBot is pay-to-play, but maybe you’ll decide it’s worth it. Throughout the game, you’ll be asked to complete a series of puzzles, learning programming logic along the way.
If youād prefer to learn your coding offline, you might be able to find a face-to-face class in your local area. Failing that, you can always try a good old-fashioned book. The Head First series of programming books offers excellent advice, as well as giving you plenty of activities and exercises to help you hone your coding skills.
Or maybe you can combine any number of these things. Buy a book on JavaScript, watch some YouTube videos, play some Code Monster on the side. Sign up to Codecademy, join a class, play some LightBot in between. There’s no right or wrong approach here. You just need to try some different options until you find what’s best for you.
Final words
Whichever route you decide to take, there’s one more thing to remember: you won’t get far without some grit and perseverance.
Like any new skill, coding can be frustrating. Your algorithms will fail, and sometimes youāll find it impossible to spot the bug. Youāll feel the urge to give up, to forget about coding, to delete your projects and never think about them again.
Donāt give up. When your algorithms finally run as planned, the rush of triumph will make all those struggles feel worth it. That’s why so many people get into coding in the first place. It’s an amazing feeling to write a set of instructions, then to watch your computer transform those instructions into action.
Coding can be daunting. We understand that. But by reading this article, you’ve already taken the first step. Now, itās time to take the second step. Close your eyes, take a deep breath, and dive into the world of code.
A constant is like a super stable friend in your code that never changes. Letās dive into the world of constants and discover why they are important!
Usamos cookies en nuestro sitio web para brindarle la experiencia mÔs relevante recordando sus preferencias y visitas. Al hacer clic en "Aceptar", acepta el uso de TODAS las cookies. Sin embargo, puede visitar la Configuración de cookies para proporcionar un consentimiento controlado.
Las cookies necesarias son absolutamente esenciales para que el sitio web funcione correctamente. Esta categorĆa solo incluye cookies que garantizan funcionalidades bĆ”sicas y caracterĆsticas de seguridad del sitio web. Estas cookies no almacenan ninguna información personal.
Galleta
Tipo
Duración
Descripción
_codemonkey_session_rails_4
1
1 aƱo
_Georgia
persistente
2 aƱos
Esta cookie es instalada por Google Analytics. La cookie se utiliza para calcular los datos de visitantes, sesiones y campañas y realizar un seguimiento del uso del sitio para el informe de anÔlisis del sitio. Las cookies almacenan información de forma anónima y asignan un número generado aleatoriamente para identificar visitantes únicos.
cookielawinfo-checkbox-publicidad
persistente
11 meses
La cookie se establece mediante el consentimiento de cookies del RGPD para registrar el consentimiento del usuario para las cookies en la categorĆa "Publicidad".
cookielawinfo-checkbox-analytics
persistente
11 meses
Estas cookies estĆ”n establecidas por el complemento de WordPress de consentimiento de cookies de GDPR. La cookie se utiliza para recordar el consentimiento del usuario para las cookies en la categorĆa "AnĆ”lisis".
cookielawinfo-checkbox-funcional
persistente
11 meses
cookielawinfo-checkbox-required
persistente
11 meses
Esta cookie estĆ” configurada por el complemento de consentimiento de cookies de GDPR. Las cookies se utilizan para almacenar el consentimiento del usuario para las cookies en la categorĆa "Necesarias".
cookielawinfo-checkbox-no necesario
0
11 meses
Esta cookie estĆ” configurada por el complemento de consentimiento de cookies de GDPR. Las cookies se utilizan para almacenar el consentimiento del usuario para las cookies en la categorĆa "No necesarias".
cookielawinfo-checkbox-otro
persistente
11 meses
cookielawinfo-checkbox-performance
persistente
11 meses
Esta cookie se utiliza para realizar un seguimiento de las cookies que el usuario ha aprobado para este sitio.
JSESSIONID
1
1 aƱo
Utilizado por sitios escritos en JSP. Cookies de sesión de plataforma de propósito general que se utilizan para mantener el estado de los usuarios en las solicitudes de pÔgina.
view_cookie_policy
persistente
1 hora
La cookie estĆ” configurada por el complemento de consentimiento de cookies de GDPR y se utiliza para almacenar si el usuario ha dado su consentimiento o no para el uso de cookies. No almacena ningĆŗn dato personal.
XSRF-TOKEN
persistente
1 aƱo
La cookie la establece la plataforma de creación de sitios web de Wix en el sitio web de Wix. La cookie se utiliza con fines de seguridad.
Linkedin: se utiliza para rastrear a los visitantes en mĆŗltiples sitios web, con el fin de presentar anuncios relevantes segĆŗn las preferencias del visitante.
Google Analytics establece esta cookie y se utiliza para distinguir usuarios y sesiones. La cookie se crea cuando se ejecuta la biblioteca JavaScript y no existen cookies __utma. La cookie se actualiza cada vez que se envĆan datos a Google Analytics.
__utmb
persistente
30 minutos
Google Analytics establece la cookie. La cookie se utiliza para determinar nuevas sesiones / visitas. La cookie se crea cuando se ejecuta la biblioteca JavaScript y no existen cookies __utma. La cookie se actualiza cada vez que se envĆan datos a Google Analytics.
__utmc
persistente
1 aƱo
Google Analytics establece la cookie y se elimina cuando el usuario cierra el navegador. La cookie no es utilizada por ga.js. La cookie se utiliza para permitir la interoperabilidad con urchin.js, que es una versión anterior de Google Analytics y se utiliza junto con la cookie __utmb para determinar nuevas sesiones / visitas.
__utmt
persistente
10 minutos
Google Analytics establece la cookie y se utiliza para acelerar la tasa de solicitud.
Google Analytics utiliza esta cookie para comprender la interacción del usuario con el sitio web.
_gid
persistente
1 dĆa
Esta cookie es instalada por Google Analytics. La cookie se utiliza para almacenar información sobre cómo los visitantes usan un sitio web y ayuda a crear un informe analĆtico de cómo estĆ” funcionando el sitio web. Los datos recopilados, incluido el nĆŗmero de visitantes, la fuente de donde provienen y las pĆ”ginas, se muestran de forma anónima.
GPS
persistente
30 minutos
Esta cookie la establece Youtube y registra una identificación única para rastrear a los usuarios según su ubicación geogrÔfica.
SEĆOR
persistente
5 meses
Esta cookie se utiliza para medir el uso del sitio web con fines analĆticos.
MUIDB
1
1 aƱo
MicroSoft utiliza esta cookie y recopila datos sobre los usuarios que visitan varios sitios web. Estos datos se utilizan para analizar la eficacia de los anuncios en sitios web.
Utilizado por Google DoubleClick y almacena información sobre cómo el usuario utiliza el sitio web y cualquier otro anuncio antes de visitar el sitio web. Se utiliza para presentar a los usuarios anuncios que son relevantes para ellos de acuerdo con el perfil del usuario.
MUID
persistente
1 aƱo
Usado por Microsoft como identificador único. La cookie se establece mediante scripts integrados de Microsoft. El propósito de esta cookie es sincronizar la identificación en muchos dominios de Microsoft diferentes para permitir el seguimiento de usuarios.
pxrc
persistente
2 meses
El propósito de la cookie es identificar a un visitante para ofrecer publicidad relevante.
SkimResources establece esta cookie. La cookie se utiliza para registrar datos sobre el visitante con el fin de optimizar la relevancia de las ventajas que se ofrecen a los usuarios.
TapAd_DID
persistente
2 meses
La cookie la coloca tapad.com. El propósito de la cookie es rastrear a los usuarios en todos los dispositivos para permitir publicidad dirigida
TapAd_TS
persistente
2 meses
Tapad.com establece la cookie. El propósito de la cookie es rastrear a los usuarios en todos los dispositivos para permitir publicidad dirigida.
TDCPM
persistente
1 aƱo
El servicio CloudFare configura la cookie para almacenar una identificación única para identificar un dispositivo de usuarios recurrentes que luego se utiliza para publicidad dirigida.
TDID
persistente
1 aƱo
El servicio CloudFare configura la cookie para almacenar una identificación única para identificar un dispositivo de usuarios recurrentes que luego se utiliza para publicidad dirigida.
test_cookie
persistente
15 minutos
Esta cookie la establece doubleclick.net. El propósito de la cookie es determinar si el navegador de los usuarios admite cookies.
VISITOR_INFO1_LIVE
1
5 meses
Youtube establece esta cookie. Se utiliza para rastrear la información de los videos de YouTube incrustados en un sitio web.
Esta cookie estÔ configurada por linkedIn. El propósito de la cookie es habilitar las funcionalidades de LinkedIn en la pÔgina.
lang
persistente
1 aƱo
Esta cookie se utiliza para almacenar las preferencias de idioma de un usuario para ofrecer contenido en ese idioma almacenado la próxima vez que el usuario visite el sitio web.
lidc
persistente
1 dĆa
LinkedIn establece esta cookie y la utiliza para el enrutamiento.