Hacker News new | past | comments | ask | show | jobs | submit login

With my LLM written Java code I prompt for null checks using assert statements during one of the improvement iterations. Any reference variable that could be unexpectedly null is followed by a null check immediately after its assignment.

Given that Java source code will increasingly be written by AI, it makes sense to incorporate coding patterns that are both defensive and clear for an AI to read.

Additionally, LLM code generation understands and writes Java using null values to represent cases of object absence.






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

Search: