The creation of React revolutionized how we interact with the browser. But what are React classes and hooks? And do today’s developers use classes and hooks interchangeably? Robert Gardner, an Instructor at LearningFuze (and formerly Director of Engineering at Google!), explains the basics of hooks and classes, and why hooks are becoming more popular on the job. Plus, find out how LearningFuze’s continuously updated curriculum is preparing students for successful tech careers, not just for landing their first tech role.
When the World Wide Web was first invented, the intent was simply to share documents, which were static and unchanging and you couldn't interact with them. Over time, it became clear that the web was not just amazing for delivering these documents everywhere, but also for creating applications.
Hooks in React are simply special functions that React uses to manage the component lifecycle. There's a hook function to get and manage the component state, and there's one for indicating what should happen when the component is first drawn on the screen, as well as other things. A hook is used to manage the state.
How are hooks typically used by software engineers?
More convenient to use with React code
Most new code is being written using hooks because you can write better, more stable and reusable code
Classes are less popular than hooks in 2023. You’re more likely to find classes in legacy code.
Classes are being phased out because it's much more convenient to write code in hooks. You can write more complex code and better understand what you're doing. It is still possible for class-based components and hook-based components to run in the same application and even to interact with each other, which makes it nice for evolving and migrating from one to the other. There are a lot of older React components that were written before there were hooks. Today, most of the new React code is being written using hooks.
At LearningFuze, we have switched to teaching only hooks in order to better prepare students for what they're likely to encounter in the job market. Since most new React code is now written using hooks, our students are better off if they learn hooks instead of learning classes. They may encounter legacy code that uses React classes, but if you know hooks well, it's fairly easy to read and understand. If you end up at a company that's still using React code with classes, you can pick it up without too much trouble. As companies migrate their code from classes to hooks, most of the new code is being written using hooks because you can write better, more stable and reusable code.
Robert, how is LearningFuze keeping their curriculum up-to-date with today’s workforce needs?
We look at the curriculum frequently. The best way we can keep our curriculum up-to-date is to have instructors who have recent industry experience, which keeps us aware of what's actually happening in the industry. We know what skills are truly important and what students will be doing once they start working on their own. Another thing we do at LearningFuze is stay abreast of the types of questions that are being asked in job interviews and the skills that are being requested.
We also have a very active alumni community that we heavily interact with. They give us information about what skills they need, what new things they're learning, what they learned at LearningFuze that wasn't very useful, and then how we can better enhance the curriculum to meet their needs.
What are the biggest changes you’ve made to LearningFuze’s Web Development curriculum so far?
We've taken a very close look at everything we teach and want to make sure it provides a tangible benefit. Students have to absorb an awful lot of material in a very short time, so we focus only on the things that they'll use early in their career. We’re laying a strong foundation and adapting the curriculum to support students as they develop in their careers.
How is this iterated curriculum preparing career changers for today’s tech jobs?
My biggest goal as an instructor is to teach students skills they'll need to build a successful career. Obviously that starts with getting a job, but if they're not advancing in their career after they get that job, then I think we have failed them. They should be getting promotions, pay raises, and better work. I find that too many coding schools emphasize just getting that first job. I believe that instead of measuring a coding camp by its job placement rate, we should be measuring them by their alumni's advancement in their careers. We focus on depth instead of breadth because we think that better prepares students for a new career. It’s much easier to learn a new technology if you know one really well.
What inspired you to teach at LearningFuze, Robert?
I had a successful and enjoyable career of 14 years at Google with my final role as Director of Software Engineering. Throughout my career, I put a lot of effort into teaching and mentoring other engineers. While at Google, a colleague and I created several classes that we taught to Googlers all around the world — the most popular were on technical leadership and writing clean code — and that was very satisfying to me.
I really enjoyed helping others advance in their careers, so when I was set to retire from Google, I found that I really missed the experience of helping others. I looked into teaching and finally found LearningFuze. I was impressed with their approach to teaching and their success at helping students become software developers, so I decided to join them and I'm glad I did! I've had a lot of fun and I really love helping people launch a career in software development.
Find out more and read LearningFuze reviews on Course Report. This article was produced by the Course Report team in partnership with LearningFuze.
Jess Feldman is an accomplished writer and the Content Manager at Course Report, the leading platform for career changers who are exploring coding bootcamps.
Coding Temple CEO Evan Shy shares his predictions for tech jobs in 2023!
Intro to AI courses aimed at tech and non-tech professionals!
Find out how QA Testers could use AI in 2023!
5 greentech jobs you can land after a coding bootcamp!
Find out what makes up a processor and how they're used on the job!
Plus, how to learn Product Design at Flatiron School!
Plus, insights from former medical pros who made a career change into tech!
Learn how to set up your own data analytics environment!
Flatiron School walks us through what you need to know about scripting!
Just tell us who you are and what you’re searching for, we’ll handle the rest.