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

> (Note: For brevity, error handling is largely omitted from programs shown.)

I found this article interesting but to be honest I hate it when people do this. Usually it is the real-world considerations and error handling that cause the code to cease being an elegant demo and look more like the same stuff everyone else writes.



Well, the real world code is also linked at the start of the article: https://github.com/eBay/tsv-utils-dlang


Yeah code only dealing with elegant cases is elegant. News at 20.

Sometimes I wonder if software should error first, then when you bounded the failure space, you iterate on the success space as you see fit.


You've just defined Test-Driven-Development.


Sorta? But unit testing is such a problem-solving methodology that it really does seem like we want something stronger.


TDD is informal, I was thinking about something a bit more mathematical. It's hard to reason about spaces with TDD.


In a way, isn't this how software works? The problem being that an unaccounted for error might make your program exit, or produce an incorrect result, etc. I like your idea conceptually but struggling to imagine what working on software would like in a practical sense.


Given that one normally throws an exception when encountering a runtime error in D, it often is not necessary to have specific runtime error handling code.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: