Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I don' t have much programming experience, do I have hope in learning LSL?

Halmedia Palmerstone
Junior Member
Join date: 11 Jul 2004
Posts: 1
07-11-2004 22:43
I'm looking at these tutorials, and they're complicated. I took half a year of C++ in my freshman year, but thats it. I wanted to take more programming, but I gotta take that damn P.E. So did any of you learn this with little programming experience, can I have hope?
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
07-11-2004 22:51
LSL is probably one of the best newbie friendly languages I'm yet to see. It's a lot like C/Java, yet still event driven. I'd say quite probably 'yes'.

-Adam
_____________________
Co-Founder / Lead Developer
GigasSecondServer
Essence Lumin
.
Join date: 24 Oct 2003
Posts: 806
07-11-2004 22:56
If you are going to learn LSL and don't know about the LSL wiki, it's a valuable resource.
Cray Levy
Member
Join date: 7 Jul 2004
Posts: 33
07-12-2004 01:34
Everybody had little to no programming experience when they started to learn their first language :)
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-12-2004 02:52
Heh, if you took half a year of C++, you would be WAY ahead of me compared to the experiance I had when I started SL. As of my SL birth-day, I had a *very* small amount of experiance in VB... heck, I didn't even know what a variable, list, or function was. Back when I was a newbie, LSL interested me greatly, so I spent ALOT of time getting myself familiar with the language. I mainly did small experiments that assisted me in figuring out what things did, took some classes, and became the thorn in many already-experianced scripter's spines (I asked questions like mad :D).

My advice to you:
Along with looking at the LSL wiki, Id recommend you get a copy of Jake Cellerdoor's LSL CHM and take a Scripting 101 class so you can start making connections between the C++ you already know and LSL.

Also, many people like answering questions about LSL, I'm one of them. Just contact me via IM, and if Im not busy, I'll help yah out :)
==Chris
Joachim Caldera
The Programmer
Join date: 4 Jun 2004
Posts: 5
07-12-2004 03:30
Strangely, lots of programming experience is almost counter-productive to learning how to effectively use the Linden Scripting Language. There are a variety of language constructs and library functions that act extremely differently from their "real" language counterparts. When I first started LSL, for instance, I was completely thrown off by how poorly-implemented, in my opinion, the List data type is, mostly because I'm used to the power of arrays in PHP, and the power of linked lists in C++ and Java.
Another thing of note is that, for those used to building programs from scratch, in-game scripting languages are an extreme adjustment in another respect: you have to rely heavily on things you have no control over. Specifically, the user interface mechanisms for LSL are much stranger than those in "real" languages, the link message driven pseudo-object-orientation is awkward for those used to streamlined modularization (i.e. includes and packages), and object interaction takes a bit of a paradigm shift.

Not that I'm complaining or anything, as the scripting language remains the reason I joined Second Life. My point is, being an experienced programmer is not necessarily helpful for using Linden Scripting Language.
David Czukor
Prole
Join date: 8 Jun 2004
Posts: 16
07-12-2004 06:50
I have to agree w/ Joachim, except his last sentence. LSL is poorly implemented in a number of areas and feels "rushed to market," especially in the inconsistencies among function names and parameters and the huge holes (missing functions) that seem to be unaddressed.

But being an experienced programmer can only help you see around these limitations and figure out clever ways to get LSL to do things the designers had not envisioned. I doubt a new programmer would be able to do that.

As for LSL being someone's first language, well the Lindens owe you an apology! (lol) LSL may resemble C and be useful in that regard, but it has a horribly unfriendly syntax (like all C derivatives) that isn't very "high level" at all. It also has bizarre LSL-only syntax like '(string)variable' instead of 'string(variable)' which, one learned, will mess you up for other programming languages. All C-based languages have horrible syntax for looping and flow control, which are some of the most important concepts to understand in programming. A tough place to start, for sure. Perhaps worse is that LSL is not object-oriented. If you have any hope of transferring your programming skills anywhere else, you should start w/ an OO language like .NET or Java or even DHTML. And once you learn programming, you're going to want to program other things.

If you still want to start w/ LSL, I would recommend an Intro to Programming book (with a C basis), rather than the Wiki website. While indispensible if you know what you're looking for, Wiki is short on teaching material -- strictly a command reference. Without quite a bit of knowledge of "what they're talking about," Wiki is just going to befuddle you.

-- D
Cray Levy
Member
Join date: 7 Jul 2004
Posts: 33
07-12-2004 07:42
From: someone
Originally posted by David Czukor
LSL may resemble C and be useful in that regard, but it has a horribly unfriendly syntax (like all C derivatives) that isn't very "high level" at all.


It's not supposed to be high level. It's designed in a way that allows the simulator to handle thousands of concurrent threads, and to recover from script errors gracefully. It is the right tool for this job. There need to be limitations, otherwise everybody would just be exploiting the holes. Even an only slightly more lax environment like an LPMud (similar to SL but no 3D graphics, and 20 years older) provokes the occasional crash or lag due to bad programming. That's just not something you want in a commercial application.

Syntax issues are a matter of preference and not up for discussion.

From: someone
It also has bizarre LSL-only syntax like '(string)variable' instead of 'string(variable)' which, one learned, will mess you up for other programming languages.


This is standard C-style casting. It works exactly the same in C, except that C doesn't have native strings. On the other hand, string(variable) will do something entirely different from what LSL string casting does in object oriented languages derived from C syntax (anywhere from calling a function to instantiating a class).

From: someone

If you have any hope of transferring your programming skills anywhere else, you should start w/ an OO language like .NET or Java or even DHTML.


DHTML, right ;) Even Java is not a complete implementation of an object oriented language.

Java is a particularily bad choice for learning programming too, because mistakes on the programmer's part are often caught by the virtual machine. You learn from your mistakes; being able to just automatically ignore serious mistakes is not a good thing.
David Czukor
Prole
Join date: 8 Jun 2004
Posts: 16
07-12-2004 09:39
Cray,

You are quite correct, except that of course syntax is up for discussion! The arcane permutations of C syntax are well known, even enjoyed by C programmers! (Of course, they're all APL holdouts, really.) :-)

I do agree that LSL is a good tool for the job, in that it works reasonably quickly and doesn't crash the sim for other people -- both key ideas, to be sure. But those are concerns for the compiler developer, not the LSL developer, and are unrelated to syntax or suitability for training new programmers.

I would have ONLY recommended VB.NET as a starting language, but I was trying to round out the choices. I don't think that either Java or DHTML is a good OO environment, just two that are accessible to a new programmer w/o investing in a huge development environment and learning to use it.


-- D
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-12-2004 09:51
From: someone
Originally posted by Cray Levy
DHTML, right ;) Even Java is not a complete implementation of an object oriented language.

<hijack>
Java is not a full implementation of OO?


From: someone
Originally posted by Cray Levy
Java is a particularily bad choice for learning programming too, because mistakes on the programmer's part are often caught by the virtual machine. You learn from your mistakes; being able to just automatically ignore serious mistakes is not a good thing.


What language would you recommend for first-time non-LSL programmers that want to learn OOP?

==Chris
</hijack>
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-12-2004 10:13
Smalltalk! Duh! ;)

Back on topic

Can you learn LSL?
Yes

Will there be times when it seems unnecessarily hard and mean?
Yes

But there are a lot of friendly people here who will help you.
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Cray Levy
Member
Join date: 7 Jul 2004
Posts: 33
07-12-2004 10:40
Java is not fully OO because some features like multiple inheritance are missing.

I refuse to recommend any language. I'm biased towards C because of previous experience with entry level programmers.

My general rule of thumb is choose something very basic for the first steps, then move on to more abstract languages as you're learning how to do the basic things. It won't do anyone any good to learn how to use a TreeMap or a LinkedList and have no idea what they *are* at the same time.

LSL isn't too complex, so I believe it isn't the worst choice. Second Life adds the possibility of actually seeing, and touching, your creations. This ought to be a good thing.
Cubey Terra
Aircraft Builder
Join date: 6 Sep 2003
Posts: 1,725
Re: I don' t have much programming experience, do I have hope in learning LSL?
07-12-2004 10:48
LSL isn't difficult, especially if you're not doing anything particularly complicated. And with the abundance of script examples in the forum -- doh! I just remembered... they were all deleted.

Well, there's an abundance of people who can help you and give you examples if you ask for them.

From: someone
Originally posted by Halmedia Palmerstone
I took half a year of C++ in my freshman year, but thats it. I wanted to take more programming, but I gotta take that damn P.E. So did any of you learn this with little programming experience, can I have hope?


Was that your high school freshman year? You have to take P.E. now? Um... does this mean you're still in high school?
_____________________
C U B E Y · T E R R A
planes · helicopters · blimps · balloons · skydiving · submarines
Available at Abbotts Aerodrome and XstreetSL.com

Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-12-2004 10:52
Logic and effective flow control are skills that will transfer over into any language.

LSL isn't a terribly difficult language at all. If you know how to type and count, you can learn it.

Edit: No, Cubey, the script library is still there. The original scripting forum isn't though.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Joachim Caldera
The Programmer
Join date: 4 Jun 2004
Posts: 5
07-12-2004 13:49
From: someone
Originally posted by Cray Levy
Java is not fully OO because some features like multiple inheritance are missing.


Multiple inheritance is a poor example, mainly because it's dangerous. That statement is, in my opinion, equivalent to the statement, "<language> isn't a true procedural language because it lacks GOTO." It's a good thing Sun dropped multiple inheritance, not a sign that they didn't make an object-oriented language.

However, if you have any more relevant reasons Java isn't a real object-oriented language, I would be more than happy to read. (For I'm sure there are more valid reasons out there, seeing as Java remains 'not the best' language for practical applications.)
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
Re: I don' t have much programming experience, do I have hope in learning LSL?
07-13-2004 19:00
From: someone
Originally posted by Halmedia Palmerstone
So did any of you learn this with little programming experience, can I have hope?


I had almost no programming experience before joining SL (just BASIC way back when). I learned LSL by attending a Sctripting 101 class, and looking at existing scripts and trying to figure out how they work. Once i found the LSL Wiki I was truely on my way, it doesn't have alot of tutorials or the like, but it's great if you want to know how to do something, and just looking at the list of functions doesn't make it obvious, since all the functions (and events and everything) are explained fully.

If you need some extra help or even a few personal classes give me a buzz (I do them for free if ur nice :))
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-13-2004 19:14
From: someone
Originally posted by Cray Levy
Java is not fully OO because some features like multiple inheritance are missing.


Actually, if Im not mistaken, you are quite wrong on that point.

Java has a sort of multiple inheritence, since C++'s implementation has the potential for ambiguity. Java's interfaces allow the developer to specify that an object is-a something, just like inheritance does. The difference, is that Java's interfaces require that the class (or its superclass) implement all methods defined in the interface. This prevents a rather dangerous runtime condition that I forgot the name of. It occurs when a class inherits from two superclasses that share one or more identical method signatures. If the class doesnt re-implement the method that's identical in its superclasses, the interpreter doesnt know which to execute. Interfaces solve this problem since they *make* the class define the method at compile time.

However I would like to know what other features Java is missing that make it a poor OO language.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
Re: Re: I don' t have much programming experience, do I have hope in learning LSL?
07-13-2004 19:20
From: someone
Originally posted by Cubey Terra
Was that your high school freshman year? You have to take P.E. now? Um... does this mean you're still in high school?


Cubey, you *do* know that there are a good number of 18 year old high school seniors, dont you?
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
07-13-2004 19:27
From: someone
Originally posted by Christopher Omega

However I would like to know what other features Java is missing that make it a poor OO language.

Minor nitpicks about Java I picked up from my pedantic professors:
Enforced distinction between stored data and data generated algorithmically (Class.method() vs Class.attribute)
Lack of builtin support for invariants, pre and post conditions (though you can use third party tools like iContract).
Not everything is an object, since you can use native types (int instead of Integer etc).
Mind you, I couldnt care less about this, and since the last OOP class I took was in 1998 I could be wrong :p
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-13-2004 22:58
From: someone
Originally posted by Eggy Lippmann
Lack of builtin support for invariants


Isn't the "final" keyword for this purpose?
wizzie Baldwin
Registered User
Join date: 23 May 2004
Posts: 52
07-14-2004 02:21
From: someone
Originally posted by David Czukor
I have to agree w/ Joachim, except his last sentence. LSL is poorly implemented in a number of areas and feels "rushed to market," especially in the inconsistencies among function names and parameters and the huge holes (missing functions) that seem to be unaddressed.

But being an experienced programmer can only help you see around these limitations and figure out clever ways to get LSL to do things the designers had not envisioned. I doubt a new programmer would be able to do that.

As for LSL being someone's first language, well the Lindens owe you an apology! (lol) LSL may resemble C and be useful in that regard, but it has a horribly unfriendly syntax (like all C derivatives) that isn't very "high level" at all. It also has bizarre LSL-only syntax like '(string)variable' instead of 'string(variable)' which, one learned, will mess you up for other programming languages. All C-based languages have horrible syntax for looping and flow control, which are some of the most important concepts to understand in programming. A tough place to start, for sure. Perhaps worse is that LSL is not object-oriented. If you have any hope of transferring your programming skills anywhere else, you should start w/ an OO language like .NET or Java or even DHTML. And once you learn programming, you're going to want to program other things.

