Are scripting languages harder for an Ametuer for a first programming experience?

Ben Hopper

Beta member
Messages
3
Hi ppl of COMPUTERFORUMS,

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.
 
Scripting languages are usually much easier since the programmer generally doesn't need to worry about memory management

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.

...they are simpler (and less powerful) by design...

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.

... and many don't even require you to declare a variable before using it.

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.

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.

Hi ppl of COMPUTERFORUMS,

Are scripting languages harder for an Ametuer for a first programming experience?

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.
 
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).

ummm...

in javascript you declare variables using var.

what would you prefere?
Code:
var sTest;
sTest = "hello ";
sTest2 = sTest + "world";
alert(sTest2);

there is nothing wrong with declaring and assigning data to a variable in the same line.

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....


however I do agree that some languages will let you just start using variables without declaring them. not only can that be strange to debug later, it also means that you can fall into some terrible headaches with your typing.

color vs colour for example, whilst I (being British) would declare a variable of colour to describe the colour of something, if I were spending time writing lots of HTML, I might automatically write color.

which would be a different variable.

in those cases option explicit is your friend!
 
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.

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).

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.
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
Code:
ECHO Hello World!
Python
Code:
Print "Hello, world!"
C++ Program
Code:
#include <iostream> 
using namespace std;  

int main () 
{   
   cout << "Hello World!";
   return 0; 
}

Which would be harder to learn? Which is more powerful?
 
Some examples:

Batch file
Code:
ECHO Hello World!
Python
Code:
Print "Hello, world!"
C++ Program
Code:
#include <iostream> 
using namespace std;  

int main () 
{   
   cout << "Hello World!";
   return 0; 
}

Which would be harder to learn? Which is more powerful?


Batch file
Code:
ECHO Hello World!
<-Easiest to learn yet isn't powerful at all.
Python
Code:
Print "Hello, world!"
<----- Easy to learn. Not as powerful as C++ yet very utile.
C++ Program
Code:
#include <iostream> 
using namespace std;  

int main () 
{   
   cout << "Hello World!";
   return 0; 
}
<---- Most powerful of the aboves yet hardest to learn.

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.
 
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....

Root, I think it is you who mis-read. Of course you use var to declare a variable. That's what you are supposed to do. In the event that you don't, the interpreter will declare the variable anyway. This is not good. I don't know how much experience you have in debugging others code, but this can be a nightmare as your search through hundreds or thousands of lines of code you didn't write, to see where a variable may be coming from.

the statement i was responding to was:

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
Code:
ECHO Hello World!
Python
Code:
Print "Hello, world!"
C++ Program
Code:
#include <iostream> 
using namespace std;  

int main () 
{   
   cout << "Hello World!";
   return 0; 
}

Which would be harder to learn? Which is more powerful?

fair enough
 
Root, I think it is you who mis-read.

yes, you're right, I saw you declare stest and didn't even notice stest2 thus proving your point.

What I would say though is that it's wrong to say that scripting languages are bad because of this. they just aren't.

Sloppy coders will be sloppy coders, forcing them to declare variables is only going to improve a single part of their work. the rest of it is still likely to be horrible to debug.

as for searching through hundreds, or thousands of lines, I agree, a pain, but that's why there are search tools available.
I mean you're still going to need to find where the variable is assigned a value if there is a problem with the value. so you'll still be searching the same code.

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.

if there was only a choice of batch, python of C++ I'd learn to write batch files first. then I'd learn to write c++.

Python is still just a scripting language.

And it's not as ubiquitous as a command line interperator

c++ is difficult to learn, but it is worth learning.
and perfectly manageable at home given enough time and the right way of learning it (breaking it down into little blocks).

people that say I need to learn C++ so I can write games are (in my experience) destined to never learn either how to write games, or learn C++.

people who say, I want to make a program that says Hello world.
then go on to write a program that says are you a dick and moves the no button etc
then goes on to write a program that can read some simple values from a text file, then write simple values from a text file, then send simple text over a network connection, and receive simple data from a network connection etc etc etc.

they are the ones who are wise enough to break down a huge subject into manageable chunks.
and they've got some basic building blocks of a simple game,
put data on the screen, sense inputs and react to those inputs, communicate with other "players" and save data.



Basically, my opinion is... learn whatever you need to get the job done, but have the knowledge to be able to break your job down into manageable chunks.
 
Code:
#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;

}
Lol, on the topic of C++, I was just going to post this but I noticed something was wrong. Anyways this just shows how it can be used aa bit.
 
Back
Top Bottom