Showing posts with label learn to code. Show all posts
Showing posts with label learn to code. Show all posts

Wednesday, September 14, 2016

First Days as A Developer: Nice to Meet You Backbone!


It has been already more than three weeks since I started working as a front-end developer. So, I decided to share some of my initial experience. The topic of this article might be helpful to many of you who are starting to work with real-life applications which are often quite big. To quickly understand such applications and their code is a skill every developer must master. In particular, this post will focus on how to understand large projects written in the Backbone JavaScript library.

This was precisely what I had to do when I started my new job. One of my first tasks was to work with a complex JavaScript application. This meant that it already had a particular code structure that must be respected by anyone who would want to modify it.

What made it even more challenging was the fact that this application was written in the JavaScript Backbone library with which I had no previous experience.

What to do in order to understand the application’s architecture in a way that will enable me to properly modify it? 

1. What is MVC?
When I googled what the Backbone is, I learned that it is a library for structuring JavaScript code which is based on the so-called Model, Controller, View (MVC) pattern. MVC is an architecture model for implementing user interfaces. It separates the application into three kinds of components – model (M), view (V) and controller (C). The idea is to promote a separation of concerns which should result in better structured and more maintainable applications. 

MVC Pattern

There are many other JavaScript libraries and frameworks that implement MVC pattern, for example: Ember, Angular, and React (to some degree). None of these frameworks are better or worse than the others, each is just designed for the different purpose.


2. What is Backbone?
When I learned that the application, I will be working on, is built with Backbone library, I thought that it can't be that difficult to understand it. Since I already knew how to build applications in React, I was pretty sure that this knowledge will help me to grasp the Backbone logic as well.

‘They’re all based on MVC pattern anyway, right?!’

‘...or not?!’

The truth is that React isn’t a classic MVC since it is considered only as V in MVC. Moreover, Backbone is neither an example of classic MVC. Although it provides the concept of models and views, its views are more like controllers (more on that later). 

So, there is no clear separation between models, views and controllers in Backbone.

I learned the difference between Backbone and React myself. If you compare the code structure of applications built in these two libraries, you will find out that it is pretty different. Nevertheless, they still have a lot in common. They are both great for building single page applications (SPA) which aim is to provide a rich user experience similar to desktop applications. In these applications, all the necessary code (HTML, CSS and JavaScript) is retrieved with a single page load.

Backbone has five components: events, models, collections, views and routers. However, to understand the Backbone logic, it is important to get to know the relationship between models and views.


