Programming Language Specifics

Programming Language Specifics

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Ruby

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

1

All-time users

1

Favorites

0

Last updated

1 year ago

Date created

Mar 1, 2020

Cards (17)

Section 1

(17 cards)

Ruby

Front

uses static length strings; variables are "typeless" references to objects (so technically the same), but individual array elements can point to any type; associative arrays are supported; records are implemented as hashes which can themselves be elements of an array; all variables are references and implicit

Back

ALGOL 60

Front

grandaddy of all languages; introduced boolean values

Back

COBOL

Front

Lets you specify accuracy of decimals, has structured data type for records; decimal data types essential; MOVE CORRESPONDING moves all fields in source record to corresponding field names in destination record

Back

Ada

Front

character string types are somewhat primitive (packed arrays); all the array elements must be of the same type (bc ptrs are restricted to pointing to one type); array subscripts can be any chars, boolean, or enum types; enforces subscript range checking; some arrays are static; in declare blocks, arrays' stack dynamic-ness can be seen; array init: stuff: array (1..5) of Integer := (1=>17, 3=>34, others=>0); array ops: assignment (RHS can be aggregate constant or array name), concatenation (for all single-dimensioned arrays), and relational ops (= and /= only); if record is constant aggregate, assignment and initialization ops on that record is allowed; record equivalence ops (= and /=) allowed; has discriminated unions; implicitly dereference pointer vars (e.g. pointer.age, as opposed to point->age or (*pointer).age)

Back

C#

Front

includes unsigned integer types; includes decimal data types; uses Unicode; uses static length strings via .NET; enums not coerced to integers, have restricted operations, and are limited to the range of values for that enum type; all the array elements must be of the same type (bc ptrs are restricted to pointing to one type), but also has; enforces subscript range checking; all arrays are objects (and therefore heap-dynamic); array init: int [] list = {1,2,3,4}; no primitive array ops; associative arrays are supported by a class library; records are available as structs; classes are heap dynamic and structs are stack based value types

Back

Java

Front

four signed integer data type sizes (byte, short, int, long); first to use Unicode; uses static length strings; primitive ordinal types - int, char, boolean; enums introduced in 2004 (implicitly subclasses of Enum, can have data members, constructors, and methods, inherit toString, values, and ordinal methods), no expression of any other type can be assigned to enum vars; all the array elements must be of the same type (bc ptrs are restricted to pointing to one type), but also has generic arrays in 5.0 version; enforces subscript range checking; all arrays are objects (and therefore heap-dynamic); array init: int [] list = {1,2,3,4}; string array init: String[] names = {"bob", "bill", "boop"}; associative arrays are supported by a class library; all class instances are referenced by reference variables; this is the only use of reference variables for this language; no dangling references bc class instances are implicitly deallocated

Back

Pascal

Front

all the array elements must be of the same type (bc ptrs are restricted to pointing to one type); array subscripts can be any chars, boolean, or enum types; local arrays are fixed stack dynamic; if record types are identical, assignment is allowed

Back

Smalltalk

Front

all variables are references and implicit

Back

C

Front

used to only have 0 and 1 (or anything other than 0) boolean values, but now include true and false; uses char arrays as opposed to primitive strings; uses limited dynamic length strings; all the array elements must be of the same type (bc ptrs are restricted to pointing to one type); local arrays (that are not static) are fixed stack dynamic; array init: int [] list = {1,2,3,4}; another array init example: char name [] = "freddie"; and another: char names [] = {"bob", "bill", "boop"}; no primitive array ops; records are available as structs; if record types are identical, assignment is allowed; has free unions; allows functions as parameters (via pointers); ptrs used for dynamic storage management and addressing; has explicit dereferencing and address-of operators; ptrs can do restricted address arithmetic; ptr domain type need not be fixed, aka (void ) allowed... can be type checked but cannot be dereferenced

Back

Perl

Front

uses Unicode; uses dynamic lengths strings; arrays grow and shrink as needed; associative arrays are supported; associative arrays are called hashes, they start with % and have two parts - key (string) and value (string, number, or reference); assignment looks like: %thisIsAHash = {"one" => 1, "two"=> 2}; accessing element: $thisIsAHash{"one"} = 10; size is dynamic (grows on insert, shrinks on delete)

Back

BASIC

Front

character string types are somewhat primitive

Back

FORTRAN

Front

Had arrays on non-primitive data types early on; character string types are somewhat primitive; to access array elems, uses ( ) because of the lack of [ ] on old keyboards; 77 version arrays are static; 90 version arrays are head dynamic; 95 version array init: Integer, Dimension (3) :: List = (/0,5,5/); array ops in 95+ versions: elemental ops like adding element-wise (+); assignment, arithmetic, relational, and logical ops all overloaded for arrays of any size/shape; library functions for matrix multiplication, dot product, and matrix transpose; uses column-major mapping of multi-dim matrices onto 1-D space of hardware memory

Back

C++

Front

includes unsigned integer types; true/false and 0/1 (or anything other than 0); uses char arrays as opposed to primitive strings, but also has string class you can use; uses static length strings; C-style strings use limited dynamic lengths; standard library uses dynamic lengths strings; enums are coerced to integers, have restricted operations, and are limited to the range of values for that enum type; all the array elements must be of the same type (bc ptrs are restricted to pointing to one type); array init: int [] list = {1,2,3,4}; another array init example: char name [] = "freddie"; and another: char names [] = {"bob", "bill", "boop"}; no primitive array ops; associative arrays are supported by a class library; records are available as structs; struct and class records are very similar; has free unions; allows functions as parameters (via pointers); ptrs used for dynamic storage management and addressing; has explicit dereferencing and address-of operators; ptrs can do restricted address arithmetic; ptr domain type need not be fixed, aka (void ) allowed... can be type checked but cannot be dereferenced; reference variables are constant pointers that are always implicitly dereferenced; must be initialized, write once; prefaced with an ampersand &

Back

JavaScript

Front

uses Unicode; uses dynamic lengths strings; variables are "typeless" references to objects (so technically the same), but individual array elements can point to any type

Back

F#

Front

includes decimal data types; uses Unicode

Back

APL

Front

arrays grow and shrink as needed

Back

Python

Front

have unlimited length integer type (doesn't reflect hardware); uses Unicode; uses static length strings; variables are "typeless" references to objects (so technically the same), but individual array elements can point to any type; associative arrays are supported; records are implemented as hashes which can themselves be elements of an array; all variables are references and implicit

Back