How Gen-AI changes Frontend Engineering.

How Gen-AI changes Frontend Engineering.

How Gen-AI changes Frontend Engineering.

Generative AI is all the rage and everyoen is wondering how it is going to impact that line of work. Frontend engineers are not exceptions. Historically front end engineering is considered a complicated profession because of how quickly it changes, how rapidly technologies grow and fall and how the real complexity lies in those tail end refinements. With Generative AI however a lot of things in this space is gonna change rapidly. In this article we review some of those.

Code Generation

Code generation is already powered by various generative ai technologies. Github Copilot is often used across organizations now and some of the large organizations have their own inhouse technologies. Code generation is also getting increasingly better. This means front end engineers can now focus on solving real problems and not deal with boilerplate code. You dont have to rememebr Tailwind classes or copy paste code to add a new react component. This is a huge benefit though for the generative ai it is a low hanging fruit.

This also means that as a developer you need to learn to write code with your AI assistant. If you are not doing so already, you will have to try out Github copilot and similar tools. This also means that if you are freelancer etc. this adds to your costs of operation though in the larger scheme of things the cost of these technologies is going to be significantly lower than the benefit and savings in time it brings to you.

Code generation can also lead to more standaridzation of patterns, avoidance of common anti-patterns and you too might learn the best practices from this generated code. So, overall this is going to be a big win for the engineers.

Increasing complexity

If anyone can write new react component, it would also mean that your code might end up having Gen-AI bloat. So refactoring ,restructuring code to ensure that your codebase is not needlessly growing would take lot of efforts otherwise the AI would add a lot of needless complexity. When you rely on AI to write code, writing code becomes simpler so develoeprs do not mind writing more code. Also, sometimes GenAI is able to write more complex code than neccessary. It works but hard for humans to read and maintain it and hence ensuring that the code remains readable and maintainable would be of paramount importance.

For engineers this means their jobs would require more systems thinking and higher level design than low level details. Inter component communication, structure of components and things that AI can not do today such as maming complex refactoring across the entire stack would be primari dueties of human engineers.

Efficient testing and debugging

Another pain point in frontends is testing. Since frontends are used by humans, you have to test them like a human would. Writing unit tests is not sufficient; you have to write integration tests and even more functional tests to keep things in order.

Now, with generative AI, it can write a lot of tests for you, and with very high accuracy. In fact, generating tests from code is one of the things AI is really good at these days. This means you can have more confidence in your code while wasting less time writing tests.

Generative AI excels at generating sample data to test various behaviors. It excels at scaffolding and repetitive patterns. All of this leads to productivity gains.

Designing frontends for AI

AI is not just your code assistant anymore. It is also your customer. These days AI models are learning to use web applications. They do this by looking at your UI and navigating it like a real human. Even though we are in early days of this sort of AI it is pretty clear that in very near future, your applications will also be accessed by real AI. This presents an opportunity to build frontends for AI as well so that AI can do things easily if you want AI to use it or to make it difficult of AI to use it. Either ways we are in much early days of such work and I would advice any engineer to keep themselves up to date about this work.

Adaptive frontends.

Google CEO Sundar Pichai hinted at this trend recently, but nearly everyone is talking about it. It might soon be possible to create meta-languages that provide constraints to generative AI applications, allowing them to generate entire UIs unique to the interacting user. For example, an elderly user might prefer fewer calls to action on their front page, while someone else might prefer a more complex UI. Today, we use concepts like themes and customizations, but AI could look at user behavior and build a UI optimized for that user's workflow.

The way this would work is by building UIs not as fixed layouts, but as generators that can create UIs based on parameters. The AI could then adjust these parameters over time for each user and present an interface that is unique to them.

One example is a social network app. It might present you with fewer options in its initial UI. As you start using it, it might slowly open up more complex UX elements based on your activity. If you are someone who comments more, it might show you a comments box by default. If you prefer chatting privately with users, it might show that option on your homepage.

The Instagram and Facebook-styled "content recommendations" would be complemented by a "UX recommendation system" very soon.

Conclusion

These are very exciting times to be in the software industry, as there will be massive changes that will bring productivity gains and, consequently, faster development. However, this also presents challenges to which engineers need to adjust now. Challenges bring more economic opportunities and growth, meaning more money for engineers.