30269
« Last post by mouser on August 11, 2006, 08:57 AM »
f0dder basically covered my point of view. i'd rather have a hierarhcy of objects and function indirection that takes up 200 lines than 10 lines of code, IFF it seemed more logical and reusable to me.
however, longer code does not mean repeating code; any time you are repeating blocks of code is a good sign that the code is not as elegant as it should be.
your example above comparin a foreach type statement with c++ use of templates and iterators is a fair one. personally i find iterators in c++ pretty damn ugly, though they are powerful. don't get me wrong, i think c++ is full of flaws and ugly stuff.
and as you said the scripting languages today are becoming full oop programing languages (unlike the early days of toy scripting languages).
however, i am a fan of strong static typing. any programming language where you can just start using a variable without declaring it, or do some weird assignments between incompatible types without generating an error, is not going to be something i am happy with.
i do believe this is represents a fundamental difference in the basic approach to using a scripting language and other languages. scripting languages tend to be designed for quick and dirty coding, and try to save you the time and effort of writing elaborate stuff that the interpreter can do a pretty good job of guessing. I prefer to have a language that requires strict declaration of type information and can catch potential errors at compilation time.
for me this is a fundamental (perhaps *THE* fundamental) mistake that language designers make - not taking seriously the idea that the language should be designed to make it as hard as possible to make a mistake without it being flagged as a mistake.
99% of the problems with css and html could be solved if the damn implementations threw up real errors when something was non-compliant, instead of silently just trying to do their best to guess what you wanted to do, which makes it 100x harder to find and fix bugs.