Currently I am interning at a company as a “full stack” developer (Application developer on the job title) and I realize that I am having difficulties coping with frontend tasks. This is especially true when I am tasked with implementing a new frontend feature and I can see myself struggling to get the hang of frontend development philosophies and structure (where it feels like magic, I don’t exactly see how HTML and javascript work in tandem and adding Angular.js makes it even more weird) as compared to backend (Having static typed languages (Java, C#), being able to find my way to see how is everything defined, and can easily traverse through the code).
Note* I am defining backend as everything after the REST curtain, code that is executed by the server and frontend as everything before the REST curtain, code that is for the web browser.
In the past, all my work and internships has been working with backend code, servers, databases, and files. For hackathons, I specifically do the backend architecture by myself while my teammates does the frontend coding.
With that being said, what would be the best approach to walk into frontend development with only backend experience? Language specific, what is the best way to understand how javascript and angularjs work with HTML and how do I traverse through such languages to find how everything is connected?
The justification behind this question is to seek ways to get started with understanding how Javascript, HTML, and CSS and its derivatives work so that I may have a better understanding of how it functions and how to traverse/program it. I have understanding of the basic JS syntax through web courses but not how is it integrated in web design.
4
How did you start to be a backend developer? It must’ve felt very similar back then. Yet you managed it. I’m sure you’ll do the same for frontend.
Here’s how I’d suggest your learning:
- Get to know html first. That should be very easy and quick.
- Learn CSS. Not master it. Get familiar with majority of its properties (no problem if you don’t master flexbox as long as you know it exists) and all CSS3 selector types (you should know exactly how they work for all of them)
- Play a bit with #1 and #2
- Learn DOM and understand how javascript works and interacts with it
- Learn jQuery and async communication – Ajax
- Learn Javascript thoroughly like OOP in prototypes
- learn Angular.
It should eventually all fall into place and be understandable.
I would probably start with basic HTML and CSS.
It’s not hard when you already know how to program.
I would start by creating a personal project using HTML, CSS and Javascript.
Move on to jQuery if you get familiar with js.
I think the problem is that you are trying to achieve a lot at the same time.
With that said, there are many resources online nowadays, to learn basic front-end.
The short answer is to read a good book on Angular, read it again, and then practice coding, lots of it. That said, if you’ve never worked with UI, it can be an interesting challenge, because you might be missing some fundamental conceptual information to help you put it all together.
What follows assumes that you know what an HTML tag is, and how a form element works. If you don’t, this is going to be a long haul.
Data Binding, or “how to get your dog to heel automatically”
Consider the following HTML:
<span id="name"></span>
Since you’re a server specialist, I assume you know that, in addition to providing content like XML and JSON to a client, you can also provide an HTML page to a browser. What if you could look up a value from the database, insert it into the middle of that span tag, and then output it to the browser?
<span id="name">Rufus McGillicutty</span>
That’s probably the most basic form of data binding: filling a page’s elements with content from a database. And you don’t even need to know Javascript or CSS to do it. Javascript frameworks do data binding by manipulating the DOM, rather than pasting strings together server-side.
Forms, or “This is where you type your name.”
If you have a
<form></form>
then you can obtain the values of any controls in that form when the user presses the SUBMIT button. There are ways to bind those values to a data object, and now you have some data that you can insert into your database.
That’s just CRUD, man.
Create, Read, Update, Delete. Those are the operations you will need to support. Well, those and things like “Place Order.” If you’ve done any significant server work, this should already be familiar to you.
It’s all about the architecture
Hopefully you’ve heard acronyms like MVC and MVVM. You should study those, not so much to understand the exact intricacies, but more to get the flavor of why these organizing principles work so well to build user interfaces that are useful and maintainable.
You should study, understand and know the following terms:
Model
View
ViewModel
Controller
Service Layer
Data Layer
Note that Angular might not be the best frontend framework to learn first. Knockout is probably more suitable in that regard, because it’s simpler and the learning curve isn’t quite so high. You should also have at least a passing familiarity with jQuery.
2