Re:“The days of using untyped languages on non-trivial proje...
by bheadmaster on Saturday July 15, 2023 @03:01AM
(#36734302)
> Returning a string from a function is a nightmare in almost every typed language, except Delphi/Free Pascal, which does auto-reference counting, and manages it all, you never have to allocate/free memory for them, and they can hold gigabytes.
Why mention memory allocation at all? There are plenty of typed languages that have automatic garbage collection and handle strings just fine.
Go (Golang) comes to mind as a superb example of a typed language in which string handling is a breeze.
Re:“The days of using untyped languages on non-trivial proje...
by missingdays on Saturday July 15, 2023 @03:46AM
(#36734534)
The biggest problem with a couple of typed languages is string handling. The rest are doing just fine in this regard
Re:“The days of using untyped languages on non-trivial proje...
by viraptor on Saturday July 15, 2023 @03:49AM
(#36734550)
I'm so confused. What do you think happens differently in C#/python/Ruby/rust/whatever when you add one string to another? Or when you read into a buffer without a predefined size? Or assign one string reference to two variables?
Typed languages offer some efficiencies, and can, if properly used, help prevent entire classes of footguns, but they do require a bit of planning. I've always wished I could do the same "gradual type" thing with Pascal, Basic, etc. As the program is run, the types are checked, and slowly baked in automatically.