Backbone modified MVC pattern (source: http://backbonejs.org/)

Models are containers for application data that can also send AJAX requests to the server to synchronize the data on the client with the server. On the other hand, views are responsible for rendering the models and listening to any events raised by the DOM or events raised by the model. Collection is just an ordered set of models.

When you open a typical Backbone application in your text editor or IDE, the folders will at least be named as models, views and collections. If your Backbone application contains dozens of files (as in my case), you might feel a little intimidated. Believe me, that is only the initial and wrong feeling.

The file names will often help you to understand the application's structure. You can tell from the names what a particular model or view actually do. You will also need to dive deep into the code to be able to understand it and work with it. Try to change a thing or two and refresh the browser to see how the changes affected the functionality. With this approach, you will eventually understand the basic logic of the application quite fast.

When you understand the basic logic of the application, you will be ready to actually produce a code on your own which will fit into the application's structure.


Sunday, August 14, 2016

Programming Job Acquired: Mission Accomplished

So it is finally here:


Monday was the last day in my legal job. Starting next Monday, I will be working as a front-end developer at medium-sized company. So, I think that this is the perfect time for me to reflect on my coding journey whose first scenario, which lasts from the beginning until this week, is coming to an end. However, at the same time, the second one is ready to begin.

In this post, I will share with you my 'coding journey in a nutshell' and interesting insights that I gained along the way.

My coding journey began on

26th November 2015

On this particular day, I bought my first programming online course on Udemy. Back then, my programming knowledge was equal to zero (triple equal to be precise). I was at the beginning of my journey. I had no idea that this decision will have such a huge impact on my future career.

Long story short, I got my first programming job on June this year. So, it took me seven months to learn how to code from scratch. However, I needed to wait two more months until the statutory notice period expires.



Coding Journey Part 1: Overview

At the beginning of my coding journey, I had no idea that I will be a professional programmer one day. I did not even know I was a type of a guy that can do that kind of job in the first place. My major concern was that I had no formal computer science education whatsoever. I was not even a fan of exact sciences at high school.

From my own experience, a lack of formal computer science education is the main reason why so many people are discouraged from trying to pursue a programming career. There is deeply rooted belief, that you need some kind of computer science education to be able to get a job as a programmer.

Of course, I thought this might be a hurdle for me too. However, the more I coded, learnt about coding and about other people’s experience, my state of mind began to change. I started to play with an idea that programming can be something more than just a hobby for me. I really enjoyed the creative process whose outcome is a fully functioning application made from scratch, which even do something useful.

I was literally consumed by it


At that time, I have been reading so many posts from people who switched to the programming career in a year. Well, that is a lot of time, you might say. But if you think about it, it is actually a pretty short period of time. If you are able to learn new skill from scratch and find a job in a year, well that is just awesome. Keep it mind, that people study many years to get a promising job.

I myself was able to get a job in seven months. The length of the period before you are able to get a job can be affected by many factors. You must choose your resources wisely. I already wrote two posts about JavaScript materials in general and React materials in particular. You must think about the way you learn all the time, since it is the main thing that makes a huge difference to your progress.


Turning-point No. 1: Feedback

There are so many other factors that affect your overall progress (motivation, regularity, spare time etc.). Some of them are more important than others. It is really useful to code regularly every day, as I wrote earlier. In my opinion, the most important is the one that is not fully under your control. It is feedback (check out my older post on this topic).

If you are not able to get any feedback, your progress will be much slower

When you are learning to code, it is not that difficult to get at least some. If you do not know any programmer personally, you still have whole internet overflowing with communities of people willing give you feedback for free. You can always find somebody who will tell you what is wrong or right with your code.




Of course, you can learn A LOT from your self-studies without anyone’s help. Nevertheless, you will eventually get to the point at which it will become more and more challenging for you to move forward effectively without any feedback. Your progress will be much smoother if you have a mentor who will tell you what is wrong with your code or how you should structure it better. There are so many issues that must be considered when writing proper code:
  • Is this really the best way how to write a particular code feature?
  • Should you use promise or callback in a given case?
  • Is jQuery a perfect library for this project?
  • What about React and Angular libraries, will not they be a better choice for this app?
  • What coding design pattern should you use?
Without any mentorship whatsoever, you will be forced to not only answer these questions yourself, but to figure out that you need to ask them in the first place. Of course you can do this on your own, but you will need to read a lot of other people’s code and articles to be able to do that. Moreover, it will certainly take a significant amount of your precious time.

I myself was able to get some feedback on my coding projects I built from my friends as well as from an online community.


Turning-point No. 2: Real-life Projects

However, getting some feedback will not be the only crucial point you will experience on your coding journey. At least, this was my case. As I was gaining experience, I started to feel that by working only on my own small applications, I was not able to tackle more complex coding issues and concepts. For example, you can take a look at my JavaScript calculator (guide). I am proud of it. However, it is a relatively small application. I started to feel that I need to work on some larger real-life projects to be able to make significant progress.

In my opinion, this is the right time to start looking for a job


However, when I started applying for the front-end developer positions, I was not in this phase yet. I wanted to wait at least a month to learn more about various JavaScript libraries and frameworks. I still needed a little more time.

The reason why I actually applied for a job at that time was pure coincidence. On May this year, I visited startup job fair in Prague (Czech Republic). After talking to the people from different companies, I was invited to several interviews. I told myself, that I had nothing to lose. If I will not get any job, I will at least have a better knowledge about employers' job requirements.

However, it worked out well and I got a job as a front-end developer


Coding Journey Part 2: New Beginning

Today, two months later, a couple of days before the first day in my new job, I can say that I find myself in the exact position I mentioned above, which is the right one to start looking for a job.

I am now even more confident that my decision was the right one and I am really looking forward to my new job





Wednesday, August 3, 2016

Do you want to make effective progress? Code Every Day!


Recently, I read an article from the author of famous jQuery (JavaScript library) John Resig. He talked about a topic which I am also familiar with (and I guess you as well). He discussed the fact that he does not have enough time for doing his coding side projects effectively. This led to insufficient progress when building them.

Making any side project can be very challenging, especially when you code eight hours a day at work. However, Resig's article can be also applicable to anyone who has a full-time job, not only to professional programmers. I am such an individual, since I am not coding for living yet. I know very well how it can be sometimes difficult to code after you come home from work. This means that your are basically able to code only in the evenings (or at night) or on the weekends. Since I often relax on the weekends, I code mostly after work.

This lack of spare time sometimes leads to non-consistent coding periods. In other words, I am not able to code for a couple of days in a row. Even two day gap might cause that I forget what I was working on. The worst case scenario is when my coding gap is longer than five days.

So, I am experiencing the same problem as John Resig in his article:

I am not able to code every single day.



As a solution, Resig set himself a couple of rules to become more effective and to make more significant progress when working on his side projects. In a nutshell, these rules were:
  • code every day
  • write only useful code
  • all code must be written before midnight
  • it must be open source up on Github

I guess these rules are OK for an advanced programmer, but not for me or for anyone who is not coding for living. Only skilled programmer can produce 'useful' code everyday.

So, I decided to set myself less strict rules. In reality, I created only one rule, which (I hope) will help me to become more effective programmer and to make better progress. This simple rule is:

CODE EVERY DAY – MAKE IT YOUR HABIT

However, this does not mean that you need to make your Github chart all green. I also have many of my projects on my hard drive only. As John Resig correctly pointed out: ‘this is about a change that you’re making in your life for yourself not a change that you’re making to satisfy someone else’s perception of your work. The same goes for any form of dieting or exercise: if you don’t care about improving yourself then you’ll never actually succeed.’

I also agree with his other claim that ‘the feeling of making progress is just as important as making actual progress.’ It is truly important for you to always feel that you are moving forward.

Before I go to sleep, I sometimes feel that I have not achieved coding progress that I wanted to that particular day. As a result, I code even after midnight and do not sleep enough. John Resig claims that with a habit of coding every day, this anxiety will melt away.

I guess that might be true. If I will be making progress each day, I will not feel anxiety to make bigger progress on a day, before which I was not able to code for a couple of days. Instead of feeling that I need to make progress every now and then, I will make it regularly each day.

Maybe you are now wondering, 'for how long do I need to code each day?' This of course depends on your personal preferences. I guess half an hour can be sufficient for experienced coders. However, I myself need to code at least one hour a day. Otherwise, I do not feel that my progress is sufficient. This is in part due to the fact that I often encounter an issue which takes more than a hour to solve. I guess this sometimes happens to anyone :)


