Live data from Hacker News

Training an AI to convert design mockups into HTML and CSS

medium.freecodecamp.org

51–60 of 109 posts

Re: Training an AI to convert design mockups into HTML and CSS

#51

This is what we are all working for. If we can automate the stupid stuff we do then we can work on other interesting stuff and automate it too. I don't understand why we aren't all working on automating everything that we do. Every line of code you pulled out of the code mine today is finite and given a business logic rule engine it's outcome could have been generated.

Obligatory xkcd reference: https://xkcd.com/1205/

Also, the real metagame in software is not the automation of software construction but avoiding the need for new software entirely.

Re: Training an AI to convert design mockups into HTML and CSS

#53

This is what we are all working for. If we can automate the stupid stuff we do then we can work on other interesting stuff and automate it too. I don't understand why we aren't all working on automating everything that we do. Every line of code you pulled out of the code mine today is finite and given a business logic rule engine it's outcome could have been generated.

> automate the stupid stuff Stupid is subjective :) I'd be happy to automate backend development and focus on a top notch UX and great front-end experience.

I don't understand why we aren't all working on automating everything that we do.

All automation is not equal. For example there's automation that consists of stringing a bunch of scripts together that break as soon as anything changes. There's automation like code generators, which break as soon as a user modifies the code, and the code needs regenerating. Then there's this AI/ML code generation, which I can't see as being any different than "normal" code generators.

And finally, there's automation developers don't have to think about; like "if" statements. So called conditional statements were a brand new innovation at one point. They removed a whole class of bugs around conditional logic in assembler programs (at one time all programs were assembler, which was a major advance from writing machine instructions in hex).

In so many ways, the web is a victim of it's own success. None of the technolgoies in it are the best; html, css, javascript. Everyone wishes these things were more thought out in the beginning. But they were good enough, and what we had when the web exploded. Yes, Virginia, Worse Is Better more often than not [1]. Go read it, you'll be a better developer when you have (imo).

[1] https://www.dreamsongs.com/WorseIsBetter.html

Re: Training an AI to convert design mockups into HTML and CSS

#54

Earlier quoted context omitted.

1) Because that's how most designers create layouts who can't code an not really interested in doing so. 2) It demonstrates AI capabilities on a new level. 3) If you design in PS or Sketch, then you will create more interesting layouts, because you won't skip things that are inconvenient or hard to do.

Does anyone use SketchApp to design at all? Just curious, I thought Photoshop was being replaced..

Photoshop is still an industry standard, but more and more companies switch to Sketch or some alternative. My ex is a designer and I've seen her doing some projects in Sketch when the client borrowed a Mac :)

Re: Training an AI to convert design mockups into HTML and CSS

#55
post #26

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 accessibili…

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.

Re: Training an AI to convert design mockups into HTML and CSS

#56
The example mockup image shown is really unimpressive. As usual, the difficulty is in implementing the last 20% of edge cases and design subtleties, not well-defined black-and-white block layouts like the given example. It would've been simpler to build a classical program to handle that example, and the result would be much better and more predictably structured.

It's like programming a self-driving car for a 2D game. Trivial. Now try taking that to tar roads. I don't know why this toy example is even news, it's nowhere close to the difficulty of real-world design mockups.

The AirBnB sketch2code example is a lot more impressive, but that's basically just handwriting recognition with a 1 to 1 mapping of symbols to code pieces.

Re: Training an AI to convert design mockups into HTML and CSS

#57
post #17
post #5

Earlier quoted context omitted.

I see this attitude all the time while people are being automated out of their jobs. Those people end up getting laid off anyway, and then wondering why jobs for their skillset don't pay as much as they used to. Resisting automation doesn't help, because if you don't do it, someone else eventually will. If you're in a job that's at risk of being automated in the near term, you're much better off learning how to autom…

Here is a silly question Why will everyone need jobs if so much stuff is automated? Why not just give out free money?

Technically, no one will need jobs.

However, our society rations resources, including resources that are needed for living, and including resources that are not actually scarce, on the basis of money, which can be returned based on capital or labor. Most people have no capital, so are forced to sell their labor. As work is automated, the return on capital increases, but the return on labor decreases (because more people are competing for a decreasing amount of paying labor).

Capital-holders wanting to preserve the existing system (if they are reasonably foresighted) are promoting the idea of a universal basic income. But the equitable long-term solution to this imbalance is Fully Automated Luxury (Gay Space) Communism.

Re: Training an AI to convert design mockups into HTML and CSS

#58
post #17
post #5

Earlier quoted context omitted.

I see this attitude all the time while people are being automated out of their jobs. Those people end up getting laid off anyway, and then wondering why jobs for their skillset don't pay as much as they used to. Resisting automation doesn't help, because if you don't do it, someone else eventually will. If you're in a job that's at risk of being automated in the near term, you're much better off learning how to autom…

Here is a silly question Why will everyone need jobs if so much stuff is automated? Why not just give out free money?

Instead, why not transition from a labor based system of resource acquisition for the masses to an investor based system of resource acquisition for the masses?

Assuming that the labor economy is dying, then all laborers (truck drivers and code writers) need to figure out how to transition from generating livable income with their labor to generating livable income from their investments.

Difficult? Yes. But is it any more difficult than attempting to acquire sufficient resources to live using obsolete labor skills?

Re: Training an AI to convert design mockups into HTML and CSS

#59

This is what we are all working for. If we can automate the stupid stuff we do then we can work on other interesting stuff and automate it too. I don't understand why we aren't all working on automating everything that we do. Every line of code you pulled out of the code mine today is finite and given a business logic rule engine it's outcome could have been generated.

Because we can't automate everything we do.

For example, cleaning and wrangling data to get it into the proper shape for analysis often involves making judgement calls, which can change depending on the context. That might involve talking to the PHD researcher, who has to get on a call with the customer to talk it over.

Re: Training an AI to convert design mockups into HTML and CSS

#60
post #17

Earlier quoted context omitted.

Here is a silly question Why will everyone need jobs if so much stuff is automated? Why not just give out free money?

Instead, why not transition from a labor based system of resource acquisition for the masses to an investor based system of resource acquisition for the masses? Assuming that the labor economy is dying, then all laborers (truck drivers and code writers) need to figure out how to transition from generating livable income with their labor to generating livable income from their investments. Difficult? Yes. But is it an…

> Instead, why not transition from a labor based system of resource acquisition for the masses to an investor based system of resource acquisition for the masses?

Because that means the existing capitalist class has to be forcefully deprived of much of their capital so that it can be redistributed, and a system needs to be set up to prevent it being from be reconcentrated.

The existing capitalist class, which holds disproportionate power, largely opposes this for obvious reasons.

Post reply on HN