1 karma · joined Dec 22, 2024 (1y ago) · 7 submissions
comment 1y ago · link · parent
That principle can be applied to both LLM slop and handcrafted rubbish. Eventually most people will get it.
comment 1y ago · link · parent
That is hardly what the author describes.
comment 1y ago · link · parent
I agree that a feature like this could be useful, but then there are other useful features which should be added too. Where do you stop? I hope the C standards committee does not succumb to the feature bloat trend we see in many other languages (hand on heart: how many people fully understand/master all of C++/23's features?).
Need proper arrays instead of pointers to contiguous parts of memory which are interpreted as arrays? Proper strings (with unicode)? Etc. - use a different language suitable for the job.
We really need to let go of the notion that complex software must be written in a single language. Use C for the low level stuff where you do not need/want an assembler or where you want full control. For everything else there are more suitable tools.
comment 1y ago · link · parent
The OP clearly stated that he did not mind the overhead (in terms of executable size, memory consumption, execution speed) in his particular use case.
comment 1y ago · link · parent
char s[3];
Which is then initialised with: 0x48,0x69,0x00
There simply is no such thing as a string type in C.
All the "string" functions work on a char pointer which is incremented until it points to a 0.
comment 1y ago · link · parent
Once you go down the route proposed by many of the comments here - why not enhance it to deal with UTF8... Or rather implement a proper "array" type? What about the lack of multidimensional arrays instead of the pointer to pointer to ... approach? Idiosyncracies such as "int a[2][3];" being of type "int *" and not "int **"?
C was never intended to shield you from mistakes, but rather replace a macro assembler. ANSI C addressed some of the issues in the original K&R C, but that is about it.
If your use case would benefit from all of these protections, there are plenty of higher level language alternatives...