Category Archives: programming

What programming really is

There was a stereotype that a programmer is a weirdo that is sitting all day in the basement with his computer.

It was true a long time ago. Programmers are not like that nowadays. At least not all.

If you are a programmer

There is a lack of good quality programmers. If you are a good programmer, you can choose who you want to work for. For example Google, Facebook or Apple. If you are good enough, you will probably get a job. And if not, you can try to get a job in any other IT company because almost every IT company is continuously looking for programmers.

If you are a skilled programmer and you have online portfolio, you will get new well paid job offer each week. You can choose where you want to work. You can get any programming job you want if you are good enough.

The advantages of programming

There are many benefits for programmers.

Many programmers do not have to go to work. They can work from home or from any place in the world. This is quite a big advantage for many people.

Programming jobs belong to the best paid jobs in the world. As a programmer you can earn per hour more than regular people earn in regular jobs in factories per day. That’s crazy.

Being a programmer sounds like a dream job, but it’s not that bright.

The dark side of programming

Programming can be fun and it can also be a pain in the ass. It depends…

Learn to code is not a problem at all. Everyone can learn to code. As Martin Fowler says:

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand”

So programming is an art. Programmers are artists who write nice readable code. The problem is that any fool can write code that a computer can understand and call himself a “programmer”. There is a lot of unexperienced programmers that write ugly code. It takes a few years to learn to write nicer code that is readable also for humans. The main challenge of programming is not to write functional code, but to write code that other programmers can read and understand quickly. The minor challenge is to write functional code, to make a computer do what a programmer wants to do.

programming-reality

It’s not a problem to write code. The main challenge is to maintain code. There are many challenges for programmers.

Programming features

Features like registration, login, uploading files, processing forms and others need to be programmed. There are usually hundreds or even thousands of ways how to program a feature. The more complex feature the more ways exists. Each programmer would program the same feature in a different way. The same functionality, but the different code. It’s like you would tell people to draw a person. 10 persons would draw 10 different persons.

It gets complicated if the feature is complicated. There are many ways how to approach a single algorithm. One application usually contains thousands of lines of code. If you are a programmer and you start working for a company, you will usually work on a project that has thousands lines of code. You will probably be confused how the code works. Especially if the feature is complicated. You will have to study that code for a few days to understand it so you can make changes to it and extend the feature.

Complicated features contain many algorithms that needs to be written properly. If there is just one mistake, the program might not work.

Fixing bugs

With programmed features there comes bugs. If a feature does not work as expected it is called a bug. The more features, the more bugs exist. The more complicated features, the more complicated code and the more tricky bugs.

Tests

Fortunately, a programmer can write tests for his code to test it and see if it works as expected. Unfortunately, approximately 80% of programmers do not write tests. Some of them would like to write tests but they don’t know how to do it or they are busy with programming features so there is no time for writing tests. Many of them think that writing tests is a waste of time. In fact, waste of time is to write code that is not covered by tests. There is a much higher chance to cause a bug in code without tests than in code with tests. There is a much higher chance to find a bug in code with tests more quickly than in code without tests.

If you do a change in code without tests, there is quite a high chance that you will break something and you never know whether you break something unless you see something wrong in you application. There might be hidden bugs that you might not see. For example you don’t immediately see a bug in a form unless you send the form and see that something is wrong. If you don’t have tests in your code, you have to test everything manually. Once you program a feature, you test it if it works as expected and if yes, you mark the feature as done. Sooner or later there will be a need to change that feature and you will have to test it again. If it’s a big feature, it will take a lot of time to test everything. If you don’t test it properly, there is a high chance that you caused a bug and you don’t know about it. It might be a critical bug. For example some data are not processed correctly or not at all. Your users will not be happy.

So the moral of the story is to write tests to avoid unexpected problems. Tests can save your ass. If you cause a bug in your code and you have it covered by tests, you can see the problem immediately and you can fix it.

The problem with tests is that you have to learn how to write them and how to write testable code. It takes some time, but if you learn it, you will become a better programmer. If you are able to write tests for your code, you can save a lot of trouble in the future. Writing tests can take some time from the start, but it will definitely save time later. I know it’s a big temptation to write code without tests, it might seem that you are saving time when you don’t write tests, but it’s a devilish practice. You will pay a high price for not writing tests. If there are no tests in your code, your code will become a big mess that no one wants to touch.