If you still want to start w/ LSL, I would recommend an Intro to Programming book (with a C basis), rather than the Wiki website. While indispensible if you know what you're looking for, Wiki is short on teaching material -- strictly a command reference. Without quite a bit of knowledge of "what they're talking about," Wiki is just going to befuddle you.

-- D


I'm just going to address several issues here.
first some valid C syntax:

unsigned short Hash( void *p )
// Returns a hash code based on an address
{
unsigned int val = reinterpret_cast<unsigned int>;( p );
return ( unsigned short )( val ^ (val >> 16));
}

int numberOfSides = 6;
float exactLength = 4.874;
int approxLength = (int)exactLength;

printf("$$ = %ld\n", (long)getpid());

hmmmmmmm the casting looks remarkably similar to Linden Script. I think you got a little confused.

The next thing: horrible syntax for looping and flow control Several points I want to make on this.
C was born in 1969 at Bell Labs, it was and remains a mid-level Systems Programming language that is not well suited to script kiddies. It was never meant to be a main stream language. Somehow it gathered a huge following and popularity. What was intended with this language, was a completly portable language across all sorts of platforms. Meaning after an original kernel was produced in the native assembler for some specific architecure then the wrapping modules (once a C compiler/loader/linker was installed) written in C could be the same on almost every machine.
C is NOT a high level language like ADA, Pascal, Basic. It's a MID level language that allows in-line assembly language direct calls to objects written in assembler.

My fond saying is that C is a: "skip-dancing-naked-through-the-forest" kind of language. The forest CAN be a dangerous place especially if your naked.

C has some of the best looping and program flow designs of any language on this planet.
C also branched out into the OOP world with C++ and Objective C (found on the NEXT computers running NEXTSTEP)

Oh by the way, about the only true OBJECT ORIENTED PROGRAMMING LANGUAGE was SmallTalk In that language even language primitives like integers and floats and strings were objects! All of the other "OOP" languages today are really only pseudo OOP languges. Just because you can create objects doesn't mean that the whole languge to it's core is Object Oriented.

When you get down to the real nitty gritty it don't matter at all to the computer cause eventually it'll get to Assembly language:

Assembly is a human-readable notation for the machine language that a specific computer architecture uses. Machine language, a mere pattern of bits, is made readable by replacing the raw values with symbols called mnemonics.

So, while a computer will recognize what the OpCode 32 machine instruction 10110000 01100001 Assembler for programmers it is easier to remember the equivalent assembly language representation:

mov al, 0x61

...and that my friends AIN'T object programming!


To say that SL is a bad language to learn is completely and utterly baseless and has no meaning at all. ANY PROGRAMMING language that a person learns and learns well will benift that person enormously. First of all programming isn't DOT. PHUCKING NET or PHP, OR C or Pascal, or Ada, or Fortran, or Lisp, or Assembler or RPG, or Algol 60, SnoBall or any of the other 100 or so languages in existence.

The art of programming is being able to disect a problem into the various components creating an ALGORITHM or solution for that task at hand. IT DOES NOT MATTER which language you write your soluton in. A solution is a solution. If a client or situation requires PHP/MySQL then use it. If it needs MS Access then use it, etc. Use whatever tool it takes to get the job done.

Every language in existence has it's strong points and it's weak points. C, like Unix is not for beginners nor people how need to have their hand held.
Hopefully we learn, by experience how to exploit the best out of any given development environment. The more experience you get the easier it becomes.

One of the aspects in programming that is (part of the dark arts) is state programming. Very few people have ever written a true state program like realtime port scanners, realtime telemetry sensing devices LSL is an excellent opportunity to see how that stuff works.

Not everying revolves around Microsoft .NET .NEt has it's place along with other development environments like PHP, MySql, Perl, Python, Flash (.fla), Swish Script among others.

Whatever knowledge gained from writing codes here will always play an important part in any developers skills.

Plus another serious set of errors "you should start w/ an OO language like .NET"
From Microsofts site:

What is the .NET Framework?

The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing investments with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class libraries, and a componentized version of Active Server Pages called ASP.NET.


And when did DHTML become object oriented it's NOT the HTML but the java behind it. HTML is a markup language. DHTML is more of a progammin environment.

I hope that what I have said here helps some people to embrace LSL (which is very new to me) to learn and enjoy it.

