quote: Original post by NotAnAnonymousPoster
So you think that the creator of C# is making a mistake? Or just trying to appeal to the market of C++ programmers?
I can't be certain, but there's certainly a large market of s/w developers and managers who have been weaned on staticically-typed languages. Making the realisation that dynamically-typed languages might be more suitable requires a revisionists approach, and many people are unwilling to take the associated risks, if they ever make the realisation. So, I certainly think appealing to C++ programmers could be a large part of the C# strategy. Hejlsberg is not stupid (by a long chalk).
quote:
Going to be learning Smalltalk as part of my course. Can't wait to get started.
I'm sure you'll find it fun. One of the things I've observed about some C++ programmers who've learned a little bit of Python is they seem to think "this is too good, there *must* be something wrong with Python". They then go searching for weaknesses of Python, as it doesn't seem "right" that they should be able to develop s/w so easily. This is what leads to silly claims that we hear such as "it's not a real programming language", which is what people spout when they can't explain why they don't like it. One of the issues which I believe lead to this behaviour is the feeling of insecurity experienced when missing something you've been taught is fundamental to correctness. In this case, if people don't have static typing they continue to believe that is a problem, even when their own results are staring them in the face as a direct contradiction of that notion. Such is dogma.
The only weakness I'm aware of is efficiency, or lack of. Even then, the rules of premature optimisation still apply, meaning that you should probably use something like Python for the bulk of your work, and then use something more efficient when performance problems are located. Python plays quite nicely with C and C++.
I asked David Ascher what I shouldn't consider using Python for. His answer was "operating systems and device drivers". IOW, anything else is fair game. My experiences with Python thus far have not actually turned-up any performance problems, and I'm now considering redeveloping a 500KLOC C++ project using Python (or Jython). Not just for the sake of using Python - it needs redeveloping anyway. I'd hazard a guess that the Python equivalent will be less than 100KLOCs, which is very important to the overall economic picture.
quote:
The quote makes me laugh even if it turns out I don't understand it.
Oh yes, the quote's amusing. I thought you were implying it was Stroustrup who said it. He didn't.
quote:
Right, okay. I've obviously misunderstood something here. Typed languages were introduced in the 50's for efficiency.
Let's be specific. FORTRAN was introduced in the 50's and was statically typed, so you probably mean that language. FORTRAN was not introduced for efficiency, it was aimed at programmer productivity. I'm led to believe that there was much concern amongst talented programmers of the time that they would lose their ability to squeeze the most out of the machine. That's the same sort of objection we hear about dynamically-typed languages.
quote:
I read that as static typed languages, but is it just typed languages in general?
Well, static typing allows the compiler to make various optimisations based on information provided by the programmer. If you have a function which looks like this (in Python):
def foo(val): # ....
Then you do not know what type val is going to be until it is called. Therefore, the runtime must assume it can be any type, and perform something like a dynamic cast to figure out what it is before knowing whether the operations being performed on the object are legal. Obviously, if you know that val is going to be of one particular type, it is unnecessary overhead to assume it can be any type. Python doesn't facilitate adding type information in that manner. There are dynamically-typed languages which do allow that. Lisp and Dylan, for example, allow you to introduce type-information to expressions which can be used to perform optimisations. That means you can use the same language for both rapid incremental development and highly efficient code. I believe Eiffel does something similar with it's "freeze" feature, although I don't know Eiffel so don't take my word for that. With Python, you really need to resort to C++ extensions to achieve the efficiency (if you ever need to). Obviously, Python is lacking in that regard, but I don't see it as a problem for newbies since they are unlikely to be writing systems complicated enough to require high efficiency.
BTW, if you are interested in type systems, you might like to read a bit about Standard ML, which takes an interesting approach to static typing. Basically, if the ML compiler can figure out the type of an expression, then it will do so. You only need to add type information where it is absolutely needed.
[edited by - SabreMan on January 5, 2003 9:12:07 AM]