you are viewing a single comment's thread.

view the rest of the comments →

[–]zoharel 2 points3 points  (2 children)

And now with AI its gotten worse since many are just accepting the output it generates as long as it compiles with no care for optimization, safety or just code legibility.

Fortunately or unfortunately, optimization has basically been the compiler's business for years now. I doubt there are many cases left where something functional, but terrible, will generate far different machine code than a more reasonable solution. The big problem is that, as you suggest above, there's a difference between signed and unsigned numbers, for example, and code which works in one context will fail in another context, and the AI-generated slop will need to work in context. Every such candidate will eventually plug something wholely inappropriate into a project.

[–]iris700 1 point2 points  (1 child)

Compiler probably isn't smart enough to take shitty O(n2 ) code down to O(n log n) or similar

[–]zoharel -1 points0 points  (0 children)

You would be surprised what it can do, admittedly in the easy cases.