Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scripting Languages vs. Compiled Languages for web development

Though I come from a purely PHP background on the web development side of programming, I have also spent much time with C# and C++ on the desktop.

I don't really want to spark any flame wars, but:

When should you use scripting languages over compiled languages for website development?
(and vice versa)

Just to clarify, for the sake of this question, I define a "scripting language" to mean an interpreted language like PHP, Python, or Ruby, and a "compiled language" to mean a strongly typed, compiled language like C#, C++, Java, or VB.

like image 349
Austin Hyde Avatar asked Jun 03 '10 13:06

Austin Hyde


People also ask

Is a script language the same as a compiled language?

The theoretical difference between the two is that scripting languages do not require the compilation step and are rather interpreted. For example, normally, a C program needs to be compiled before running whereas normally, a scripting language like JavaScript or PHP need not be compiled.

Which is better programming language or scripting language?

The programming languages are faster in speed because of using a compiler, which usually runs faster as it finds all the errors at once after analyzing the program. In contrast, Scripting languages are slow as they use an interpreter that analyses a program line by line.

Is Python a scripting or compiled language?

A scripting language is one that is interpreted. Python is an interpreted language. Python uses an interpreter to translate and run its code. Hence Python is a scripting language.


1 Answers

It depends :-)

On...

  • ...where and how you want to deploy the application
  • ...the skillsets of the engineers in your organization
  • ...what third-party components you want to integrate with or incorporate

Deployment

If you need to be able to deploy the solution on any of dozens of different possible platforms, you may find that you're better off with PHP than Java (for example). There are hundreds of thousands of Java hosting providers out there, but there are probably millions of PHP hosting providers. (And I say this as a Java-head who finds PHP "so so" at best.)

This goes to OS as well. Mono aside, .Net stuff is going to limit you to Windows-based deployment (or lagging behind the cutting edge and having to very, very rigorously test each and every 3rd party component you bring in, to ensure that it doesn't have Mono...issues).

Skillsets

Coming up to speed in an environment or language is non-trivial. For most of us, picking up the basics is pretty quick, but you may not be making the best architectural/design decisions because you're (comparatively) weak on the environment/language. Skillsets count.

Related to this: Skillset hiring counts. Is it easier (and/or cheaper) to hire PHP devs with 3-4 years of experience, or Java devs with 3-4 years of experience, or C# devs, or...?

Buying/finding/integrating vs. building

In your target area of development, which server-side components or packages will you want to integrate with? PHP has a vast array of things available for it, as does Java, as does C# or ASP.Net. But they're different things (by and large), so you'll want to look at what you actually want to use.

Conclusion

So I think it's less a matter of compiled vs. scripted (in today's world), and more a matter of what's the best fit by other criteria for what you're trying to do.

Addendum: Both/And

And of course, there's always "both/and". For instance, I do work in two main, unrelated environments right now, both using a combination of scripted and compiled resources. (One of them is Java + JavaScript via Rhino on Tomcat, the other is compiled COM objects + JScript [again, server-side] on IIS.)

like image 74
T.J. Crowder Avatar answered Oct 23 '22 02:10

T.J. Crowder