Why compiling a script is bad

Or, why greycat yelled at you when you asked for a script compiler

Consider the shell script. What are its properties? What are its strengths and weaknesses?

Strengths:

Weaknesses:

Of course, I'm assuming a properly-written shell script. I therefore don't include things like "prone to newbie syntax and logic errors", because that's characteristic of any kind of programming.

Take a look at that first strength I listed again: Simple, easily understood. What does that imply? For starters, it implies that people can look at it!

If you compile a shell script, you're doing so for one of two reasons:

  1. You want it to run faster, or
  2. You want to hide it from people.

Now, take a look at this page you're reading. What is it? It's a rant. Where is it? It's on some guy's wiki. What's a wiki? It's a way of openly, collaboratively editing information. Where do wikis live? On the World Wide Web. What's the WWW? It's a system for sharing information openly with the entire world. (At least, that's what it was until the corporate realm decided to try to make money from it.) Where does the WWW live? On the Internet. What's the Internet? It's the meta-network of all the world's computer networks that have decided to talk to each other. Why did they do that? Because they like sharing information!

Information wants to be free.

The sharing of information enriches us all. Thomas Jefferson wrote,

If I'm writing a rant, on a wiki, on the World Wide Web, on the Internet, do you really think I'm the type of person who would sympathize with your attempts to hide information? Don't you think we've seen your question frequently enough that we know that's what you're trying to do?

Why do people want to hide their shell scripts?

If you're asking us for help selling a product, then you are a spammer and we want nothing to do with you. (Edit by a "spammer" wiki reader) Hello. I'm glad you want information to be free. I can assume that the information I'm providing here will remain here for logical consistency. A second reason for selling a bash script is that I can. Could I teach someone how to do it on their own? Of course. But only if they're willing to learn from me, FOR FREE, using the FREE resources all over the world wide web. This person tells me that they are too lazy to learn, and would prefer for me to do it for them, for a monthly fee. Sure, I'll put in the work for you, but I'm not going to let you have something for nothing. You chose not to put in any effort, and substitute your dollars for my knowledge. By keeping my code a secret, and having it expire monthly, it helps you stay honest with your subscription. You aren't just blindly copying my work, using it without any understanding, and profiting off of it. If you're willing to learn, I'll freely teach. If you want the shortcut, I'm free to profit off of you. (End "spammer" rant, now returning to the original wiki)

If you're ashamed of your script because you know it's a piece of shit, but you would prefer to hide its crappiness from people (but still have them use it!) instead of fixing it, then you are a blight upon humanity.

If you just wanted your script to run faster, then you're really going about it the wrong way. Shell scripts just aren't built for speed. There are ways of speeding them up within certain limits (algorithmic optimizations, replacing external commands with builtins, etc.), but in the end the final answer to speed is rewrite it in another language.


CategoryRant