| General > General Technical Chat |
| C language 50th anniversary |
| << < (3/13) > >> |
| tom66:
It's not as if non-C approaches investigated at the same time are flawless. Pascal-style strings prefixed with length are also problematic because the length has to be tracked by all operations to that string, so you can still cause buffer overflows by triggering a bug in that logic, and you need to pre-estimate the string size range to know whether a byte or word is appropriate for length, or use some variable integer type. And don't get me started about the hodge-podge that C++ strings are with SSO and reallocated/pooled buffers. Use after free() can is a consequence of a lack of garbage collection and memory management built into the language. This was probably not a conscious decision, there was just no need for it when Unix systems typically had under a megabyte of memory. Besides, even if it was considered at the time, you couldn't just rely on your interpreter or language to handle memory for you, you had to do it properly, else you'll just run out. The biggest issue I have with modern languages is the level of bloat they add to remove errors that could be avoided by conscious security design and audits. The reality is that security is only seemingly a concern when things go wrong, so these checks only get done on the most essential software. I mean, come on, things like the printf() BMW bug are just showing embarrassingly poor practices that signal overall bad practice in the organisation, rather than a failure of the language itself. |
| Marco:
The whole concept of in line escape sequences is a C/Unix'ism and the cause of SQL's disastrous economic damage. The Null in a way is the grand daddy of escape sequences and on top for damage caused. Escape sequences are only acceptable for truly harmless markup and interactive use, for non interactive use all parameters should have length with color coding in IDE translating the parameter/length pair into something user friendly (that includes shell programming, which takes adverserial input almost as often as SQL with the same predictable results). |
| free_electron:
--- Quote from: niconiconi on July 22, 2022, 10:19:20 am --- --- Quote from: Picuino on July 22, 2022, 07:22:48 am ---Edit: Better said --- Code: (c) ---#include <stdio.h> int main(void) { printf("Happy 50th anniversary C!!!"); return 0; } --- End code --- --- End quote --- To be more historically accurate. --- Code: (c) ---main() { printf("Happy 50th anniversary C!!!"); } --- End code --- In pre-ANSI C (K&R C, as found in the 1st ed. K&R), all functions without a specified return type are implied to be int, the main() function without a return type is implied to be 0 in practice, and printf's definition was provided by the compiler by default. Here's a PDP-11 simulation run on the original UNIX v6 system. PDP-11 simulator V3.11-0 Disabling XQ Listening on port 1106 (socket 7) SR: @unix login: root # # ls bin core dev etc lib mnt rkunix tmp unix usr # ed a main() { printf("Happy 50th anniversary C!\n"); } w 50th.c 51 q # cc 50th.c # ./a.out Happy 50th anniversary C! Not to say it's a good style in 2022. By modern standard it's sloppy - but it was what the original C was - a quick-and-dirty experimental design to test ideas, just like UNIX was also a quick-and-dirty experimental operating system for the same purpose. Both are probably the most productive experiment in computing history. --- End quote --- all that ? pfff .. no thanks click power button on commodore 64 (or any home computer or even an original ibm pc with no bootable disk in it so it falls to rom basic ) print "piss off c!" piss off c! 10 ? "piss off c!" : goto 10 run piss off c! piss off c! piss off c! piss off c! piss off c! piss off c! piss off c! at infintem ... |
| bsfeechannel:
Bashing C is like bashing the soldering iron just because today we have pick-and-place machines. |
| Picuino:
There are people who amuse themselves by contradicting others with theories that can be very absurd. The brain is like a fertile ground where all kinds of ideas can grow. I think that's good for humanity. That there are all kinds of memes (as Richard Dawkins means it) keeping in our heads makes us a less homogeneous and more varied society and, therefore, more resistant to environmental changes. The problem lies with those who end up believing that they "should not look up". Or any other conspiracy theory such as that the earth is flat. I repeat, I think that is good for society as a whole, but bad for the poor person who believes it. |
| Navigation |
| Message Index |
| Next page |
| Previous page |