Starting today, I commit myself to code every single day.


I will share my experience in some of the future posts.

What about you? Do you code every day? Or do you want to start and join me in my commitment?

If you have any experience with this approach, please let me know in the discussion.

Tuesday, May 31, 2016

Feedback - The Most Important Thing, Man


If I should mention one thing, about which I often think about these days, it is feedback. The more I code, the more I am convinced that receiving feedback from an experienced individual is a necessary part of this learning process. I’ve never thought about this much before, and that was a mistake.

When you are learning to code, feedback is crucial for you since you want to write a good code and only an experienced programmer can tell you, if you’re on a right track or if your code looks like spaghetti.

When I look back at my legal university studies, I realize that I had a lack of feedback at that time. If you don’t have enough of it, you might get cocky and think that you have a complete knowledge of a particular field since there is no one who would tell you that you see only a tip of the iceberg.

If I think about that today, I end up realizing that the most important thing I was missing at that time was a constructive feedback. If you want to be really good at something, you need a help from the experienced 'one' who is willing to tell you not only that the result of your work is great but what is wrong with your work as well.

In the perfect world, feedback should be a part of every learning process.


The more I code I am writing, the more I am realizing that feedback is the single most invaluable thing that is helping me to move forward. This is true especially in the programming field, where you don’t know what you don’t know.

You can write dozens of apps in your favorite programming language, but does it mean you’re an expert in that particular language? I doubt so. You can write your versions of Facebook in jQuery and you might feel that you’re the jQuery ninja. However, no professional would really write such a complex app in jQuery. There is Angular, Backbone or React for this kind of app and also a lot of other JS frameworks and libraries for other stuff.

I know that this short post might seem too trivial for many of you. But for me, undergoing this process of thinking about the importance of feedback helped me to move forward and to look at my progress from a new perspective. Thanks to this awareness, I was able to critically evaluate the past and future of my coding journey and learn new lessons from my wrong decisions.

Monday, April 18, 2016

Best Resources to Learn JavaScript



… was the phrase I googled many times when I was starting to learn how to code. Once I typed these words and hit enter, I got hundreds of results, each recommending different learning path to pursue. This was really intimidating for me because I had no idea as an absolute beginner which resources to choose.

…there were (and still are) so many choices and opinions on how to effectively learn JavaScript. 

