This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Difference between "Syntax" and "Semantics"

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks alot Ernest,
Now the difference is clearer and so is my smile !
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!