On 20/06/13 10:47, Tim Streater wrote:
>
> Never really liked it. These days I use PHP and JavaScript. It's far
> easier with those - no types, really, and some amount of string handling.
>
I find the lack of types the biggest source of bugs and real difficulty
in doing what I want.
Especially in string handling.
And most especially when I wasted two days in discovering that two
javacsript interpretations treated exactly the same web page in two
completely different ways, in one interpreting a number as a string, and
in the other as an integer number.
loose typing hides sloppiness. And makes it impossioble to tell teh
interpreter what it is supposed to do. Yes I rtried all te so called
casting functions.
It reminded me of going back to a bug ridden C compiler for a 6809 that
simply didnt understand pointers to functions. Let alone an array of them
What I wanted was to call a function based on a value in a ( register)
variable.
In assembler. left shift the number by one (on an 8 but machine) take
teh base of the array of addresses of subroutines, add that to the
number, load ta 16 bit register with te value of waht te other 16 bit
register pointd to, push the instruction pointer into the stack and jump
to the address in the last register. Even if it didn't have that
instruction, then push that address in the stack and issue a RET :-)
No way would that compiler do it. I ended up with if (value==0) then
x(); else if (value==1) then y(); ......
I suppose it wasn't such a bad way to code it space wise..
With assembler, you always knew the machine would do what you told it
exactly, barring issue with interrupts.
The moment you put a compiler or interpreter in there, someone elses
bugs and someone else ideas about what your code means are in the way.
If I were running missions critical apps, I might prototype them in a
high level language, but I'd want them written in assembler finally.