Hacker News new | ask | show | jobs
by TheAceOfHearts 3057 days ago
Writing HTML and CSS to implement a mockup is trivial for anyone with even a little bit of web dev experience. If you want high quality code, an AI isn't going to produce that.

I can't imagine ever using something so complex, if I can implement the same thing in a few minutes.

There's also further considerations when dealing with the real world. For example, you need to be aware of how to handle different accessibility features. Designers rarely seem to care about things like accessibility, but it needs to be declared somewhere.

7 comments

Having done web dev for 10+ years, I would say that not all HTML/CSS implementation is trivial, especially when you have complicated layouts, are supporting older browsers and need your pages to be responsive. Not rocket science, but not trivial. Maintainability also takes a certain amount of skill, but if you're not having humans touch the code, then that ceases to be a concern I guess.
> I can't imagine ever using something so complex, if I can implement the same thing in a few minutes.

What if the complexity is hidden behind a CLI?

Also, the goal is to refine the output to near-human levels. It's not perfect yet, but can be worked upon, and seems to be a promising foundation.

If we think AI would not do awesome code, then we're ignoring the achievements of many of the AI bots. I saw an LOL bot outperform lots of world class videogamers. What makes you think a bot will not outperform any HTML/CSS frontend dev.
coding is more of an art than science, every projects has different ways how the html and css is set up, how do you onboard the AI? It is a lot of surface to cover, the AI we have today is not able to outperform a frontend dev, frontend is harder than playing a game, a lot more possibilities
There is a huge difference between these two scenarios. LOL has a very clear objective function and feedback. Code quality is a metric that is hard to make precise, even humans have trouble with it.
Right now, context. The ai will outperform us.

But it currently lacks a lot of data to do so. A mock up is only a small part of the data and feedback loop you need to create a ui.

And then layer in techniques for performance and accessibility best practices. Those are complexity modifiers beyond just slinging code out of an AI.
Does it matter if the code looks ugly or not? End users are not going to see the UI. If i have an AI in my toolbox that autoconverts designs to Code, within a minute. It would speed up my development time by a lot!
It matters because ugly code is probably also slow code (consider loading of unnecessary resources, and consider an excessively complex DOM). And probably also a page lacking accessibility.
> It matters because ugly code is probably also slow code

This is a very bad assumption, that's highly dependent on subjective and overly-broad terms like "ugly" and "slow".

Optimized assembly code is ugly, but it's also probably faster than what a human would choose to write.

Linguists used to have this human-understandably-sized set of speech units called phonemes. Once we abandoned those for finer-grained pieces that were too many and complicated for a human to grasp, speech recognition got better.

Understandable by a human may be a fundamental limitation on the power of our models.

Actually, I ran both through voiceover on the mac and they fared decently well.

The first example only had a slight issue that you couldn't get to any text to describe the images. Only because the alt tags are empty.

The second example, the bootstrap one, was ok as well. Except for the usual odd ul inside a nav example. Well, I find it odd. Voiceover sees that as a group nested inside a group. Just a nav with children works just fine. For instance, if I remove the ul and change the list items to divs then voiceover is much clearer of what's going on.

But the thing is, screen readers would love something like this. Simply because screenreaders love very basic and simple html. This thing generates very basic and simple html. Accessibility gets challenging when start considering a more modern single page app type of website.

Seems like you could add two additional training parameters to the model to compensate.
This isn't even remotely an issue.

Do you inspect the code generated by your compiler? No, but even if you do, they have had 20-30 years to develop good output.

What makes you think AI output is never going to improve? And more importantly: why does it matter?

You don't scale. If you find a way to make sites more accessible, can you modify all existing sites that you've made? If you find a way to make your sites load 10% faster, can you deploy that to every existing site you've already made?

Also, how many sites can you make per day? If you could make 100x as many sites, you'd learn more about all the weird things that customers want. With machine-generated sites, you could then apply those lessons to all new and potentially old sites.

And every extra little but that doesn't need to be there adds up to technical debt for templating.