4 ms·
Perhaps its because I learned programming via shellscript(rc not bash) and piping text into programs. I never had to deal with the difference between a string a
by nmz 3y ago
Perhaps its because I learned programming via shellscript(rc not bash) and piping text into programs. I never had to deal with the difference between a string and a number unless I did something that actually needed the difference to be distinguishable. especially dealing with awk which just coerces greatly, hell, I didn't even have to deal with size limits since pure awk supports bignums. Sure, awk has types as well, but that concept came much later, especially things like scope. I think it both helped me and hurt me. I never understood why people said static typing was great, only after you had a huge program did you see where the pitfalls were.
- trealira 3y agoThat's an interesting perspective. It probably does have a lot to do with the first programming languages you learn. The first programming languages I learned were all strongly typed, so it seemed inherent to the concept of a variable when I learned it. I had to wrap my head around dynamically typed languages as "Ah, all variables are actually just pointers to structures with a tag indicating the type, and they can be rebound to objects with different types." When I write Python, I use type annotations, or I keep track of the type in my head, and use casts as convenient conversion functions. But, since Awk and shell script don't make you cast things explicitly as much as Python, I can also see how someone would learn programming with dynamic types in a really natural way.