Ask HN: What languages teach the wisdom of C without the uglyness of it?
I have been going through C again. I want the manual power on memory management and low level computing without C's ugly I/O and other pointer semantics it provides.
The syntax is inconsistent in many ways.
https://stackoverflow.com/questions/4025768/what-do-people-find-difficult-about-c-pointers
So basically, I want to be able to use pointers but in a sane way. Most of them are dependent of standard library than language anyway.
I can't afford time for going further low level like machine architecture or assembly language.
Does Pascal help? Does learning functional programming first help? If so, which small functional language( except for Haskell)?
10 comments
[ 3.7 ms ] story [ 13.8 ms ] threadNot sure what about (say) ANSI C is particularly ugly. The business about pointers to arrays versus pointers to array elements is a bit annoying (and a mistake in retrospect). But that's about it. The rest makes perfect sense.
Yes, if we are in 1967, just before Algol-68 was proposed.
Input output like scanf and printf functions are annoying and don't work on what they are asked.
Too many gotchas and not for better - like understand how the underlying system works but some side effect by merely the design of language.
Including above points, my hope is that playing with pointers in a language I want should be easier and intuitive than using in C.
Could you please help? Pascal is just as much confusing when using pointers?
Pointers are not very intuitive. You have to have a clear mental picture of what you're doing, and think very carefully about each step to make sure that you're doing what you think you are. I'm not sure that any language can save you from that. C might actually be better than Pascal, though, because it does less to try to hide what you're doing from you. On the other hand, Pascal does more about trying to keep you from doing something stupid.
Thanks for the comment!