If you have a big project and you hire a new programmer, he does not know all the dark sides of the code. If you don’t have tests and he touches something, he can break a lot of things without knowing it. He will cause a lot of bugs. Features that worked before suddenly do not work now. What happened? He changed just a small thing in the code. That’s the dark side of the code that is not covered by tests. If you don’t know the code, you can break something very easily without knowing it. It happened to me many times. I was desperate. Then I learned to test my code and I was desperate when I got a project without tests. It was a pain in the ass.

So if you want to have happy programming career, write tests and avoid projects without tests.

Why I quit programming

Career of a programmer is interesting. Sitting on a chair at least 8 hours a day watching a computer screen and typing some commands that computer can understand and do what a programmer wants to do. Sometimes. Sometimes computer just says “Error” and do nothing.

How/Why I started coding

I write about it in this article: “How programming changed my life“.

What programming really is

I write about it in this article: “What programming really is“.

Coding career

My coding career was great. I started my career after I quit college in 2012 and I ended my career in 2015. I learnt a lot. I started working in a small web development company and after a year I was able to work on my own as a freelancer. I have a portfolio on hromnik.com. I have built a lot of web pages and applications. But unfortunately a lot of applications do not exist any more. They were not successful. The most successful and useful application I built is CoderMania – an e-learning platform for learning to code interactively. Unfortunately, I stopped developing it because I changed my priorities in my life. I started teaching people to code but I realized that there is something more important than coding and teaching people to code.

Changed priorities

I started meditating in April 2015 and I realized in September that teaching people to code is not something that the world needs right now. I realized that the world needs something else. Something more important. The world is full of suffering. There are wars, fear, hate, violence, poverty and a lot of other terrible things. I realized that people can live without these terrible things. I want people to live in harmony, love, happiness and abundance as I do thanks to meditation.

Meditation as a highway to a happier life

Meditation is not something alien to us. It’s a natural activity for humans to gain and retain the state of unconditional love and happiness. There are wars, fear, hate, violence, poverty and other terrible things because people don’t meditate. Many people live unconsciously instead of consciously. They don’t live their lives at their full potential. Many people live in fear or even hate. Quite a lot of people are able to hurt other people and other living beings. It’s not necessary. People can live in harmony if they start living consciously instead of unconsciously.

Once people get a certain level of consciousness they will not be able to hurt any living being if not necessary. They will live in love and happiness instead of fear and hate. They will understand that helping each other is important. Selfishness will go away. Trust me. I was selfish, fearful and angry. I could get mad about any small things. I started meditating and my life changed dramatically. I realized a lot. I can see things that other people don’t see. It’s interesting to see that people create all their trouble in their minds. I can see that people can live in harmony, love, happiness and abundance. I don’t live in a wonderland. I live in the same world as you. I see what’s happening. I see a lot of terrible things. But I also see that it’s not necessary.

You might say: “Ok, but what can I do about it? I can’t change the whole world“. Albert Einstein said: “The world is not a dangerous place to live because of bad people, but because of people who don’t do anything about it“. You don’t have to change the whole world. You can change at least yourself and your surroundings. Once you manage to change yourself, things will happen in a magical way.

Mahatma Gandhi once said:

“Be the change you wish to see in the world.”

You can change yourself through meditation more quickly than without it. You might say: “Oh thanks, I am content with myself. I’m not the one who should change. Others should change”. That’s what I thought too. But it doesn’t work like that. You cannot change others. You can just change yourself and inspire others to change. Once you can live without fear, anger, hate and judging, others will wonder how you managed it. They will probably want to know how to live happier life. And you will tell them: “I just meditate a few minutes a day. I listen to my inner voice, my heart and do actions according to it. That’s my recipe for happy life“.

And people will probably tell you: “I don’t need to meditate. Meditation is a waste of time“. I know, I had similar thoughts about meditation. But I started to meditate because I was curious what meditation can bring to me. And I was very surprised after a few months, how it purified my consciousness. It’s mind-blowing.

If you want to open a new dimension of life – life full of love, happiness, abundance and harmony, you should practice daily meditation. Yes, daily. It’s not enough to meditate once a week. If you want to feel effects of meditation, you have to meditate every day. If you want muscle, you also have to work out more often than once a week. Meditation is similar to body workout. It needs to be done often and regularly. Start to meditate at least 5 minutes a day and you will feel results after a few months. You will feel much better and you will understand a lot of things about yourself, life and the universe. 5 minutes a day. It’s a minimum for beginners. Everyone can do a 5 minutes meditation. Everyone can change their perception of life in a few months. Everyone can be happier.

Happy people are more important than happy computers

So the main reason why I quit programming is to teach people how they can live without fear, anger, hate, judging and others not so nice thoughts and feelings. People should learn how to live happier life as soon as possible. That’s the most important thing. I have learned a lot and I want to teach others how to live happier life. Once everyone is happy, I can teach coding and maybe even code again.

The second reason why I quit programming is that I want to work with people instead of computers. I want to switch my life from virtual reality to the real one.

Working with computers is nice and comfortable, but I don’t see meaning in it while people live in fear, hate, anger and other miserable feelings. I want to talk to people and show them how they can live happier life.

What will I do?

You may ask: “And what about money?“. This is the most frequent question I get. I know that many people need a lot of money for their living. That’s a trap of The Matrix (this system). I was able to minimize my expenses and I need money for just food, cheap accommodation and travelling (which can also be free – hitchhiking). That’s all. I was able to save enough money to live more than year without a paid job and do what I like – to write articles on my blog, to create videos, to meet great people and this all created and still creates new opportunities for me and others. I haven’t been coding for more than 10 months and I am one of the happiest people in the world. I can work in kids summer camp. I can also work on a farm. I can make and sell food. I can do a lot of things that I love. I don’t need to earn much money. I am happy when I do what I love, when I eat great food, when I am surrounded by great people. I am a new age hippie and I am happy.

Do what you love and be happy too

I don’t like to work 8 hours a day, 160 and more hours per month. This system is not for me and also not for many others who want to disconnect from The Matrix and want to do what they really like no matter how much money they earn. Money is a trap of The Matrix. Humans are the only species who need to pay for living. Many people just can’t stop working and be free. They are slaves of their expenses and money. It’s a terrible life. It’s a modern slavery which produces stress, fear, anxiety, cancer and other diseases. I could talk about the Matrix even more but you probably already know it. You live in it. But you may not know how to get out of it. Just minimize expenses, earn enough money so you can leave your current job and start doing something you like, something more useful and meaningful. Do what you love, be free and be happy. I hope more people will be happy and more people will help each other. We can create true paradise here on Earth. Together.

May the love be with you.

EDIT: Doing something that I love does not mean that I can’t earn a living as many of you may think.

How programming changed my life

I started programming in 2008. But why and how I started to learn to program? And how it changed my life?

I don’t want to work for minimum wage

I graduated from high school in 2008 and then I needed to decide what I want to do with my life next. I didn’t know what to do so I took temporary job in a warehouse. I have been working there for 2 months, 5 days a week, 12 hours a day. For minimum wage. That was not something I wanted to do for the rest of my life.

I was thinking what I would like to do, what I liked as a kid. I liked computers and computer games. I was fascinated how everything in computer works. I borrowed a programming book and started to learn to program in language C. I wrote my first program “Hello world”, then I wrote “Hello Tomas”. I liked it. Once I learned something more, I was able to write a program that asked for my name and age and wrote it in output: “Hello Tomas, you are 19 years old”. I was amazed. I was able to ask people for information, process the information and provide the information.

I wanted to learn more about programming and computers so I applied to college. I prepared for entrance examination and I was able to pass it.

College life

I was full of enthusiasm. I wanted to learn as much as possible. I learned a lot, even things I will probably never use. But it’s good to know more than you need because you never know when you will need it. College will give you wide knowledge of various topics and technologies.

I was at 3rd degree when I told myself “Enough! I will not try to finish exam of math, if I fail, they will expel me. I don’t understand the math, I don’t want to understand it. I want to learn things that I like. I like when people can see my work online, I like web development.” We didn’t learn web development at college, we learned mostly mature technologies that old companies still use. I wanted to create my own web applications that everyone in the world can use. So I left school and started learning on my own again.

Building my first web application

I already knew HTML and CSS and I created a few web pages in PHP before and I knew that I can also create a web application in PHP. So I started learning PHP properly. I didn’t want to build an application in pure PHP, so I also started learning PHP framework Zend. I was able to build my first web application for online food ordering in 2-3 months. It was a dummy application but it worked and I learned a lot. I wanted to sell it to restaurants but I was not a salesman. I liked creating applications, not communicating with people and trying to convince them that my system is the best for them. I wanted to create another application and learn something new.

I wanted to learn Nette framework which was popular in Czech republic. So I started building new application in Nette called “Share a ride”. It was Facebook application where people could offer seats in their cars from place A to place B. People could also create demand that they need to travel from place A to place B. It was not beautiful app but it worked. A few people used it. It could be used by more people but there was Facebook group “Share a ride” which people liked and they didn’t want to use “Share a ride” app because they were used to use the group. Again, I didn’t want to persuade people to use my app. I built it because I thought it will be better than the group and I wanted to learn Nette. Thanks to this application, I got my first job offer. A friend of my friend saw Share a ride app and asked me if I wanted to work in his company. Why not? So I started working in his company. I was happy.

Working as a freelancer

After a year working in a web development company I learned a lot. I wanted to try to work as a freelancer from home. Working from home was my dream. I was able to find my first job as a freelancer. It was 2 years old project written in Nette. The code was ugly and I was able to work on the project for a half year. Then I told myself and my boss “STOP!” I can’t handle this madness anymore. I was frustrated by the project. So I stopped working on the project and I wanted to work on my projects again.

I had an idea for an app called “Seenist” – app where you can create a list of bands you have seen live. Seenist was online after 2 months of development. I wanted to learn something new again so I built it in Meteor.js. And again, the app was not used by many people. I found out that it is quite useless app for most people. But it was useful for me and a few other people. I run out of ideas and I wanted to start working for a startup.

I found and joined one startup in Brno. We were building the startup from scratch. It was a discount portal similar to Droptilyoushop. After 4 months of development and 2 months waiting for a payment gateway we could finally launch the project. We launched and we failed. We had programmers and salesmen in our team but none of us knew marketing. We highly failed at acquiring customers.

After working for a failed startup, I needed to earn some money. I found a job in Meteor.js. After earning enough money I could start a new project. I had very strong need to teach people to code. I did a few in-person programming courses where I used Jsfiddle for code examples and exercises. Jsfiddle was good but I needed a place where I could see student’s code. So I started working onCoderMania – e-learning platform for learning to code JavaScript and later HTML & CSS. I use it in my courses and most students are able to get through lessons quickly and without my help. I was very surprised when I saw their progress. I think CoderMania helps students to understand code quickly. Building something that have impact on how people learn to code is very exciting and motivating.

Changing the world

As a programmer you have incredible power. You can build something from nothing. You are like God. You can change the world. You can build something that will change the world.

Many people think that learning to program is hard and you must have some special skill set. No, you just need to know basics of math and logic. You can start learning to code today and if you like it, you can build your first project and find properly paid job. Or you can build your project and make money on it.

So, how programming changed my life?

I can do what I like and I get paid very good money for it. As a freelancer I can work any time, from any place in the world, on any project I like. When I get an idea, I can work on it. I live my dream, you should too!

Revolution in e-learning

You can learn almost anything online nowadays. I will focus on learning to code in this article.

There are many resources for learning to code online. It’s hard to choose the right one. As a beginner you don’t know if the source you are learning from is the better one or the worse one. Most of learning resources don’t provide feedback. Feedback is important factor in the process of learning. Feedback can improve learner’s skills prominently. I learned to code from non-interactive resources like text or video tutorials and tried to build apps myself. These times are at the end.

Learn to code with feedback

Year 2015 is the year of interactive learning. I have built an e-learning platform for learning to code called CoderMania. Students can learn to code thanks to automatically evaluated exercises and they can even ask for help if they get stuck.

Learn to code | CoderMania 2015-01-15 17-59-11-level2

