Quantcast

Jump to content

» «
Photo

JavaScript for a beginner.

9 replies to this topic
TheBoneCountyButcher
  • TheBoneCountyButcher

    Ain't That Some sh*t

  • Members
  • Joined: 17 Feb 2006
  • United-Kingdom

#1

Posted 08 October 2011 - 01:42 PM

I know some of the basics, but the stuff I learnt is stuff like var, if, else and such, then I look at something like this (below) and I can't even begin to understand it.

http://d24w6bsrhbeh9...g.min-v1.7.6.js


Also, could someone answer this. http://www.gtaforums...st&p=1060755348

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 08 October 2011 - 05:37 PM

You need to learn about functions, classes, and objects.

TheBoneCountyButcher
  • TheBoneCountyButcher

    Ain't That Some sh*t

  • Members
  • Joined: 17 Feb 2006
  • United-Kingdom

#3

Posted 08 October 2011 - 07:45 PM

I have learned the basic bits of those, but they never tell you any of the harder or different bits like on the example.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#4

Posted 08 October 2011 - 08:25 PM

That's because you are supposed to write your own code and figure out a lot of these things by trial and error. Programming is not something you can learn by just reading the books. You have to get your hands dirty.

Suction Testicle Man
  • Suction Testicle Man

    Yeah, well, you know, that's just, like, your opinion, man.

  • Moderator
  • Joined: 27 Sep 2002
  • None

#5

Posted 09 October 2011 - 12:14 AM

What K^2 said - writing code yourself is essential to learning anything. Though don't bother studying the code in the link you posted - that 'min' in the filename means it is code that has had all line breaks, indentation and comments removed in order to minimise the filesize (in an attempt to lighten the load on bandwidth and page loading times). Obviously this makes it a lot less readable to a human.

TheBoneCountyButcher
  • TheBoneCountyButcher

    Ain't That Some sh*t

  • Members
  • Joined: 17 Feb 2006
  • United-Kingdom

#6

Posted 09 October 2011 - 08:30 AM

Thanks, guys. Yeah I guess the best way to learn is by getting my hands dirty, that is basically how I learned html and css.

@STM - I viewed it with developer tools, so it was formatted correctly. image

na89340qv0n34b09q340
  • na89340qv0n34b09q340

  • Members
  • Joined: 11 Jun 2010
  • Unknown

#7

Posted 31 October 2011 - 04:34 AM

Hey, if you still don't really get it for whatever reason this tutorial lets you code it while you learn it.

http://www.codecademy.com/#!/exercise/0

Swoorup
  • Swoorup

    innovator

  • Feroci Racing
  • Joined: 28 Oct 2008
  • Nepal

#8

Posted 31 October 2011 - 04:42 AM

It looks like most of the language are derived from C or C++. Their syntax is basically the same. Except for VB

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#9

Posted 31 October 2011 - 07:20 AM

I wouldn't say that. It's just a useful enough syntax that it gets picked up for many scripting languages. JS and PHP, for example. But there are plenty of other languages with different syntax that still find common use. Fortran's syntax is a lot more like BASICs. Delphi is basically Pascal, so it gets syntax from it. Python and Lisp stand on their own. Prolog's syntax will make you go a little insane, and Perl will ruin whatever sanity is left afterwards. Oh, and don't get me started on Brainf*ck.

Swoorup
  • Swoorup

    innovator

  • Feroci Racing
  • Joined: 28 Oct 2008
  • Nepal

#10

Posted 31 October 2011 - 02:17 PM Edited by Swoorup, 31 October 2011 - 02:23 PM.

CODE

+++++ +++++             initialize counter (cell #0) to 10
[                       use loop to set the next four cells to 70/100/30/10
   > +++++ ++              add  7 to cell #1
   > +++++ +++++           add 10 to cell #2
   > +++                   add  3 to cell #3
   > +                     add  1 to cell #4
   <<<< -                  decrement counter (cell #0)
]                  
> ++ .                  print 'H'
> + .                   print 'e'
+++++ ++ .              print 'l'
.                       print 'l'
+++ .                   print 'o'
> ++ .                  print ' '
<< +++++ +++++ +++++ .  print 'W'
> .                     print 'o'
+++ .                   print 'r'
----- - .               print 'l'
----- --- .             print 'd'
> + .                   print '!'
> .                     print '\n'


Its really a brainf*ck. LOL

EDIT: Yeah I learnt prolog was a declarative language




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users