IT Community - Software Programming, Web Development and Technical Support

How is JavaScript syntax like C / C++?

This is a discussion on How is JavaScript syntax like C / C++? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all....... How is JavaScript syntax like C / C++? Thanks & Regards itbarota....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-13-2007, 03:36 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default How is JavaScript syntax like C / C++?

Hi all.......

How is JavaScript syntax like C / C++?

Thanks & Regards
itbarota.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-13-2007, 04:09 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default Re: How is JavaScript syntax like C / C++?

Hi all.....

The languages have enough in common to make learning one easy if you know the other. By the same token, the differences are subtle enough to trip up those proficient in both. Here's a short list comparing C and javascript:

* Terminating JavaScript command lines in semicolons is optional; in C it's mandatory. Recommended practice is to use them religiously in both languages (and Java as well).
* Both JavaScript and C are case-sensitive; 'doThis' is different from 'DOTHIS'. Experienced programmers learn to love this feature, which drives beginners nuts.
* Both JavaScript and C are block-structured computer languages and employ curly brackets -- '{' and '}' -- to delimit blocks.
* Both JavaScript and C employ quotation -- enclosure in single or double quote marks -- to designate text strings.
* Arrays in both JavaScript and C are zero-based; the first element is myArray[0], not myArray[1].
* Both JavaScript and C employ '==' for comparison, '=' for equality, and '!' for negation. In fact the set of JavaScript operators is essentially borrowed from C (right down to the deprecated ternary construct a ? b : c).
* Both JavaScript and C employ the symbols /* to designate a comment */. JavaScript also permits the use of '//' for short comments, as in C++.

Finally, JavaScript's statements are a strict subset of C++'s, offering a smaller selection of identical looping and conditional constructs.

Thanks.......
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Php Basic Syntax of Regular Expressions senraj PHP Programming 12 02-08-2008 08:29 PM
How does JavaScript Reporter differ from JavaScript editors? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-13-2007 05:59 AM
What is the syntax for TextOut function in VC++ Win32 application? mobilegeek C and C++ Programming 3 08-09-2007 03:23 AM
Oracle Cluster - Create and Alter Basic Syntax Murali Database Support 2 07-11-2007 06:40 AM
Python resemble in its class syntax with other languages vigneshgets Python 1 05-27-2007 11:01 PM


All times are GMT -7. The time now is 12:10 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0