Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

var BlackBox = function() {
var self = this;
self._events = [];
self.Record = function(event) {
self._events.push(event);
self.Recorded(event);
};
@SMoni
SMoni / Indirection Is Not Abstraction.md
Last active February 6, 2020 07:38
List from Zed Shaw (http://zedshaw.com/essays/indirection_is_not_abstraction.html) what an interface should/shouldn't do. Mind his definition of an interface from the original post.

An abstract interface should not require any configuration to use

Configuration should be done behind the scenes using an external resource like a property file, and should be done internally before anyone uses the interface.


An user of an abstract interface should not have to go through more than one function call in a chain to “find” any component they need

Remember that indirection is evil and only ends up adding to the cognitive complexity necessary to use something. You can find examples of this in normal GUIs when you are forced to go through a huge list of complicated steps across multiple interface to complete one task. A wizard is an example of an abstraction over these complicated steps, and it basically provides one access point to your task. The same idea applies to abstract interfaces: If the user has to call more than one function just to access a component or complete a task then you haven’t helped them at all.

@SMoni
SMoni / Quips
Last active September 19, 2022 17:59
Ganz schlaues...
Jedes Problem wird solange mit MSExcel bearbeitet, bis bemerkt wird, dass es nicht verstanden wurde.
When there’s no more room in your Repo. Then dead code will be in the deployment
and coders won’t have a commit. Cause it’s the dawn of the dead code
Wenn die Schnittstelle schwer zu verstehen ist und eine Dokumentation braucht,
dann ist die Schnittstelle unter Umständen nicht wirklich gut.
Eine schlechte Schnittstelle wird durch eine Dokumentation nicht besser.
Es geht nicht darum, es richtig zu machen, sondern nicht falsch!
@SMoni
SMoni / Deutsche Kalenderwoche berechnen.js
Last active December 23, 2015 09:29
... mit JavaScript."Die Berechnung erfolgt nach dem C++-Algorithmus von Ekkehard Hess aus einem Beitrag vom 29.7.1999 in der Newsgroup borland.public.cppbuilder.language (freigegeben zur allgemeinen Verwendung)"
var getWeek = function() {
var a = Math.floor((14 - (this.getMonth())) / 12);
var y = this.getYear() + 4800 - a;
var m = (this.getMonth()) + (12 * a) - 3;
var jd = this.getDate() - 2 + Math.floor(((153 * m) + 2) / 5) + (365 * y) + Math.floor(y / 4) - Math.floor(y / 100) + Math.floor(y / 400) - 32045;
^ Offset auf Montag
var d4 = (jd + 31741 - (jd % 7)) % 146097 % 36524 % 1461;
@SMoni
SMoni / Prinzipien von Lean.md
Last active December 23, 2015 23:49
... nach Mary Poppendieck, Tom Poppendieck (2003), “Lean Software Development: An Agile Toolkit”
  • Qualität von Anfang an (Build Quality In)
  • Verschwendung vermeiden (Eliminate Waste)
  • Wissen erzeugen (Create Knowledge)
  • Entscheidungen so spät wie möglich (Defer Commitment)
  • Schnelles Liefern (Deliver Fast)
  • Respekt (Respect People)
  • Das Ganze optimieren (Optimize The Whole)
@SMoni
SMoni / Was ist 5S.md
Last active December 23, 2015 23:49
Für’s Software-Engineering lassen sich die Methoden folgendermassen „übersetzen“ (nach Poppendieck, Mary; Poppendieck, Tom: Implementing Lean Software Developement.)
  • Sortiere aus Obsolete Dateien, Software usw. auf Arbeitsplatzrechnern und Server finden und entfernen oder archivieren.
  • Sauberkeit Den virtuellen und realen Arbeitsplatz säubern.
  • Systematisierung Ordner-Strukturen auf Arbeitsplatzrechnern und Servern vereinheitlichen.
  • Standardisierung Strukturen automatisiert anlegen, Coding-Richtlinien festlegen.
  • Selbstdisziplin Die Vorgehensweise leben.
@SMoni
SMoni / LeanArchitecture.md
Last active August 29, 2015 14:00
Lean Architecture: for Agile Software Development (Jim Coplien, Gertrud Bjørnvig)

Unterteilung

What the system is (User thinking)

  • Classes & Objects
  • Domain Experts
  • Architects
  • Database Schemata
  • Long-term stable structure
  • Form

Software architecture encompasses the set of significant decisions about the organization of a software system including the selection of the structural elements and their interfaces by which the system is composed; behavior as specified in collaboration among those elements; composition of these structural and behavioral elements into larger subsystems; and an architectural style that guides this organization. Software architecture also involves functionality, usability, resilience, performance, reuse, comprehensibility, economic and technology constraints, tradeoffs and aesthetic concerns.

Philippe Kruchten, Grady Booch, Kurt Bittner, and Rich Reitman

The highest-level breakdown of a system into its parts; the decisions that are hard to change; there are multiple architectures in a system; what is architecturally significant can change over a system's lifetime; and, in the end, architecture boils down to whatever the important stuff is.

Patterns of Enterprise Application Architecture, Martin Fowler

require "test/unit"
require "./IntegerArrayToString.rb"
class Suite < Test::Unit::TestCase
Array.include IntegerArrayToString
def test_GetArrayAsString
randomNumber = Random.new.rand(1..100)