I always reccommend Amos Prfessional & Compiler because I have a problem with C.
int main(void)
Why is that statement necessary? I read your page, and there is no real reason for it. Instead of void, what if I put in 9? I mean you say if it's not there it won't work, but does nothing, and yet every company that writes a compiler, won't remove the necesity to place it in the program.
It defines the entrypoint to your program. void means
no arguments are supplied. The real signature is
int main( int argc, char*argv[] )
where argc is the argument count and argv is an
array of the strings passed to the program on invocation.
Why have a "main"? Well it allows you to define it
where you want - and you can have C "programs" which are not executable - useful in building libraries.
there's
#include
I don't see a reason for that, other than every company that makes a compiler, won't remove the neccesity for it. If you don't use it, you can't print on the screen, yet if you use the print statment, clearly you want to print something, so logic clearly dictates that it HAS to be there, so, programming, being based on logic, should INCLUDE include AUTOMATICALLY, and yet again, no SW company will do the logical choice and automatically include, include, if you use the print statement.
Because there are different methods of printing. stdio just happens to be one place where printing to the screen is implemented. In fact it contains all console I/O functions that write to stdout, stderr and read in from stdin.
There is fprintf which is used for printing text to a file descriptor, sprintf which is used for printing text into a string.
C is a language with no built in functions you see. It has basic types and operators. This allows you to re-define printf somewhere else ( say make it print to a graphical window ).
Therefore, these annoying things, many others, prevent me from using it. I don't want to memorize, if I use "if...then", maybe I need another #include, or it won't work. It should be handled automatically. I don't like listing variables, their type should be part of their name (i.e. $ is string, % is binary, etc).
printf( "Hello World!\n" )
I totally don't see a necessity for ( ) and " ", when basic easily survives with just " ".
It isn't a logical language.
Au contraire, it is an extremely logical language. ( indicates start of parameters, ) indicates end of parameters so that you can make parameters span multiple lines.
Why should types be part of their name? What benefit does it give you?
; indicates end of statement. Again this is useful for
multi line stuff but also for single line stuff where
you might want to fit multiple statements into one
line ( for example the use of ; in if and while ).
Automatic includes would break the ability to redefine functions.
I would NEVER recommend AMOS pro and compiler
first because it has a bunch of sucky default requesters that allow everyone to spot an AMOS pro program a mile of ( that and everyone forgets to trap CNTRL-A ) and secondly the add on routines for supporting AGA do not work well into the environment and finally because it does not support RTG by itself.
Lastly, it teaches you sloppy programming habits.