Should I believe all of those who are writing articles about this topic on various sites and blogs?
Who are they anyway? ... experts, beginners or do they even know how to code? Should I believe unknown individuals who express their views in the forums?

Should I believe all those opinions claiming 'this is the right way to learn JavaScript' which can be found on a variety of sites offering paid online courses? Do these sites really want to help me to learn or they just want to sell their product?

What should I do?



I guess that obvious reply to all my concerns is: 'Just google it, dude.'

It's true that you can google all of these issues. But it will make your search for the right learning path only little bit easier. Again, you'll find tons of opinion and reviews. All of them written by the people with different backgrounds. So, it will be challenging to choose which opinion are the best for you.

In the end, you'll be back in the situation described at the beginning of this post - you don't know which resources to choose.
 
A couple of months ago, I was in this situation too. There were so many options and I had no idea where to begin...

If you are starting to learn programming, I bet you are dealing with similar questions as I did back then.

I am writing this post to help you find the right answers based on my own experience. Because my aim is not to overwhelm you with resources, as the whole internet does (!), I will only mention resources that I studied from and only those I consider as the best ones for beginners. Moreover, I will organize them in a order I deem they should be studied. If I had studied these resources in that order from the beginning, I am sure that my learning process would have been faster and more effective.

Probably you are now asking yourself a question: 'Why should I believe this guy?'



My answer is: 'Well, you don’t have to.' I just want to share with you one possible way of learning JavaScript which stems from my personal experience. I want to share with you resources that helped me (and are still helping) significantly on my way to become a web developer. I hope they will help you as well.

Just take it or leave it!

A I mentioned, choosing the right resources to learn from in the field of web development might be challenging, especially for an absolute beginner. I presume that you don’t want to invest significant sum of money (e.g. bootcamps), so I am going to talk only about books and online courses which are affordable.

The problem with books and online courses about web programming for beginners in general is that they are not written or made by beginners themselves (I know that this last sentence sounds weird, but just keep reading!). This simply means that authors of these books and courses have different perspective than someone who is only a beginner. In other words, they will almost always presume that you already have some knowledge about programming.

The problem is that every one of us knows different stuff than the others. I have experienced this myself a couple of times and it was kind of frustrating because I was not sure if the programming was so difficult or I was just dumb.  In fact I was only lacking some basic knowledge that the author presumed I had.

At the beginning, you just don’t know what you don’t know.



Because I don’t want you to have similar experience, I am sharing with you a list of JavaScript resources. They are organized in the order, I consider understandable if you are starting as an absolute beginner in web development.

  1. The Web Development Bootcamp (online course)

Web Developer Bootcamp


    • this course is for anyone who wants to learn about web development, regardless of previous experience
    • this course covers not only front-end technologies (HTML, CSS and JavaScript) in detail, its second part also covers back-end stuff(Node.js, Express.js, MongoDB, deploying) as well
    • what I love about this course is that the instructor explains all the important concepts in a very accessible way and offers exercises with solutions as well

  1. Jon Duckett – HTML & CSS (book)


    • if you feel that you need more HTML and CSS knowledge, I recommend this book as a companion to the mentioned course (however I don’t consider it necessary)
    • the layout of the book is visually appealing and the language is easy to understand 
    • this book is really targeted at beginners without a technical background, and it does an exceptional job in serving this audience

  1. Jon Duckett – JavaScript & jQuery (book)


    • this book is one of the best resources for understanding the basics of JavaScript language and serves well as a companion to the course
    • it is great for  the visual learners, as just about every remotely difficult concept is illustrated in detail with helpful notes
    • if you consider books with lot of text boring, you will love this book even more
    • all of the code examples found in the book are available online for you to follow along, and every line of code is explained in clear detail

  1. Free Code Camp (online course)


    • this course offers tons of exercises - it starts with HTML, CSS and JavaScript exercises separately and then it will take you through the range of projects where you combine all these languages together and create some cool and useful web apps
    • you will also deep dive into algorithms along the way
    • it offers front-end exercises and back-end as well
    • I encourage you to combine it with the already mentioned resources – remember the best way how to learn to code always means BUILDING PROJECTS

  1. Anthony Alicea - JavaScript: Understanding the Weird Parts (online course)


    • this course will take you further into the JavaScript realm
    • it explains what happens under the hood of the JS in a very beginner-friendly way
    • this course will cover advanced concepts such as objects and object literals, function expressions, prototypical inheritance, functional programming, scope chains, function constructors (plus new ES6 features), immediately invoked function expressions (IIFEs), call, apply, bind, and more
    • what you'll learn in this course will also improve your abilities in Javascript-based technologies such as Angular.js or React.js

  1. Kyle Simpson – You Don’t know JavaScript (book series)

 

    • these books serve as a great companion to the Weird Parts course since they also offer explanation of more advanced JS concepts
    • however, they cover advanced JS concepts in more depth and are thus more comprehensive than the Weird Parts course
    • plus they’re free!
    • 6 books in the series:
      • Up & Going:  By learning the basic building blocks of programming, as well as JavaScript’s core mechanisms, you’ll be prepared to dive into the other, more in-depth books in the series.
      • Scope & Closures: Covers closure primarily, which is one of the most important foundational topics of JavaScript.
      • this & Object Prototypes: Covers the mystery of how the this keyword works, and then tackles the misconception that JS has classes. Instead, JavaScript has prototype delegation, and we should embrace that rather than trying to fake class orientation.
      • Types & Grammar: Goes deep into coercion mechanism. I encourage you to dig into it and learn it, because coercion can help improve your code if you learn how to use it properly.
      • Async & Performance: Explains why callbacks for async programming are insufficient, then goes deep into promises and generators as much better async patterns. Also covers optimizing and benchmarking JS performance.
      • ES6 & Beyond: Covering all the changes to JS coming in ES6, as well as forward looking to beyond-ES6 evolution on the horizon.

