|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Beta Member
Join Date: Jun 2011
Posts: 3
|
Hi ppl of COMPUTERFORUMS,
Are scripting languages harder for an Ametuer for a first programming experience? |
|
|
|
|
|
#2 |
|
In Runtime
Join Date: Mar 2011
Posts: 274
|
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.
|
|
|
|
|
|
#3 | |||
|
In Runtime
Join Date: Oct 2006
Posts: 206
|
Quote:
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. Quote:
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); Quote:
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. |
|||
|
|
|
|
|
#4 |
|
Site Team
Join Date: May 2010
Location: United States
Posts: 2,335
|
//Moved to programming.
__________________
No rain - no raindbows |
|
|
|
|
|
#5 | |
|
Site Team
Join Date: Mar 2004
Posts: 6,945
|
Quote:
in javascript you declare variables using var. what would you prefere? Code:
var sTest; sTest = "hello "; sTest2 = sTest + "world"; alert(sTest2); 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!
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries." |
|
|
|
|
|
|
#6 | |
|
In Runtime
Join Date: Mar 2011
Posts: 274
|
Quote:
Some examples: Batch file Code:
ECHO Hello World! Code:
Print "Hello, world!" Code:
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
|
|
|
|
|
|
|
#7 | |
|
Baseband Member
Join Date: Jun 2011
Posts: 30
|
Quote:
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;
}
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. |
|
|
|
|
|
|
#8 | |||
|
In Runtime
Join Date: Oct 2006
Posts: 206
|
Quote:
the statement i was responding to was: Quote:
Quote:
|
|||
|
|
|
|
|
#9 | |
|
Site Team
Join Date: Mar 2004
Posts: 6,945
|
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. Quote:
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.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries." |
|
|
|
|
|
|
#10 |
|
Baseband Member
Join Date: Jun 2011
Posts: 30
|
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;
}
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|