Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 05, 2015, 07:22:55 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Syntax in Different Programming Languages  (Read 1948 times)

anandcoral

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 313
    • View Profile
    • Apps, to help you
    • Donate to Member
Syntax in Different Programming Languages
« on: March 02, 2015, 11:04:50 AM »
Hi DC Members,

With ref. to
1. Experimenting with Other Programming Languages http://www.donationc...;topicseen#msg370531
2. http://en.wikipedia....nguages_%28syntax%29
3. http://rigaux.org/la...cross-languages.html

I was planning to make a google sheet with rows having the most common code syntax names and columns with different programming languages and column cells filled with the code syntax of that programming language.

Something like Syntax in Different Programming Languages https://docs.google....O8M/edit?usp=sharing

Well the above is just for the starting idea.

Now comes the major point :
To have something like this needs programmers with the knowledge of the given language. I can only see DC members has the knowledge and can fulfill it.

How it is going to help :
Programmers trying to learn a new language can have the two languages columns visible (one being the language he/she know) and learn.

I think this will boost learning. It had helped me very much in my earlier days, like C++ for Basic Programmers.

Now it may be that a similar sheet, website with more features, already exist. Or some DC member already has something like it.

It would be better if we could make a website which asks for the two languages and shows the html pages for them only, no filtering / hiding in a sheet. I do not have expertise on it. In fact I will like the sheet to be maintained by our DC website for all programmers of the world.

I need guide and direction on this. Please help.

Regards,

Anand

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 2,718
    • View Profile
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #1 on: March 03, 2015, 07:02:04 PM »
On a possibly related note, are you familiar with Rosetta Code?

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,332
  • "In my dreams, I always do it right."
    • View Profile
    • wraith808
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #2 on: March 03, 2015, 07:19:26 PM »
One of my best classes in college was a class called The Organization of Programming Languages.  It was taught by someone who was giving back time as a professional in the industry, rather than a professor.  Many years later, it is one of the only ones that sticks in my mind and that I use.  I've gone from and to many different languages - Pascal to VB to C to C++ to Delphi to C# (and I currently dabble in a few others).  The syntax has never been the problem.  You can always find syntax.  It's the data structures and memory management and such that are always the sticking point.  If you can get those, you can rapidly move from one language to another with a minimum of difficulty.

Rosetta Code seems to handle the approach to moving between languages in that way at a more granular level.  Not to dissuade you, but I'm just not sure how much a syntax mapper will actually be used.

Of course, it could be based on how you learn, so perhaps it's just me.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 2,718
    • View Profile
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #3 on: March 24, 2015, 07:19:02 AM »
On a related note, came across the following recently:

  http://learnxinyminutes.com/

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #4 on: March 26, 2015, 03:00:17 PM »
Very related: http://hyperpolyglot.org/
Programming Languages - commonly used features in a side-by-side format

I like this one -- no filler just tables showing how small snippets of code would look in different languages.

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 591
  • what am I doing in this handbasket?
    • View Profile
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #5 on: March 26, 2015, 09:34:24 PM »
I like this one -- no filler just tables showing how small snippets of code would look in different languages.
But no Rexx.  :(
vi vi vi - editor of the beast

anandcoral

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 313
    • View Profile
    • Apps, to help you
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #6 on: March 27, 2015, 03:28:50 AM »
mouser you are near what I want. http://hyperpolyglot.org/ has the comparison side-by-side.

But it is grouped in similar type of languages but I want any languages side-by-side. Say I know VB and want to convert an VB app in C#. Logic does not depend on any language, just the syntax I need to know when I am stuck. hyperpolyglot is not allowing for VB and C# comparison. That's why I was thinking of making the sheet and having option to hide columns to get two languages side-by-side comparison.

Or may be there is a website as I want in the wilderness.

Regards,

Anand

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 2,718
    • View Profile
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #7 on: July 27, 2015, 06:33:17 AM »
Just wanted to mention that I came across the Hyperployglot site again today -- the side-by-side comparison was handy for a particular situation I was investigating :)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 8,858
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #8 on: July 27, 2015, 01:26:58 PM »
How useful is a site like HyperPolyglot, though?

If you're at a proficiency level with the target language that you need to site, will you be able come up with something useful by looking at a cheat sheet? I don't think a"mechanical translation" like that wouldn't end up would result in good code, unless that languages are extremely similar (Java <> C#, for instance).

I think something that would be valuable would be samples of how to write ideomatic code in the target languages (requiring the user to be familiar with basic syntax) - but it's hard to do that with side-by-side comparisons, since different languages tend to solve different problems.
- carpe noctem

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,332
  • "In my dreams, I always do it right."
    • View Profile
    • wraith808
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #9 on: July 27, 2015, 02:02:06 PM »
How useful is a site like HyperPolyglot, though?

If you're at a proficiency level with the target language that you need to site, will you be able come up with something useful by looking at a cheat sheet? I don't think a"mechanical translation" like that wouldn't end up would result in good code, unless that languages are extremely similar (Java <> C#, for instance).

I think something that would be valuable would be samples of how to write ideomatic code in the target languages (requiring the user to be familiar with basic syntax) - but it's hard to do that with side-by-side comparisons, since different languages tend to solve different problems.


Very well stated, and this is exactly what I was trying to say earlier.  :Thmbsup:

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 2,718
    • View Profile
    • Donate to Member
Re: Syntax in Different Programming Languages
« Reply #10 on: July 27, 2015, 06:04:29 PM »
FWIW, the situation in question was indeed for multiple similar languages (trying to express something in Clojure, but much more familiar with Emacs Lisp and Scheme).  The page being examined was:

  http://hyperpolyglot.org/lisp

For idiomatic usage, I tend to look for "Cookbook" types of documents (e.g. https://github.com/c...ook/clojure-cookbook), but perhaps the Rosetta Code site mentioned earlier can also help.