• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between "Syntax" and "Semantics"

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
I read in this one web site that Java Programming language is similar to C++ in "syntax" and to smalltalk in "semantics" so what's the difference !!
Totally Confused now.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeffry -
I think of syntax as a "statement-level" definition. If you're familiar with C and C++, a lot of Java source code will look quite familiar. And the way we write many common statements in Java is almost identical to the way we'd write them (or could write them) in C/C++.
In meaning, semantics does overlap with syntax in this regard. But we're referring more to the concepts of expressing ideas in code rather than the nuts and bolts of each expression. The package and class model, and the interaction of those elements in particular, is semantically similar to Smalltalk. I'm getting a little foofy here, but there's a "sense" to writing code as intended by the language designers. It's defined as much by what you can express as what you can't.
One thing about C++ is that it easily degrades to trumped-up C (i.e., "syntax") in the hands of a novice. It's actually pretty easy to ignore the conventions ("semantics") possible in C++ but required in a "true" OOP language. When we're trying to pick a fight, some of us snooty people will call C++ "object-inclined," it makes OOP possible but isn't really serious about it.
Does that help?
-----------------
Michael Ernest, co-author of:The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited January 13, 2001).]
 
Jeffry Cray
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot Ernest,
Now the difference is clearer and so is my smile !
reply
    Bookmark Topic Watch Topic
  • New Topic