Ask HN: How to switch from front-end to back-end
I am currently a solid frontend developer (which is pretty laughable to say, because my experience is just about 3 years), I know (to some degree, of course) you can say almost everything "new and shiny" (for regular apps, without graphics and etc) – popular bundlers, up to stage 1 features, React/Vue/Angular/Cycle, all this state management systems, like Redux/Mobx/Rx and other, CSS with css-next, and so on. I also played with ClojureScript and Elm – and while it seems kind of cool, I don't really see it as a solid option to bet on.
The thing is that I feel stuck. The new frameworks come up every month, a lot of people in JS community have pretty low CS understanding, and therefore the level of discussion seems pretty miserable. Moreover, I don't really want to keep up with frontend, and want to learn something more solid. Not as solid as system programming, but I feel that back-end might be a good choice. But the availability of platforms is astonishing – and while I played some time with Elixir and Clojure, I feel that I should bet on Python and Go. I want to get a versatile language(s) (I know, it is not a good idea to stick with just one language, but I need to pick it up during the year; also I like to move between countries, so it should be in demand in general in Europe.
So, what can you recommend as a fast-picking language and what is the best to become familiar with the whole cycle – development, testing, deploy to the cloud, monitoring, etc (I only scratched the surface in all these topics, so I definitely need to solidify it). I am leaning towards Python/Go (I wrote a small API for my side project in Go).
61 comments
[ 3.8 ms ] story [ 141 ms ] threadOnce you understand the common tasks that are involved in backend development, it will be easier to switch programming languages. Python is a good choice for example, it is very versatile and has been used to program various backend server. It is also being used extensively in scientific computing, machine learning and etc.
Python is a great language used often in systems programming. It's also a joy to code in.
Rust is intriguing is check it out. The build and package system is robust.
Go is great, too.
Basically you're on the right track. Now maybe just do some study on concepts like paxos or the CAP theorem. You might look into databases both relational and not as back ends often involve those.
I spend most of my day listening to podcasts. I'm glad I found them again.
I like the changelog, talk python to me, python bytes, Mac OS ken, the packet pushers network (networking centric even though I don't know much, Greg Farrow and company are hilarious), and software engineering daily and programming throw down, to name the ones I know off the top of my head
It'll allow you to get to grips with some of the gotchas you get with back-end development with an ecosystem you're already familiar with, once you've conquered those you can then start branching out to other languages and frameworks pretty easily with a solid understanding of back-end principles.
Another benefit of this approach is there's a huge demand for JS engineers who are comfortable on the front and back end at the moment, so it sounds like you're in a great position to spread your wings.
Also I am trying to create my side projects, but as I said, I suffer from not solid knowledge, so I feel that I am doing some wrong and unnecessary work all the time.
That said; it seems to me (as just one dev's opinion in the U.S.) that Europe -- particularly northern Europe -- has a pretty healthy Clojure scene. Of course, it's not going to compare to Python/Ruby/JS in # of jobs, but if you liked it, I can tell you it only gets more fun as you learn more.
One general piece of advice -- internalize this: https://gist.github.com/jboner/2841832 (latency comparison of different operations) as one or two operations at the wrong layer will overwhelm a whole lot of algorithmic cleverness.
The problem with Clojure is that I am not very proficient in JVM (actually, I know very little about it), and I know only basics (like create a simple REST CRUD), so I have some doubts that I'll end up getting job just studying language and platform in the evenings.
https://www.google.com/trends/explore?date=all&q=clojure
Heck, lots of companies you'd consider to be enterprise are building cool projects with React and Angular 2 front ends hooked up to Java or .NET on the back end. Projects like those might be a decent way for you to leverage your current experience and work your way toward back end development.
If you want to be on the safe side, go with Java.
It's there and will never die.
You are right with FE technologies keep popping up. But you will have the same issue in the BE. New BE technologies are born to solve a different problem space such as scaling, performance, or things of that nature where as FE is more focused around HTML, CSS and JS.
Overall, learn generic concept which are transferable regardless of stacks such as NoSql db such as mongodb, Relationship db such as oracle db, caching with Redis or memcached, message queue such as kafka, text indexing such as elastic search, stream processing such as storm, batch processing such as spark, and a ton of machine learning.
With that in mind, BE is aslo rather bloated, but it evolves around more area of concerns and not just CSS, HTML and JS
I know the basics, but how deep should I go, if I want to be a serious developer?
Beyond that I would go with learning what you need on whatever job you get, just be aware that choice of DB is just as fundamental as what programming language is used to a backend project.
Personally I find that the way to avoid chasing new and shiny all the time is to work for a good organization that recognizes that is not the best way to have a stable and solid codebase.
In other words, I think the solution is not so much the position you have as far as front end vs. back end but where you are working.
Working as a front-end developer, you are pretty isolated, and while it is possible to communicate with other departments (what I do), it is still seems like a different level.
So I want to shape myself as a better software developer, along with trying new field.
Than as you get comfortable you can branch out into the less meaty frameworks like Flask or Go ( if you want to call that a framework ).
Remember, beyond the actual application server and framework, there's all the other 'stuff' that goes around it. The web server, databases, caching technologies, etc. Take the well travelled path first to see the best practices, than go your own way if you really do want to 'wire stuff' yourself. ( And trust me, even with Django there's plenty of wiring required still to build a real app ).
Maybe do something like building yourself a personal Pinboard clone. Or your own personal Twitter clone. Or anything else you'd like. Deliberately just focus on bare bones functionality. No fancy extras.
And no JavaScript. Make sure your project works without it. You can add in JS later in if you really want to, but worrying about it now will just take your focus away from developing back end development skills.
Pick Django (+ Django Rest Framework if building an API) if you want to take advantage of its many abstractions, build features and ship fast.
Pick Flask if you want a small, simple codebase that's closer to the metal. You can learn more this way but it also takes more work to ship the same app in Flask vs Django IMO. One example is the Django ORM is much more intuitive and simpler to get started with than SQLAlchemy.
Well basically that was a joke, however a lot of stuff is different on the front end than on the backend. Not everything has a main event loop and async programming is not really there in many spaces. Depending on what you are doing you would need to learn a whole new programming concept, which is not that far off from my initial statement.
I want to add that because you're experience on the front-end, your transition to the back-end will be a little easier. The best way to learn how to design an API is to consume many of them!!
Also, since already have front-end experience, you may find it easier to transition from front-end -> full-stack -> back-end only. Your front-end skills will be considered full-stack experience and when you're in a full-stack role, you'll have an opportunity to learn some solid back-end fundamentals!
Good luck with this!
- My initial experience with "coding" was MySpace (HTML/CSS) which led me to learn/experiment with JS.
- Rails got me into API development because of all of its "magic" (even though now I'm less about magic by far); but it was a step.
- Having experience with HTML/CSS/JS made Rails easier as far as getting something up and running because I already knew what my views should look like and how to get them there.
- This allowed me more time to experiment and get to know Rails, leading me to discover a lot of terms and concepts I had to become more familiar with i/e cacheing, server-side rendering, deadlocks, data-layer, and the list goes on forever.
- I realized the best thing to be great at, in my case, is SQL because persisting and extracting data the way you want/need to goes so far in making other things easier.
- Finally, I started learning how to truly develop architecture, queues, schedule, etc once I got a job on a team where my peers and supervisors were willing to teach me.
Hope some of that helps!
What you probably want to focus on is the middle tier. In those three tier systems the backend is actually very low level (data processing, storage, replication, message brokering, etc) and is often handled by third-party products such as database engines.
Some (many) projects combine backend-and middle tier as if they are the same thing. And in some systems the middle-tier is very thin and just slightly abstracts the backend.
So definitions aside... if you want to transition to middle tier...
- Learn API development. Especially focus on REST and possibly GraphQL. Learn the difference between a 422 and a 401 error, GET/POST/PATCH/PUT etc, etc.
If you want to really get into backend...
- Learn hardware limitations
- Learn Linux very well
- Learn about job queues, Message busses, and interprocess communication
- Learn about service discovery and the differences between eventually consistent and strongly consistent
- Learn about containerization
- Learn about system operations
- Learn algorithms. Including graph algorithms and how to determine algorithmic complexity
Useful for both...
- Learn SQL
- Learn a few NoSQL systems... MongoDB, Elastic Search, Redis
- Learn about security
Don't worry about specific languages. The concepts carry over to any language. If you have to pick, Node.js, GoLang, Ruby, and Python are all acceptable choices for middle-tier.
Actually, I know that language is not that important, but as I said, without prior experience, I am afraid that if I will market myself as just a "backend/software developer", companies will be afraid, and with a single language it seems easier.
So, the best way just to pick a topic and go deeper, there are no resources that cover them together?
So build something simple (blogger) which touches on primary concepts : api-router, auth, access control, storage, db, cache, cloud, tests, continuous integration & deployment. Even for a small app - one will have to make lot of choices from existing components/frameworks/packages. So begin in a language you are comfortable or you like to get a hang of concepts.
Decide you want to build a REST API, design it properly (it is easy to make a not-really-REST API), write unit tests, and build it.
I've been doing backend dev for many years and my perspective is that it's better to dive in and learn things as you go along.
Yes, all of these pieces listed above are important, BUT if you focus on learning each one well, it'll be a long time before you actually ship backend code. You don't need to understand things like containers, deployment, queues, distributed systems, etc to just start.
I'm going to take an opposite approach and say that the best way to get started in backend is from the top of the stack. Build a simple web app or API, for example a journal or bookmarking service.
Language and framework choice don't really matter at this point. Fundamentals are not radically different across them aside from the biggest difference being asynchronous vs synchronous paradigms. Start simple.
Although having a meaningful product with either knowing most of this or having a mentor who can help and/or potential write code as well is difficult and you will en dup with a lot of technical debt and or problems as the product grows.
You can perhaps use "middle-tier" to be more specific about which aspects of development you mean, but there's no use in fuzzing what is actally a very clear and helpful distinction.
Node: you already now JS, the ecosystem, and the idiomatic ways to do stuff. You can focus on the differences between FE/BE
Ruby: It's easy to learn, also dynamic typed, and Rails it's a very good technology to start with backend/MVC
Python: Also easy to learn, also dynamic typed. I never played with Django..
Happy to chat 1 on 1 if you like. Email in profile.
You have several planes of "moving to backend" and I will try to go over them categorically
1. Language: not a critical choice, but since you come from a JS background, I would stay with JS. I'd start by deciding to focus on NodeJS and that ecosystem. I wouldn't switch to Go/Python unless you have an urge to learn a new language. Moving to backend dev has many aspects to it. New language is not the most important one. Few aspects of languages do matter though, you have "lightweight threads" in Go (channels), but not in Java (unless you use Quasar). Node is not exactly multithreaded in the literal sense of it. Each language has it's own abstraction around async computing, Scala/Akka futures and promises slightly different than Java's futures and promises, which are highly different than JavaScripts Promises.
2. Paradigm. learn both best and bad practices, patterns and antipatterns. Good to know some GoF design patterns, but also learning about functional programming, immutable design, reactive framework (RxJS for example). You will find out some of the front end philosophy is there in the backend too. Good design, OOP or Functional, has similar principles (single responsibility, loose coupling)
3. Databases If you want to do backend, you'll most likely need to have an understanding of how databases work. From basic RDBMS principles, transaction isolation, ACID principles, to NoSQL, CAP theorem, Big Data etc. Learning SQL, Hive dialects etc is in my opinion an integral part of backend programming.
4. Security - you must understand a lot of aspects in security, from why not use MD5 to hash passwords, what is a salt, a pepper. what is Kerberos, client SSL, and why we should stop saying SSL when we mean TLS. Why you should never use DES, why you should rather not store passwords in Java as Strings but rather as char array. How to sanitize user input, and do server side validation, preventing XSS / SQLI. What is CSRF and how to handle it on the server side. What is cookie based authentication, vs JWT. SAML, OpenID, Oauth principles. etc etc. Security must be baked into the process from start to end.
4. CS - as others have mentioned. Basic data structures and algorithms is a must.
5. Some basic OS stuff. you should know what is a page fault, virtual memory, and how OSs work in general. Caching and distributed caching, caching invalidation etc. Unless you do graphics on chips or something, then eliminating branching using bit twiddling is something I would skip... also cache alignment, unless you really are doing some really realtime stuff.
6. Learn architecture, especially, microservices, serverless, SOA, monolithic, 3 tier, what is a 12 factor app, what is distributed computing etc.
7. Learn devops and infrastructure, whether its on prem, AWS, GCP, or Azure, learn concepts such as infrastructure as code, CI/CD, configuration management, Puppet/Chef/Ansible. Docker and containers, Kubernetes, Mesos. This includes learning command line.
8. Learn basic networking. Don't lower than level 3 if not needed, but know how the network works
The differences between frontend & backend: frontend code tends to be more loosey-goosey, less robust. Generally the goal of the frontend coder is to write lots of features in a short amount of time. Backend development is more "slow", you still want lots of features, but they need to be robust and work correctly 99.99% of the time.
For that reason, I think the best way to think like a backend developer is pick a language that doesn't have dynamic objects (like Python). I'm not saying that Python can't work, I'm saying that using a static-type language will help you outgrow any sloppy thinking habits that people tend to get when they spend too much time in Javascript.
Hiring wise, Java is still a very in-demand skill. Tech wise, Java is an extremely stable and proven platform that will serve any project well. It's "boring" technology (which is a good thing). If you really want to change your thinking, then try to stop gravitating towards shiny things and instead use a "boring" platform.
And also, how much it will take to achieve some decent level (to be able to work as a middle dev)? I think with Python 1year should be fine, what about .Net?
Achieving an intermediate skill set in any language/platform will certainly take more than a year. The language itself takes very little time - but picking up maintainable (Clean Code, Pragmattic Programmer, etc) habits takes a good bit longer for most people. Python probably has more beginner resources available thanks to MOOCs and the like, but there's plenty of .NET intro sources as well.
As for advice, find a company hiring for full stack engineers and bill yourself as someone able to learn on the backend. The company also has to be one willing to take that chance. Do not get sucked into the debates of x vs y language, and be willing to adapt to what you're working with. If your credentials are strong, you may have more wiggle room to be opinionated.
Edit: Just to add, I also transitioned from frontend to fullstack, although now I'm in the hybrid land of engineering management with coding being a bonus tool for assisting with management. My company has helped multiple engineers with primarily frontend experience transition to fullstack work (or in the case of some, even exclusively backend work). I honestly think it's not worth fussing about languages, as those can be learned - even SQL. Understand your fundamentals, and make sure you present yourself as a flexible person willing to put in the time and effort to learn and you will likely succeed in a transition.
Also I recommend avoiding being desperate to switch when job searching in such a transition - few things smell worse than the stench of desperation, which will affect your pay & negotiating wiggle room.
But yeah, in terms of stable and proven solutions it is extremely safe place.
Check out and learn how to use Docker and the docker-composer ; Check Python & Ruby, choose to one you prefer. To me they are really great for database management (migrations) and administration; Lot of big websites use it in production.
Learn how to use a cache and understand why it is useful.
Check out GoLang and build your self a simple server. (Auth is great for a first approach of golang, i've been on it this week and everything is pretty much worked out by public libs) ;
Get back to SQL
If you want to land a job as fast as you can, you should get a team-enabling language like Java.
If you have some project you want to get done but need backend knowledge for it, go with a mature high productive toolset. Choose either Python+Django or Ruby+Rails and grow from there.
If you want a new area where you can have fun and learn new stuff, go wild with non-mature high learning curve tools like Closure or something even less mainstream.
If you have some very specific requirements like high availability, high concurrency, or whatever, ignore everything above and choose your toolset based on those.
I think you should take a VPS, one of (Django || Rails), do a small project all by yourself, and decide if you want to go deeper on any of those things. The alternative is to learn Java and go quickly into an entry-level job, but you won't be able to choose what to learn by doing that, besides the small project will help you learning Java too (but may make it unbearable).
Note that if you want to work for a startup, Python, Ruby, or JavaScript are much more popular languages today than Java. You can iterate much faster in Python vs Java.
I have to say though, for a frontend dev the big point is not to be able to build apps using the newest libraries. The challenge is to contribute to this libraries or even build your own one from the ground, point that it will require to have some understanding of CS.