
Ask HN: What languages teach the wisdom of C without the uglyness of it? - philonoist
I have been going through C again. I want the manual power on memory management and low level computing without C&#x27;s ugly I&#x2F;O and other pointer semantics it provides.<p>The syntax is inconsistent in many ways.<p>https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;4025768&#x2F;what-do-people-find-difficult-about-c-pointers<p>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.<p>I can&#x27;t afford time for going further low level like machine architecture or assembly language.<p>Does Pascal help?
Does learning functional programming first help? If so, which small functional language( except for Haskell)?
======
towaway1138
Noting that that link was closed as "not constructive".

Not 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.

~~~
flavio81
> The rest makes perfect sense.

Yes, if we are in 1967, just before Algol-68 was proposed.

~~~
towaway1138
Arguably Algol was better, in the sense of being higher-level and with fewer
sharp edges. But it looks like C probably exposes a lot more of what's
actually going on with memory, pointers, the stack, the heap, etc. That's not
always good, but you'll learn a lot that you can't really get with a language
like Java or Python.

------
piano
You don't describe what you actually want or consider 'sane'. But the answer
is probably "There's no such thing" anyway, unless you're looking for Rust,
which you probably aren't.

~~~
philonoist
Syntax is inconsistent as described in the stack overflow link's second
answer.

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?

~~~
AnimalMuppet
If you find Pascal and C equally confusing using pointers, then maybe the
problem is that you find pointers confusing, not so much the language.

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.

~~~
philonoist
I must clarify that I am _asking_ if pointers are just as much confusing in
Pascal.

Thanks for the comment!

~~~
AnimalMuppet
I think I would say that no, they are not quite so confusing in Pascal,
because they are more limited. (At least, they were in the original Pascal. I
have no experience with the more modern versions.) As a result, you couldn't
do some of the things that you can do in C, which made it easier to understand
the uses of pointers in existing Pascal code. (On the other hand, if you were
trying to get pointers to do something in Pascal, and that thing was outside
the range of what you could do with pointers in Pascal, then Pascal could be
_very_ frustrating...)

