>That problem is errors are handled in return values. 70′s style.
>This is one of the things I can’t stand in C.
Having to check error values for every function call is indeed a pain. But C has macros and I think it is a nice and elegant way to handle errors. I personally prefer MACROS to exceptions when writing C/C++ code. But to each his own.
Does anyone know if go supports macros ? If they do not, it is one ugly problem to have!
EDIT I just realized you can write custom exceptions that can provide similar information about line numbers, functions etc. So removed a line saying that was a plus for macros.
>This is one of the things I can’t stand in C.
Having to check error values for every function call is indeed a pain. But C has macros and I think it is a nice and elegant way to handle errors. I personally prefer MACROS to exceptions when writing C/C++ code. But to each his own.
Does anyone know if go supports macros ? If they do not, it is one ugly problem to have!
EDIT I just realized you can write custom exceptions that can provide similar information about line numbers, functions etc. So removed a line saying that was a plus for macros.