Professional Documents
Culture Documents
C Language
C Language
C Language: ............................................................................................................................................. 1
C# Language: ........................................................................................................................................... 2
C++ Language: ......................................................................................................................................... 2
Java Language: ........................................................................................................................................ 3
JavaScript Language: ............................................................................................................................... 4
Python Language: .................................................................................................................................... 4
FORTRAN Language: ................................................................................................................................ 4
Ada Language: ......................................................................................................................................... 5
Perl Language: ......................................................................................................................................... 6
Pascal Language: ..................................................................................................................................... 6
MATLAB Language:.................................................................................................................................. 7
APL Language: ......................................................................................................................................... 7
VB Language:........................................................................................................................................... 7
PHP Language:......................................................................................................................................... 7
COBOL Language: .................................................................................................................................... 8
R Language: ............................................................................................................................................. 8
C Language:
1
- Arrays Without Static are fixed stack-Dynamic subscript Binding
- Provide Fixed Heap-Dynamic
- The Union provided called Free Union
- Turnery Operator, var = ( check )? true_val : false_val
- Boolean expression && , || , !
- Doesn't have a Boolean type, instead uses int
- uses short-circuit evaluation for && , || and provide bitwise Boolean are not short
circuit & , |
- Assign using =
- Char evaluated into Int
- C's switch statement: 1- Can only be Integer or Char( since it's eval into an int )
2- any number of segments can be executed in one ( require Explicit break to stop ) 4-
default for unpresented values
- Iterative statement: for ([expr_1] ; [expr_2] ; [expr_3]){ }
- // old C versions cannot write int i = 1 in expr_1 , u have to define before loop
- // everything can be changed in loop
- // expr_1 evaluated once , other two every iteration
- Iterative statement: while-do ( pre test ) , do-while ( post-test )
C# Language:
C++ Language:
2
- String Length is Limited Dynamic
- Has Enumeration Type
- Doesn't specify range checking for Arrays
- Arrays Without Static are fixed stack-Dynamic subscript Binding
- Provide Fixed Heap-Dynamic
- The Union provided called Free Union
- Turnery Operator, var = ( check )? true_val : false_val
- Allow User-defined overloaded Operators
- Type Casting float(sum) also (float) sum
- uses short-circuit evaluation for && , || and provide bitwise Boolean are not short
circuit & , |
- Assign using =
- Iterative statements differ from C in 1- control expression can be Boolean 2- initial exp
can include var definition
- Iterative statement: while-do ( pre-test ) , do-while ( post-test )
- in Defining a function, default parameters must be last because it's associated with the
position
Java Language:
3
JavaScript Language:
Python Language:
- To Avoid Greedy Matching add ? after the * or + ' +? ' or to get between (.*?)
- Turnary Operator , x = true if condition else fale
- Integer division use // to avoid loss
- Has List Comprehension , S = [ x ** 2 for x in range(10) ] it might have redundant
elements , so we can use { } instead
- Allow calling a function with keyword parameter or positional or key and position //
when u start a key u have to continue by key
FORTRAN Language:
4
- ** is Right Associative
- Fortran 90 Boolean Expression and, or, not
- Fortran 77 Boolean Expression .AND. , .OR. , .NOT.
- Assign using =
- Early Multiple-way selection: IF (arithmetic expression) N1, N2, N3 // which N1 for
Negative, N2 0, N3 Positive // it's similar to MIPS
- Fortran 90 Iterative : DO label var = start, finish [, stepsize]
- Iterative Design choice: 1- loop var must be Int 2- Loop var has the last value 3- loop
var can't be changed in the loop, parameters can 4- parameters evaluated once
- Fortran 95 Iterative: [name:] DO variable = initial, terminal
▪ [,stepsize]
▪ END DO [name]
- Fortran 95 Allow calling a function with keyword parameter or positional or key and
position // when u start a key u have to continue by key
Ada Language:
5
▪ end case
▪ // it has implicit break
- Iterative statement: for var in [reverse] discrete_range loop
▪ end loop
• // discrete_range is sub_range of int or enum
• // loop var undeclared after loop finish
- Iterative statement only pre-test
- Allow calling a function with keyword parameter or positional or key and position //
when u start a key u have to continue by key
- in Defining a function, default parameters must be last because it's associated with the
position
Perl Language:
Pascal Language:
- Pascal is not strong typing because of variant type ( type of value stored in variant
determined at runtime )
- Has nested Functions
6
- Array Index Any Ordinal Type
- Integer division use div to avoid loss
- No coercion
- Assign using :=
- Int can be assigned to Real but not the opposite
- Iterative statement: for var := initial (to|downto) final do
- Iterative design Choices: 1- loop var any ordinal 2- loop var undefined after finishing 3-
loop var can't be changed in a loop, parameters can 4- parameters evaluated once
- Iterative statements has two separate statements: 1- while-do ( pre-test) 2- repeat-until
( post-test )
MATLAB Language:
- ^ is Left Associative
APL Language:
VB Language:
- Variable Implicit Declaration ( Type Binding )
- PostFix - $ String , % integer , ~% unsigned Integer , or don't use any
- Assign using =
- ^ is Left to Right unlike other Languages
PHP Language:
- Variable Dynamic Type Binding
- Has nested Functions
- Has Associative Arrays, starts with $
- has === , !== to prevent coercion
7
COBOL Language:
- Variable Name 30 Max Length
- Offers Decimal Data type
- String Length is Static
- Record Type uses Level Numbers
- to reference a record can be done Elliptical way as long it's unambiguous
R Language:
- has apply() function which used to manipulate slices of matix , array to avoid loops
- X <- c(1,2,3,5,3,5); dim(X) <- c(2,3)
- dim(X)
- # Sum the values of each column with `apply()`
- apply(X, 1, sum) // 1 is by row
- apply(X, 2, sum) // 2 is by col
- apply(X, 1, mean)
- apply(X, 2, sd)
- apply(X, 2, max)
- apply(X, 2, median)
- apply(X , 2, function (x) length(x)-1)
- apply(X , 2, function (x) max(x)+min(x))
- apply(X , 2, function (x) max(x)/2+min(x)*3)