Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with you. I never liked how AI is really generating ton of code for us, then you need to read through it and understand it. Plus, the fail rate is to high.

That is why I design the language the way it is. You must define each step you want to happen in your application. Lets take for example user registration, it looks like this

--- plang code ---

CreateUser

- Make sure %password% and %email% is not empty

- Hash %password%, write to %hashedPassword%

- Insert into users, %hashedPassword%, %email%

- Post, create user in MailChimp, Bearer:%Settings.MailChimpApi%, %email%

- Create bearer token from %email%, write to %bearer%

- Write %bearer% to web response

--- plang code ---

That is an executable code in plang. It's easy to read through and understand. You need to have domain knowledge, such as what is hashing and bearer token. You are still programming, just at higher level.

Validating what will execute, you need to learn, just like with any language, but it is relatively simple and you start to trust the result with time(at least I have)

Compared to the 130 lines or so of code in C# for the same logic, https://gist.github.com/ingig/491ac9b13d65f40cc24ee5aed0408b... That´s about 95% reduction of code, and I see this repeatedly.



But you have to double-check those 130 lines and think through all possible cases (edge cases, error cases) for each statement. I don’t see how you save all that much time. And your example output doesn’t even contain error handling, logging, and so on. There’s also no way to roundtrip any changes you want to add to the output code, while still making changes to the high-level description. (This is one reason why model-driven programming largely failed.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: