What would be working only on "your" machine?
It's about "Murphy's Law"... anything that can go wrong, will go wrong... lol.
The last couple of month of my life have been the proof for that...
Yep, I know that. But, well, I remain convinced there just has to be a better way...
well...
One does have to think there just has to be a better way. Pascal and BASIC are ancient history... BASIC was doing strings before C was ever written.... It's not like the issue was a total surprise to K&R... but here we are, using a language with no real awareness of text, 30 years later.
Well, that's all a matter of perspective and on priorities/purpose for the language written...
C was perceived as a tool to write an operating system and its tools, being able to handle any kind of data in any location of memory. That's the way how all data is more or less seen as a "stream" and the way most everything is accessed by explicit pointers (more or less, all a bit simplified). That's also the reason why there are basically only 4 types of data in C, char, int, float and pointer. As simplistic as assembler, which is one of the reasons why a lot of people refer to C as a "higher level assembly" language.
BASIC and Pascal at least originated with a different purpose, providing a tool to teach/learn programming.
BASIC was made easy to understand and getting started, so to "communicate", it had from the start a string type as well as floats.
Same for Pascal, though Wirth took it one step further and integrated more stricter rules, which in return "turned off" a lot of professional programmers, who (or at least thought so) "know what they are doing".
But because they make a lot of application type programming easier, both BASIC and Pascal quickly saw widespread use in that area, in particular after suitable compilers became available, like the flurry of Business BASIC variants in the '80s as well as UCSD and Borland/Turbo Pascal, which then evolved into Delphi on Windows...
But in any case, the way how strings can be used in any language doesn't really have anything to do with your subject of using stack or heap...
Not that C can't manipulate text... it clearly can... but look at all the problems with buffer exploits and string overruns that have plagued Windows (and other OSs too)... all of this could have been avoided with just a little forethought, way back when...
Actually, the first version of Windows were written with a heavy dose of Pascal... ;-)
But that we have those kinds of issues today, that is more the fault of the programmers than of the language being used. You can write safe programs in C as well, it just requires a more methodical way of working, which in turn takes more time, which in turn casts more money and therefor is discouraged in order to rush products out of the door...
Here's a hint... Pascal and Delphi both have native string types. They also have built in array bounds checking... and guess what, nobody has ever penetrated either with buffer exploits or overruns... That's gotta tell you something.
Well, Delphi IS Pascal, just a specific implementation of it...
And I would not bank my money on the fact that this never has/will have happened, you can program a hell of a mess in any programming language, some just lend themself to this better than others...
Oh and incase we don't speak before ... Happy new year, my friend.
Happy New Year to you as well...
Ralf