EIA2
Programme können schnell sehr komplex werden. Daher ist es wichtig, sich an Stil-Regeln zu halten, um sie möglichst verständlich zu schreiben. In diesem Kurs gelten folgende Stil-Regeln:
Code sollte sich so gut wie möglich selbst erklären. Hierzu sind sprechende Variablen-, Funktions- und Klassennamen etc. erforderlich. Kurze Namen sind nur in kleinen Gültigkeitsbereichen oder bei klarer Bedeutung (z.B. y für vertikale Position) erlaubt.
Variablen erhalten explizite Typ-Notationen und Anweisungen werden mit einem Semikolon beendet (auch wenn TypeScript diese automatisch einfügen bzw. inferieren kann)
Variablen- und Funktionsnamen beginnen mit Kleinbuchstaben und folgen der Kamelnotation (camelCase), d.h. bei zusammengesetzten Namen beginnen die Wortteile im Inneren mit einem Großbuchstaben (z.B. animalLion). Funktionsnamen beschreiben dabei eine Aktivität (z.B. calculateHorizontalPosition(...)) oder Frage (z.B. isHit())
Die Namen von Klassen, Interfaces und Modulen beginnen mit einem Großbuchstaben und folgen ebenfalls der Kamelnotation. (PascalCase)
Die Namen von Enumerations und deren Elemente werden durchgehend mit roßbuchstaben geschrieben. Wortteile werden bei Bedarf mit Unterstrich getrennt.
Kommentare werden eingesetzt, um Programmteile abzugrenzen und die Verständlichkeit zu erhöhen. Programmteile, die von anderen Skripts genutzt werden sollen, werden im JSDoc-Format kommentiert
(/** … */)
the class a subclass is an extension of
an object of the subclass can specifically address its superclass namespace using the keyword "super"
+ - Analogy
a block of code marked with the keyword "try" ...
... will not stop the program when a fatal error occurs ...
... but instead skip execution and continue with the following block marked with the keyword "catch".
if a block marked "finally" is present, it'll be executed before either the try- or the catch-block terminate
the statement "throw" intentionally causes an exception and passes execution to the logically nearest catch
+ -
<p title="testTitle">
This is a sample of some <b>HTML you might<br>
find</b> in your document
</p>
fired when when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown).
a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived).
fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer.
fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
fired when a touch point has been disrupted in an implementation-specific manner (for example, too many touch points are created).
sent when playback of the media starts after having been paused; that is, when playback is resumed after a prior pause event.
sent when the media begins to play (either for the first time, after having been paused, or after ending and then restarting).
sent periodically to inform interested parties of progress downloading the media. Information about the current amount of the media that has been downloaded is available in the media element's buffered attribute.
createServer(requestListener?: ( request: Http.IncomingMessage, response: Http.ServerResponse ) => void ): Http.Server;
creates the server and immediatley installs the listener
Represents a collection of data, handling insertion, lookup, modification and deletion
+ - insertOne ( doc: Object, callback: MongoCallback<InsertOneWriteOpResult>): void
+ - find ( query: Object ) : Cursor
+ - findOne ( query: Object, callback: MongoCallback<Object> ) : void
+ -
updateOne ( query: Object, update: Object, options: ReplaceOneOptions,
callback: MongoCallback<UpdateWriteOpResult>): void;
+ - remove( query: Object, callback: MongoCallback<WriteOpResult>): void;
+ - drop ( callback: MongoCallback<any>): void;
Drop the collection from the database, removing it permanently. New accesses will create a new collection.
beginPath(): void;
closePath(): void;
isPointInPath(x: number, y: number, fillRule?: string): boolean;
clip(fillRule?: string): void;
moveTo(x: number, y: number): void;
lineTo(x: number, y: number): void;
rect(x: number, y: number, w: number, h: number): void;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;