What is programming like?
Im just starting to get into shell scripting and it's fun, but I hear a lot of people say that shell scripting is not programming. So im wondering how different is programming compared to shell scripting? The main thing I want to know though is, is there a plethora of commands you have to memorize like in Linux? I accumulated (learned) I feel a nice set of Linux commands, but it took me awhile to do so and really understand them and their options. Will that process repeat for leaning something like Ruby/Python or Lua? Thanks in advance!
|
Programming is structured syntax like scripting but the technically the difference is that a Programming language uses a compiler whereas a scripting language uses an interpreter. But as there are languages that can use both... it's kinda murky. Thus I'd say the difference is do you end out with a script (human-readable file that is interpreted when called) or a program (binary file that can be executed directly).
Generally speaking scripts are usually easier to write/maintain/use but as they are interpreted each time, are more CPU intensive and can give slightly less consistency (as an interpreter on one machine may not give the same results as the interpreter on another.). I'd switch to a program when getting over 1~2K lines of coding, personally. |
Quote:
|
programming means something like that:
you have a goal what you want to reach and you instruct your computer to do that. There are difficult goals and simple goals. And also there are different languages to implement your wish(es) and logic. |
Quote:
Quote:
|
Actually, I would make a different distinction with regards to Bash shell scripting, and it has to do with the sophistication of the language being used. Bash's scripting engine really wasn't designed to be used for all of the purposes that it is used for. Other programming languages are designed for serious work – whether they are interpreted or compiled.
You can add a one-line "shebang" line as the first line of your script ... say #!/usr/bin/env php, and write the rest of your script in PHP. You can do the selfsame thing for many different scripting languages and do the same thing. Bash will load the specified command-interpreter to run your script. The end-user will never know. Personally, I cringe when I have to dissect "a wad of bash-scripting" and sometimes I have found it more expedient just to replace the damned thing using a far more powerful language. |
As implied, it very much depends on what level of code you are going to be using.
High level languages tend to be relatively easy to learn because they are closer to everyday language. Low level languages like Assembler and perhaps C are vastly different and take a very special mind set to use correctly and efficiently. High level is: Type a "x"! Low level is: Think about typing an X turn your eyes to look at the keyboard. Scan it for the leter that looks like X fix its locaction in your brain. work out what movement is needed to put a finger on it decide which finger to use . . .. and so on. And even that is high level coding. |
Quote:
|
Quote:
|
Quote:
|
Quote:
Java Scripting is scripting they are not programming languages. They are scripting languages. But they will carry over into a programming language or visa versa. The logic that is. Because everyone has conditionals, loops, boolean logic operators (for the most part) bit shifting etc... it is like learning any language. You will just need to learn how to speak it for that programming language you want to learn. Then when you go to another one the meaning is the same just said differently. Code:
if [ condiston = true ] |
what is programming like?
That is a good question. I liken shell scripts to the OLDE days of writing .bat or .sys files in Windows OS (think 3.1 and '95). To me, a script is a single line (or several lines) that performs a function and does not require any compiling. Programming, on the other hand, involves running the source code through a compiler and linker to get a binary output called an executable. The 'executable' is a stand alone (doesn't need any extra items to run - you simply call its name and the program runs).
Back in the day, when BASIC was the 'go to' (no pun intended - sorry..) for programming, it was simply run via an interpreter (no compiling needed). The machine parsed each section of code for accuracy and correctness. To me - scripts are kind of like that. Hope I didn't muddy the waters too much. UN |
Quote:
|
Quote:
learn one really well, then you can move to a different one. But that is just (my) an option. ;) as far as remembering all of the function calls you will be using - you will learn them as you learn - some you will remember some you may not remember, but that is what the api docs and books are for. |
Quote:
Well yes you did a little, but that is only because BASIC is a poor example because it is both interpretative AND often compiled - but that is probably true of most interpreted programming languages. I suspect a (only slightly) better way of distinguishing them is that a script is often written by the user for his specific requirements whereas a program is pre-written and is more generic. I would also say that scripts are written to control programs. |
All times are GMT -5. The time now is 10:55 PM. |