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

The "sin" I was referring to was calling undeclared functions -- which is how there are so few #include directives in much of this code. Most of the files I looked at include <stdio.h> (probably required for variadic arguments on printf-type functions) and <file.h> (for the FILE type), and call other functions blindly.


That does make sense. My bad, I should have looked closer and noticed the implicitly defined functions.

It's not even a good idea to do that on modern computers, because implicitly declared functions do type promotions from float to double and char/short to int, and on the System V ABI, it has to pass in the number of floating point arguments there are in register eax.


It's not a good idea to do that in production code. FTFY. If you're writing research, experimental, or one-off programs then it can be a real productivity boon. I say do it for fun. You have a right to enjoy yourself and it'll still come out 10x more readable than Perl at the end of the day, let's be real.


> it'll still come out 10x more readable than Perl at the end of the day, let's be real.

A low bar, really :-P


Wait til you see old Fortran codes.




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

Search: