Hacker News new | ask | show | jobs
by wott 1615 days ago
Output (text output) isn't bad in C, but indeed input is another story (either lacking like keypresses, or when a convenience like scanf() is provided, it is full of traps for beginners).

Its origin is really showing: UNIXes and their line-oriented terminals. No notion of a screen-oriented console, let alone a graphical one, unlike most BASICs aimed at personal computers.

1 comments

> Output (text output) isn't bad in C

It's still poor compared to most languages I've used. String formatting is not simple for beginners. In Python you can do:

    print(num_eggs)
where num_eggs is an integer. In C you have to do:

    printf("%d", num_eggs);
One is much simpler than the other.

And on top of that, I detest languages that force you to manually enter newlines by default. Probably over 90% of use cases require a newline, so why not have the function add it by default, and either provide another print function or optional parameter for the times when you don't want a newline? The "I forgot to add a newline" headache is extremely annoying. Whereas in languages that add it by default, I rarely find myself saying "Ouch. I actually didn't want a newline there."