This way of learning is better than reading or watching tutorials. There are also other sites for learning to code interactively. But CoderMania is the best at least for JavaScript IMHO ;-).

Learn to code with instant feedback

It’s great to learn to code interactively with ability to ask for help. But it takes some time while a student gets feedback. What if a student could learn specific topic like HTML, ask for help and get instant feedback? That would be great, right? And that’s where stream platforms like livecoding.tv, coders.tv and watchpeoplecode get on. I have tried all of them and I have chosen livecoding.tv because it has nice profile page for streamers, schedule of streaming events, big community of streamers and viewers, nice user interface and big potential. I will use livecoding.tv for my Web development school. Initially, I wanted to teach people mainly via videos on Youtube but (scheduled) streaming seems to be a much better option. The only disadvantages of livecoding.tv are that they delete videos shorter than 20 minutes after one week and they don’t provide an option to download videos. I don’t know why. But that’s not that big problem for me. I will try to make sessions longer than 20 minutes and it does not matter to me where videos are stored. Livecoding.tv continuously improves their service and that’s the best about it.

Is instant feedback really needed?

I don’t know. Watching videos and reading tutorials is great option for learning but that’s not interactive. Interactivity is the key for attractiveness.

Interactive learning is the future

And the future is now. Interactivity is important part of learning. When students can interact with teacher in real-time, that’s really engaging. As a teacher, I have tried to write tutorials, make videos and even an e-learning platform but none of them are as interactive as streaming. Streaming gives teachers and students the missing part that they would naturally have in real school – real-time interaction. That’s pure awesomeness. When I have tried to stream for the first time and realized that people from around the world can watch me and ask questions, that was a great discovery and feeling!

I will do streams about web development (HTML, CSS, JavaScript, Meteor.js, MongoDB) on a regular basis. You can watch them on https://www.livecoding.tv/elfoslav/. You will be able to learn to code with interaction with teacher as you would sit with him in the room! You can also choose any stream from the schedule. You can even stream while you are learning and you can get feedback from viewers.

I hope you will enjoy live streaming as I do.

Extreme interest in web development and coding

I’ve decided to do a web development school because there is a shortage of good quality web developers and programmers. I wanted to do it locally in Brno (Czech republic) and Dubnica nad Váhom (Slovakia). But I was not able to find enough students locally, so I decided to do the school online for everyone in the world – globally. I promoted the school on CoderMania‘s page on FacebookTwitter,  Reddit, my Twitter, Facebook and Linkedin. This gave me 14 students. I wanted at least 20 students, but I did not expect that I will get 50+ students when I write an answer on Quora and share the school on Learn MeteorJS properly group on Facebook.

25.6.2015 quora answer shared web dev school in Learn MeteorJS properly

 

I would like to teach more people, but 50 is more than I can handle. There would be even more students if I would not set a limit of students for the school. I can’t imagine how many…

I don’t want to underestimate my students but I know that many of them will not be able to learn and do homeworks each week. I have tried a few courses on Coursera but I had no motivation to finish any of them. That’s why I will try to motivate my students and tell them how their lives can change if they will learn to code. I will teach them what I learned in 3 years of web development. I hope at least 20 students will finish the school and they will be able to find a job as a web developer. My goal was to train at least 5 programmers/web developers but now it’s 10 and more. At least 30 new web developers each year… Can you imagine how much new web developers will be born in 5 years thanks to my school? 150+… It’s exciting and I am looking forward to it!

Programming for non-programmers – JavaScript practically

If you don’t like theory (like me), you will enjoy JavaScript practically. And you will learn to program faster by doing practical things than reading tons of theory.

If you have Google Chrome, great, just press key F12. If you have Firefox, install Firebug. If you have another browser, download Chrome or Firefox. If you are done, press key F12. Developers console will show up:

firebug-img

Write “Hello” in your console (with quotation marks) and press enter. You can write mathematical operations 5 + 2 – 3, 3 * 4, 6 / 2. Try one longer example: 1 + 2 * 3 / 6 – 4. Order of operations is the same as you learned at elementary school. Also, minus minus gives plus: -1 – -5.

Define a variable named firstname (in console):

var firstname = 'Tom';

To give a value from the variable, type variable name:

firstname // "Tom"

You have probably seen this annoying window:

alert('Hello');

Funny, right? You can write more alerts:

alert('Hello');alert('Welcome to JavaScript world!');

You can write any JavaScript command in developers console. But how to create real script which you can send to your friend? Create a file named index.html with this content:

<script>
  alert('Hello, I am Script. JavaScript.');
</script>

Open this file in your browser. If you can’t open this file by double clicking, click right mouse button on this file, choose from context menu “Open with” and choose Firefox or Chrome. Everything between <script> and </script> is considered as a script. Try to write in your script:

console.log('Hello, this will show up in your console');
console.log('2 + 4 = ', 2 + 4);

Press F5 (refresh) and you will see the result in your console. You can turn on/off your console by pressing F12. After every change in your HTML file you need to refresh your browser. If you want to write something in HTML file in JavaScript, use function document.write:

document.write('Hello, this will show up in your HTML document');
document.write('2 + 4 = ', 2 + 4);

Ops, everything is on one line. Add between lines HTML tag <br /> which will add new line:

document.write('Hello, this will show up in your HTML document');
document.write('<br />');
document.write('2 + 4 = ', 2 + 4);

Ok, we have learned to write into HTML document in JavaScript. Now we will write a script which was my first “useful” script:

for (var i = 1; i <= 30; i++) {
  document.write('<p style="font-size: ' + i + 'px;">Hello</p>');
}

In example above, there is some HTML and CSS. If you want to build JavaScript applications you will have to learn HTML and CSS. What does the script above do? We simply use for loop and write 30x Hello. We also set font size based on value of i variable (1 – 30). Try to scroll your browser. Nice, right?

Where is JavaScript used?

Everywhere. Really. Facebook uses JavaScript, Google uses JavaScript, everyone uses JavaScript. More info about where and why JavaScript is used would be for another article. In this article, I will show you what we can build with JavaScript, HTML and CSS:

What next?

If you want to learn more about programming web applications, you have to learn JavaScript (properly), HTML and CSS. And you will have to learn to use Google for searching information. You will need it.

You can learn more about JavaScript on w3schools. You will also find learning resources for HTML and CSS there.

The best way to learn to code is by reading and understanding theory and doing exercises. Try it on CoderMania.

You can also try Codecademy.

Learning through play. You can play CodeCombat game, learn to program and algorithmically think. I have finished a few levels and I enjoyed it. The game makes you think and it’s fun at once.

Alarming lack of programmers – solution

Every IT company is looking for a programmer and there is a big lack of programmers. Many companies have open job positions for programmers all year long. And maybe they won’t find any suitable programmer all year long. And the situation in the future will be even worse.

According to Code.org infographics there will be more than 1 000 000 open job positions (in USA) in computer science in 2020.

This is alarming. If there will not be enough programmers in the future, technology can stagnate or go very very slow.

There is a solution!

Yes, there is a solution. Every company should do programming courses for free or for a small price. Hire a person(s) who will train your future developers. I know, it’s not as easy as it sounds. It might be crazy. But imagine the company doesn’t need to look for programmers and wait for the right ones. The company will train its own army of programmers. Trained programmers will already know the company and the company will know programmers. It’s duplex relationship. So you just need to hire one developer who will train tens of developers for your company. Ok, maybe not every trained developer will want to stay in your company, but I think most will do. Because you have a relationship. Try to make the relationship strong. And you will get the right people.

I, personally, believe this is the right way for solving the “lack of programmers” problem. Many people do not know what programming is. Many people won’t learn to program themselves. They need someone to motivate and guide them. That’s why classic online courses are not enough.

I will do a programming workshop for free for my friends and I hope they will like it. I have a goal – I want to train at least 5 professional programmers, if not more. I don’t want to see people live in poverty when they can earn much more money as programmers.

If you think we need more programmers in the world and you like my idea, please spread the word. This is a serious problem and we need a solution for it.

EDIT: I build new e-learning platform for learning to code: CoderMania. CoderMania’s goal is to be “Ultimate guide for web developer”. I am looking for partners and people who want to improve quality of e-learning and web developers. Feel free to ping me on Twitter, Facebook or e-mail.