3 ms·
You're just delegating the type checking to an ad-hoc runtime. It's always better to check types rigorously and as soon as possible.
by otabdeveloper4 6y ago
You're just delegating the type checking to an ad-hoc runtime.
It's always better to check types rigorously and as soon as possible.
- enriquto 6y agoThis is not what I meant. I mean a language such as core matlab/octave, where the only "type" to speak of is the multi-dimensional array of floats.
- BoiledCabbage 6y agoDoes matlab/octave prevent you from performing invalid operations on arrays of different/incompatible ranks/dimensions? If so, then it's doing runtime type checking.
- enriquto 6y agoGood point. Yes, not all operations are defined, and it may result in a runtime error.
- otabdeveloper4 6y agoOctave has strings and they are checked at runtime: octave> strtrim(" hello world ") ans = hello world octave> strtrim([1,2,3,4]) error: strtrim: S argument must be a string or cellstring error: called from strtrim at line 79 column 5