I wish the documentation was a little bit better with respect to what legal values are permitted within the llFunctionLibarayCalls.

regards,

PS
I'm just like anyone else that 's new to this language. on other parts of this forum I'm right there with "OK i thougt I understood this, but it's not working kind of stuff" but that's the FUN part of this whole thing anyway.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
07-14-2004 04:56
From: someone
Originally posted by Christopher Omega
Isn't the "final" keyword for this purpose?

Christopher, I dont think you understand the concept of invariant :)
An invariant is something that defines the essence of a class or algorithm. It is a set of abstract logical conditions that must be preserved so that the class or algorithm truly does what is specified. As I told you before, this isnt something that normally needs to be checked, because it would be redundant to check it.
Wikipedia doesnt have much on invariants specifically but remember when I told you about design by contract?
Go read about it:
http://en.wikipedia.org/wiki/Design_by_contract
David Czukor
Prole
Join date: 8 Jun 2004
Posts: 16
07-14-2004 06:33
It looks like I need to apologize for upsetting some people with my criticisms and advice. I did notice that no one has objected to my assertion that LSL is full of holes and looks rushed-to-market! (lol)

First off, thank you to those who pointed out that (string)variable is standard C casting. Having avoided C like the plague whenever possible in my 20-year programming career (everything from 370 Assembler at IBM to enterprise applications with .NET today), I managed to miss that!

Secondly, the post was intended for a NEW PROGRAMMER, not as the be-all, end-all dissertation on what makes a language OO or not, which is the best language, etc. I was aiming only for teachability/learnabilty and suitability to other uses, since the original poster is looking for a generalized skill, not to complete a specific programming task.

I stand by my recommendation that a new programmer start with an OO language and yes, DHTML/Javascript is "OO enough" for that purpose. It is also accessible to the new programmer. C and Javascript syntax, however, can be difficult for new programmers, and there seems to be little benefit in introducing the gymnastics of semicolons and curlybraces on Day 1. The ideal programming language from a teaching perspective might be REXX, whose Hello World program looks like this (and no, the missing quote marks are not a typo)

Say Hello World

Others have pointed out that SL's realtime environment presents a unique learning opportunity. Certainly any programming is good programming experience and all environments and languages are worth investigating with interest. While many languages exist, few are of real value to the programmer today in that environments readily exist where they can be learned and exploited.

-- D
wizzie Baldwin
Registered User
Join date: 23 May 2004
Posts: 52
understood
07-14-2004 20:19
Greetings,

TO: David Czukor

I was never upset, i had, much to my chagrin ... a little bit-o-attitude. I appologize for my abrasive approach. I was tired and i thought at the time that it was a little narrow minded in what you had said.

I'll admit that C is a tough language to learn, but, when you start to live it, and breathe it, ... well, it takes on a life of its own. Of all the languages i have ever programmed it's my favorite.

But I will say this that once you do learn it then PHP, Swish script, Flash .fla script, LSL, and a host of other C look alikes are so much easier to latch on to. It took me all of about 3 hours to get really comforatble with PHP, and about 6 hours to get comfortable with flash scripting. tellTarget ... if( x ==.. for(j = 1; j < ... etc. all I had to do was just get comfortable with the environment , what new functions were available and awaw we go.

Now LSL ... AHemmmm. cough.. cough.. is a little more tricky.
yes there are some holes and very sparse documentation aspects. There are functions that don't work as advertized and some stuff behaves differently (at least in my limited experience) than what the documentation says should happen, but it's one of the few games where u can be as creative as you want to be so i'll put up with a few minor hangups.

I also agree, that Beginning programers should start with a well defined easy mainstream language.

I actually recommend MS ACCESS. It has a very good visual basic development environment, it is oop , u get database, event driven and macro experience in one tidy package.

Good debugging environment, and reasonably solid tools for creating forms and such. Actually the interface blows interface for Visual Basic 6.0 and VB in the .NET right off the map.

Bill G. calls himself a Chief Software Architect yet it's almost as though two distinctly differnt companies wrote the dev interface for VB and ACCESS.

Any even with all of the flaws that LSL has it's still a fun game and I'm having a great :=) time playing..

Have a good one...
wizzie
David Czukor
Prole
Join date: 8 Jun 2004
Posts: 16
07-15-2004 04:56
Thanks, wizzie.

Good suggestion on Access. I think you're right about the "two teams that never met each other" approach to software development at MS. It seems to pervade their product line! :-)

-- D
1 2