Can someone tell me what Strong typing and weak typing means and which one is better?

That’ll be the theory answers taken care of, but the practice side seems to have been neglected… Strong-typing means that you can’t use one type of variable where another is expected (or have restrictions to doing so). Weak-typing means you can mix different types. In PHP for example, you can mix numbers and strings and … Read more

Which languages are dynamically typed and compiled (and which are statically typed and interpreted)?

Here’s a list of a few interesting systems. It is not exhaustive! Dynamically typed and compiled The Gambit Scheme compiler, Chez Scheme, Will Clinger’s Larceny Scheme compiler, the Bigloo Scheme compiler, and probably many others. Why? Lots of people really like Scheme. Programs as data, good macro system, 35 years of development, big community. But … Read more

Why Is Dynamic Typing So Often Associated with Interpreted Languages?

Interesting question. BTW, I’m the author/maintainer of phc (compiler for PHP), and am doing my PhD on compilers for dynamic languages, so I hope I can offer some insights. I think there is a mistaken assumption here. The authors of PHP, Perl, Python, Ruby, Lua, etc didn’t design “interpreted languages”, they designed dynamic languages, and … Read more

Using Variables for Class Names in Python?

Assuming that some_module has a class named “class_name”: import some_module klass = getattr(some_module, “class_name”) some_object = klass() I should note that you should be careful here: turning strings into code can be dangerous if the string came from the user, so you should keep security in mind in this situation. 🙂 One other method (assuming … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)