Ben Hopper
Beta member
- Messages
- 3
Hi ppl of COMPUTERFORUMS,
Are scripting languages harder for an Ametuer for a first programming experience?
Are scripting languages harder for an Ametuer for a first programming experience?
Scripting languages are usually much easier since the programmer generally doesn't need to worry about memory management
...they are simpler (and less powerful) by design...
... and many don't even require you to declare a variable before using it.
var sTest = "hello ";
sTest2 = sTest + "world";
alert(sTest2);
Hi ppl of COMPUTERFORUMS,
Are scripting languages harder for an Ametuer for a first programming experience?
t
Even in something like this, which what I believe you are refering to, sTest2 is declared by the interpreter. YOU are not declaring it, but the interpreter will declare it for you.
Code:var sTest = "hello "; sTest2 = sTest + "world"; alert(sTest2);
but this is BAD PRACTICE in my opinion as another programmer or you in the future, will come back to this later ask: "Where is sTest2 coming from?" Only to realize that you didn't declare it. Why not just declare it? Saves time and money.
If you are a new programmer, learning on some scripting languages may be detrimental to your education. For instance, as stated above, JavaScript is so lenient that you do not have to declare a variable. This is bad (as mentioned above).
var sTest;
sTest = "hello ";
sTest2 = sTest + "world";
alert(sTest2);
I don't want to argue point-for-point, I stand by what I said. I didn't say it was good or bad, I just stated facts. The OP asked if scripting languages were harder and I explained why I felt they were easier to learn. The question wasn't which would help him become a better programmer. There's also a myriad of stuff to deal with in order to compile and link non-interpreted languages.the need to not "worry" about memory management exists due to Garbage Collection and has NOTHING to do with scripting languages over compiled languages. The ability to write in a scripting language may be just as complicated as a compiled language. The only difference is moving compiled files as opposed to non-compiled files.
EVERY programmer should worry about memory management to a certain degree. If you are not going to worry about Memory management than you will end up writing bad programs that leak like sieve's and you will end up getting overflows even if your language has a GC. It will catch up to you eventually.
There is nothing simpler about them aside from moving the raw source files as opposed to compiled files.
There is nothing less powerful about them. They do the same thing. For example Python.
you always declare variables. When you are using it, you are declaring it.
Even in something like this, which what I believe you are refering to, sTest2 is declared by the interpreter. YOU are not declaring it, but the interpreter will declare it for you.
but this is BAD PRACTICE in my opinion as another programmer or you in the future, will come back to this later ask: "Where is sTest2 coming from?" Only to realize that you didn't declare it. Why not just declare it? Saves time and money.Code:var sTest = "hello "; sTest2 = sTest + "world"; alert(sTest2);
If you are a new programmer, learning on some scripting languages may be detrimental to your education. For instance, as stated above, JavaScript is so lenient that you do not have to declare a variable. This is bad (as mentioned above).
Learn a language like C, C++, C# or Java and learn how to program. Than you can have fun in scripting languages. You will have to do JavaScript anyway since you'll probably be designing web apps somewhere along the way.
So the answer to your question is they MAY be easier to some extent, but that can be bad.
If you are looking to learn an interpreted language, do not start with PHP. Start with Python if you are talking about server side languages. For client side, the obvious choice is JavaScript.
ECHO Hello World!
Print "Hello, world!"
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
Some examples:
Batch file
PythonCode:ECHO Hello World!
C++ ProgramCode:Print "Hello, world!"
Code:#include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; }
Which would be harder to learn? Which is more powerful?
ECHO Hello World!
Print "Hello, world!"
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
I don't know if you were trying to get another point across, or hadn't really read what you wrote properly, but neither yourself nor another programmer is going to wonder where the variable came from because it is declared at the top of the script, the interpreter didn't declare it for you, you did when you wrote VAR variable....
many don't even require you to declare a variable before using it.
I don't want to argue point-for-point, I stand by what I said. I didn't say it was good or bad, I just stated facts. The OP asked if scripting languages were harder and I explained why I felt they were easier to learn. The question wasn't which would help him become a better programmer. There's also a myriad of stuff to deal with in order to compile and link non-interpreted languages.
Some examples:
Batch file
PythonCode:ECHO Hello World!
C++ ProgramCode:Print "Hello, world!"
Code:#include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; }
Which would be harder to learn? Which is more powerful?
Root, I think it is you who mis-read.
Theres an upside and downside to all of these. In my opinion don't learn BATCH because barely anybody uses it, Python would be great to learn and C++ would also be great to learn. I've used Java, Python and C++ source codes to make a game once. So, they're all great to learn in any case.
#include <iostream>
using namespace std;
int main()
{
cout << "I'm my only friend";
int a, b, c;
a = 2;
b = 3;
c = 4;
int d;
d = a + b + c;
cout << d;
return;
}