VeggieBoards banner

1 - 11 of 11 Posts

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #1 ·
I'm getting them confused with each other. I am trying to use Javascript object.method.poop in php scripts and putting php stuff in perl scripts. I don't understand how anyone learns more than one computer language.<br><br><br><br>
And I don't get English mixed up with Spanish, so I'm not sure why I'm getting Javascript mixed up with Perl.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #2 ·
For example in php, or is it Perl, variables have a $ in front of them, in JavaScript, they do not. But I keep forgetting this. And in Perl you can get a variable to print by doing print "$variablename is doing something" but if you do that in Javascript you will see exactly that. However I get them mixed up.
 

·
Registered
Joined
·
1,182 Posts
<div class="quote-container"><span>Quote:</span>
<div class="quote-block">Originally Posted by <strong>Jessica Alana</strong> <a href="/forum/post/0"><img alt="View Post" class="inlineimg" src="/img/forum/go_quote.gif" style=""></a><br><br>
Knit one, perl two.</div>
</div>
<br><img alt="" class="inlineimg" src="/images/smilies/laugh.gif" style="border:0px solid;" title=":lol:"><br><br><br><br>
I often mix up . and +<br><br>
But that's usually it apart javascript being a lot more object oriented than PHP.<br><br>
~Wonder <img alt="" class="inlineimg" src="/images/smilies/biker.gif" style="border:0px solid;" title=":ymca:">
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #5 ·
I still haven't figured out what "object-oriented" means.<br><br><br><br>
From Sun's Java tutorial<br><br><br><br>
"What is an Object? An object is a software bundle of related state and behavior. Software objects are often used to model the real-world objects that you find in everyday life. This lesson explains how state and behavior are represented within an object, introduces the concept of data encapsulation, and explains the benefits of designing your software in this manner."<br><br><br><br>
That is utterly meaningless unless "state" and "behavior" are defined first - so that their meanings within this context in which they are being used here, are defined first. They not defined first. This paragraph is the first paragraph on the page. Nor are they defined subsequently, any time soon. So this explanation of "an object" is meaningless, and the writer has wasted my time.
 

·
Registered
Joined
·
1,182 Posts
Objects are easy. Let's say you have a kid name Todd<br><br>
Todd=new Kid;<br><br>
Todd's hair color is red.<br><br>
Todd.hairColor="red";<br><br>
Todd is American, so of course he's obese.<br><br>
Todd.BMI=40;<br><br>
Todd just went to the doctor and found out his cholesterol level.<br><br>
Todd.cholesterol=275;<br><br><br><br>
In this case, Todd is the object. There are many things that define Todd such as hair color, BMI, and cholesterol.<br><br>
HTH,<br><br>
~Wonder <img alt="" class="inlineimg" src="/images/smilies/love.gif" style="border:0px solid;" title=":love:">
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #7 ·
On the NEXT page (many words later) they say
<div class="quote-container"><span>Quote:</span>
<div class="quote-block">Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object-oriented programming.</div>
</div>
<br><br><br>
I have to think they are crazy. For years, I have been thinking of this in terms of subject, consisting of nouns and noun-modifiers, and predicates, consisting of verb and verb-modfiers, and possibly objects. Thinking of things in terms of subject, predicate, and object, is a great way to think about languages, and why they should have to start renaming subjects as being objects, and predicates as being behavior, is beyond me. It confuses the structure of language, rather than elucidates it. They could just as easily have called Java a subject-predicate oriented program -- and I would have understood that as being the same thing -- without any explanation. This stuctural form is used in every single language in existence -- except a few computer languages. It is also used to elucidate mathematical concepts, especially algebra. Why they would ignore the customary terminology, and then go and confuse objects with subjects, is beyond me.<br><br><br><br>
Subjects, predicates, nouns, verbs, adjectives, adverbs, prepositional phrases, and conjuctions. The terms are already in place. No need to mistakenly refer to a subject as an object. Or limit verbs to "behaviors." Computer languages are much simpler than human languages, and need only a subset of the grammatical and syntax terms used to describe human languages.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #8 ·
also, ALL computer languages have subjects and predicates, nouns and verbs. According to what I can figure out, what makes a language "object-oriented" is really the syntax for relating nouns, adjectives, and verbs, not the existence of nouns, adjectives and verbs. Acc to what I can figure out, what makes a program "object-oriented" is that the order of words, their position from left to right, determines which words are subjects, which are adjectives, and which are predicates; the particular word alone is not sufficient to identify it as a noun, verb, or adjective.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #9 ·
OK, to add a comment to a Javascript program I use <-- -->, or is that how I put comments in php. And # is for comments in html? Or is it php? and what about // -- that is how I put a comment in html, right, or is it Javascript?
 

·
Registered
Joined
·
1,182 Posts
Javascript and PHP use // at the start of a line or something like this:<br><br>
/* Multiline<br><br>
comment*/<br><br><br><br>
HTML uses<br><br>
It can be used on multiple lines.<br><br>
HTH,<br><br>
~Wonder <img alt="" class="inlineimg" src="/images/smilies/love.gif" style="border:0px solid;" title=":love:">
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #11 ·
I was sort of kidding about the comment codes, ~Wonder. Yes, I forget which code goes with which program, but when I do, I just go the any js or php tutorial, and look it up. It is usually in one of the earliest lessons, so it is easy to find. I DO find that I can't separate in my mind which things go with which program. If I start doing more php lessons, then try to write a javascript script, I try to put php code in the javascript script, and vice versa. Sorting out the comments IS easier than sorting out the less frequently used and more arcanely referenced, syntax.
 
1 - 11 of 11 Posts
Top