For example, the body node on Figma was, we need to come up with a class for that node inside the code. The first approach could be to use the Figma node name as a CSS class name. So, for example, you can see that the body node in Figma becomes a div with class body, the content becomes a div with class content and so on.
Now, in theory this works, but I'm not sure how familiar you are with real world Figma designs, but usually designers don't really care about proper layer naming. Instead of good names like body, content, title, you will see things like frame 23, frame 32, button 3 and so on. And if we feed this to our heuristics, the resulting code will have terrible class names.
And to expand on this, I prepared one of my favorite quotes, there are two hard problems in computer science, caching validation, naming things and off by one errors. And I love this quote because it's funny, but it's also really true. Naming things is hard also for humans. And we might not always realize it, but our job requires a high degree of creativity to solve problems. And it turns out that heuristics lack creativity. It's really hard to encode as a heuristic, a task that requires creativity. Like coming up with good CSS class names. Five years ago, this would have been a very hard problem to solve. You would have needed an entire team of machine learning engineers and weeks to tackle it. But things have changed.
You might have heard of this transformative recent technology that is, among other things, really good at creative tasks. And of course, I'm talking about large language models like Chadjupt, Claude, Lama, or many others. We won't be able to go in depth into large language models during this talk, but in a large language models are trained on enormous datasets, including open source projects on GitHub, Wikipedia, Stack Overflow, in general, a good chunk of the Internet. And their job, in a nutshell, is to always predict what comes next. So, for example, if I feed the model with, the CAD is on, it might decide that the table is what comes next. And because it has been trained on open source code, as well, it also knows the structure and conventions of popular frameworks like React. And so, if we go back to our previous example with bad CSS class names, it turns out we can solve the problem in 20 seconds by just asking, charge a bit. And here, I ask it to rewrite this React component to use better CSS names, and 20 seconds later, I have code that is using much better CSS class names. For example, user car container, user profile, user name heading, and so on.
And so, thanks to the recent advancements in AI, what used to take an entire team weeks now takes seconds. But this is just the tip of the iceberg of what's possible with these technologies. So, let's see another use case. At Anima, our goal is to go from any Figma design into code you would actually put in production. And that's a very difficult problem to solve.
Comments