Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I choose scripting or compiled code for small tasks?

I'm a Java programmer, and I like my compiler, static analysis tools and unit testing frameworks as tools that help me quickly deliver robust and efficient code. The JRE is pretty much everywhere I would work, too.

Given that situation, I can't see a reason why I would ever choose to use shell scripting, vb scripting etc, no matter how small the task is if I wear one of my other hats like my cool black sysadmin fedora.

I don't wear the other hats too often, under what circumstances should I choose scripting over writing compiled code?

like image 890
brabster Avatar asked Sep 10 '08 17:09

brabster


People also ask

Is scripting easier than programming?

Answer: Scripting languages are generally easier than programming languages. These scripts are written to automate a task like a call to the server etc. within the major program. The scripts written are easy to learn and use.

Does scripting language need to be compiled?

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.

What is the difference between a compiled program and a script?

Compiled languages are executed by the operating system, while scripting languages are executed by the CPU. Scripting languages are interpreted and executed line by line when a script is run, while compiled languages need to be converted into executable code.

Is scripting the same as programming?

No, scripting languages and programming languages are not the same. Programming languages were created to make complex softwares, whereas scripting languages were created to assist programming languages. Programming languages are compiled whereas scripting languages are interpreted.


1 Answers

Whatever you think will be most efficient for you!

I had a co-worker who seemed to use a different language for every task; Perl for quick text processing, PHP for small internal web applications, .NET for our main product, cygwin for filesystem stuff. He preferred to use the technology which was most specific to the task at hand.

Personally, I find that context switching between technologies is painful. My day-to-day work is in .NET, so that's pretty much the terms I think in. For most tasks I find it more efficient to knock something up in C# using SnippetCompiler than I would to hack around in PowerShell or a scripting environment.

like image 110
Compile This Avatar answered Nov 15 '22 09:11

Compile This