The key to learn anything in programming and beyond is always to combine different resources



Don’t believe those who claim that a single book or a single course can teach you everything you need to know about web development! This would be a huge mistake because you will be tempted to follow only one single perspective which might not be the right one for you (or not the right one for anyone).


If you like this post, or if you have any suggestions or critique, feel free to write a comment below. I would greatly appreciate it.

Tuesday, April 12, 2016

My First Post: Why I Started to Code



In this post, I would like to briefly introduce myself and tell you why I decided to become a programmer.

My name is David and I love to learn new things and meet new people. A couple of years ago, I graduated from law school and start working as a lawyer. At the law school I did a lot of extracurricular activities since I was very interested in the law. I always thought (surprisingly) that I am going to be a successful lawyer one day. However, after a few years of working in the legal field, I have begun to have doubts about the direction of my career.


I felt that the legal job was not satisfying to me anymore.


So I decided to look into other fields which I found interesting. I checked some online course on sites such as Coursera, edX and Udemy. Because I love cooking, I enrolled in the Science & Cooking first. This course was great and I definitely recommend it for anyone who wants to learn science that lies behind the creation of delicious meals. However, this course was just a hobby for me.

When I was searching for other online courses, I came across many programming-related courses. First, I was likeHow can I possibly code? I said goodbye to sciences after finishing high school and I was happy for that.” Nevertheless, I bought one of the courses – The Web Developer Bootcamp - which was kind of a new at that time and was aimed (as the title suggests) on front-end as well as on back-end web development. 


This was the moment, when my journey to become a web developer began.



As I went through this course and experienced coding in HTML, CSS and in JavaScript, it was a brand new feeling for me. “Wow, I can now create something from nothing which can be even useful. Plus I don’t have to memorize tons of information to be able to do that.” It was primarily this creative process which is involved in programming that excited me the most. The added value of this particular course was also a Gitter room where I could chat with other students and get more coding tips.

When I finished the JavaScript part of the course, I was thinking that I am learning some really cool new stuff but I was thirsty for more practical exercises. And then I have discovered the Free Code Camp, the site which purpose is to teach you how to code by doing tons of exercises.

It seemed to me that The Web Developer Bootcamp and Free Code Camp were two puzzle pieces fitting together – theoretical background + tons of exercises.


These two courses became basis for my journey to become a web developer.
 

Web Developer Bootcamp


 
Free Code Camp

At the time of this writing, it has been already a couple of months since I have written my first HTML tag. As every self-taught programmer (at least I hope it is not just me!), I know how challenging learning to code can be. This is also one of the two reasons why I started this blog. Although, I am not an absolute beginner, I hope I can convey to all of you, through my future blog posts, an original perspective on how to successfully learn to code.

Via this blog I also want to share challenges I am going through every day from the beginning of my coding journey as well as projects I am working on and other programming-related topics.



To sum up, two reasons that lie behind the creation of this blog are:
sharing my experience, projects and ideas 
document my coding journey