r/shittyprogramming • • Jan 25 '19
When TODO isn't good enough
if(true) throw new Exception("Don't forget about testing this part!!!!!");
151
Upvotes
r/shittyprogramming • • Jan 25 '19
if(true) throw new Exception("Don't forget about testing this part!!!!!");
103
u/foehammer23 Jan 25 '19
Basically NotImplementedException
48
u/recursive Jan 25 '19
The throw is fine. The if is stupid.
13
u/mangina_focker Jan 25 '19
I guess you haven't seen Kotlin's TODO method
5
u/[deleted] Jan 26 '19
I just put
> no;
To generate a compiler error so that I will take care of it.
2
u/checock Jan 25 '19
remembers me about raising exceptions in legacy code without tests