Interestingly the article doesn't mention two-dimensional arrays and they're curios because they bring a certain asymmetry with them. It always tripped me over the most in C because I otherwise find the language very "symmetrical". It often feels like in design of this language the beauty of expressing certain things took priority over readability or safety which I admire in a way. But somehow not in the case of the…
C array types are weird
61–70 of 148 posts
Re: C array types are weird
#62Earlier quoted context omitted.
As always, the TIOBE Index is of dubious value. The fact that it ranks Delphi above both Go and Rust should give you an idea of why.
Yeah it's rather odd, also jumps like this in ADA makes you wonder https://www.tiobe.com/tiobe-index/ada/
Re: C array types are weird
#63Earlier quoted context omitted.
Embedded programming is still in C for a lot of micro controllers and whatnot. If you’re programming with limited resources it’s essential to understand pointers and arrays. Likely you won’t be doing anything useful without them
I understand certain programmers are chained to C. We should use this opportunity to castigate the people who don't target better languages rather than trying to work with clearly outdated tools.
Re: C array types are weird
#64[flagged]
Because C is an exceptionally unopinionated language. For some people having a programming language that doesn't have a strong opinion on how things are supposed to work is a good thing. Most modern languages start with fixing C's warts (good) but then at some point turn into 'tech manifestos' (for lack of a better word). C is refreshingly devoid of opinion and that's what makes it so extremely flexible and timeless.
Compared to what?
Anyway I find it hard to believe enabling suicide is a good thing
Re: C array types are weird
#65Earlier quoted context omitted.
I understand certain programmers are chained to C. We should use this opportunity to castigate the people who don't target better languages rather than trying to work with clearly outdated tools.
What about just letting people decide for themselves instead of telling them what they should and shouldn't do.
Re: C array types are weird
#66Earlier quoted context omitted.
Yeah it's rather odd, also jumps like this in ADA makes you wonder https://www.tiobe.com/tiobe-index/ada/
Ada is being discussed a lot on HN as some sort of 'lost utopia', and AFAIK Tiobe doesn't count actual usage but (more or less) mentions.
Re: C array types are weird
#67[flagged]
Embedded programming is still in C for a lot of micro controllers and whatnot. If you’re programming with limited resources it’s essential to understand pointers and arrays. Likely you won’t be doing anything useful without them
Re: C array types are weird
#68Earlier quoted context omitted.
I understand certain programmers are chained to C. We should use this opportunity to castigate the people who don't target better languages rather than trying to work with clearly outdated tools.
What about just letting people decide for themselves instead of telling them what they should and shouldn't do.
Re: C array types are weird
#69Re: C array types are weird
#70Earlier quoted context omitted.
Learning to program with pointers is enormously useful. It's simply bad software engineering to not use typing to enforce constraints on access to pointers (or addresses, or however you'd like to term them)
IIRC that talk of about using indices (u32) to represent data in an array. That is orthogonal to representing that information in the type system since you can just type the index