views:

217

answers:

11

In the course of my job I am maintaining code in a number of programming languages (listed below). As I haven't mastered most of them I keep forgetting the differences in syntax between them. Is there a good reference which covers (preferably for all of them on a side of A4, in a table) the basic features of the language e.g.

  • conditional statements (if (something) {} or not?)
  • comparison operators (is it =, ==, or sometimes ===? Is it <> or !=)
  • Are variables case sensitive?
  • How do you concatenate strings? ( . & or + ?)

I would like this for:

  • Python
  • PHP
  • Perl
  • Javscript
  • ASP
+5  A: 

DZone has quite a few.

cletus
+1 From me. It is very complete.
Timotei Dolean
+2  A: 

gotapi is a nice place

http://www.gotapi.com/html

I would definetely have a look at it

you should also visit dzone's refcardz

http://refcardz.dzone.com/

they have a lot of useful reference cards...

like this one

http://refcardz.dzone.com/announcements/php

opensas
+3  A: 

http://rosettacode.org/wiki/Main_Page is your friend :)

Pete Duncanson
+3  A: 

I would start by looking for programming cheat sheets. Here's one pretty good selection.

Galwegian
+2  A: 

http://pleac.sourceforge.net/ this one is good to :)

vaske
it's my favourite.
Geo
+4  A: 
schnaader
When I said ASP, I meant VBScript, so if someone could amend the table when they next go in that would be great. Thanks.
paulmorriss
+1  A: 

PHP:

Conditional statements

  • if ($cond)
  • $cond ? $value_if_true : $value_if_false;

Comparison operators

PHP supports the following basic comparison operators:

  • ==
  • !=

It also contains type-safe operators:

  • ===
  • !==

Expressions can be negated using the unary ! operator.

Boolean operators

The basic boolean operators are:

  • && / and
  • || / or

Case sensitivity

PHP variables are case sensitive. So are associative array keys.

String concatenation

. (dot) is used for string concatenation in PHP.

Emil H
I added some additional info. Anyone that wants to add another language can feel free to use this as a template. Also, feel free to add additional reference info.
Emil H
A: 

http://www.cheat-sheets.org/

Nick D
A: 

http://merd.sourceforge.net/pixel/language-study/syntax-across-languages/ has more languages than you want, but at least it is focused on syntax. No single page, either.

js
I'm choosing this one because it's nearest to what I want. It does have a single page toohttp://merd.sourceforge.net/pixel/language-study/syntax-across-languages.htmlI'm going to cut it down to just the languages I want, and for functions, add arguments as they are missing.http://rosettacode.org/blog/2009/06/a-mashup-challenge.html looked hopeful - I could take the XML output and with an XSL stylesheet extract just the languages I wanted. However that output isn't working, and even if it was it wouldn't be up to date.
paulmorriss
A: 

Smashing mag has always good links for that ;)

http://www.smashingmagazine.com/2006/10/30/cheat-sheet-round-up-ajax-css-latex-ruby/

SleepyCod
+1  A: 

asp classic:

Conditional statements

if (cond) then

else

end if

Comparison operators

ASP classic supports the following basic comparison operators:

=

!=

Expressions can be negated using the unary ! operator.

Boolean operators

The basic boolean operators are:

and

or

not

Case sensitivity

ASP classic variables are NOT case sensitive.

String concatenation

& (ampersand) is used for string concatenation, you can also use "+".

opensas