fabic974 random (binary) wanderings in the philament empires…

Programming resources out there

Concepts

Semantic Versioning

  • semver.org
  • node-semver : That which NPM uses for parsing version contraints.
  • 2014: “npm install –save” No Longer Using Tildes | fredkschott.com
    • In the simplest terms, the tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but will miss 1.3.0.
    • The caret, on the other hand, is more relaxed. It will update you to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.
      — fredkschott.com

From semver.org :

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.
    ― semver.org

From https://stackoverflow.com/a/31733623 :

Semantic Versioning Cheatsheet; bytearcher.com Semantic Versioning Cheatsheet; bytearcher.com

Pre-release versioning 0.x.y

Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable. ― semver.org

  • 0.x => Anything can change at anytime => BC breaks are to be expected, however the common practice is to to reserve patches for fixes and internal changes that try to maintain BC; while the minor updates may be anything else.
  • Hence NPM (maybe PHP’s Composer too?) will have the caret ^ behave like tilde ~ for 0.x.y “pre-release” version constraints; where for ex. ~0.1.2 <=> ^0.1.2 => upgrade to the most recent 0.1 minor but restrict to be <0.2.

Examples

~1.2.3 >=1.2.3-0 <1.3.0-0 “Reasonably close to 1.2.3”.
^1.2.3 >=1.2.3-0 <2.0.0-0 “Compatible with 1.2.3”.
~0.1.2
^0.1.2
>=0.1.2 < 0.2.0 pre-release

OOP’s S.O.L.I.D.

https://en.wikipedia.org/wiki/SOLID :

  • SRP: Single Responsibility principle ;
  • Open/Closed principle ;
  • Liskov substitution principle ;
  • Interface Segregation principle ;
  • Dependency Inversion principle.

to/read/?: GRASP

Metrics

Joke found at Why are software development task estimations regularly off by a factor of 2-3?

Typical developer’s day:
– Listen man, you are a developer. Tell me why do you estimate tasks incorrectly so often?
— Imagine that you have to unload a truck. How long does it take?
– A couple of hours.
— It’s a Kamaz.
– 8 hours.
— It’s a Kamaz loaded with sand.
– 12 hours.
— You don’t have any shovel or tools, just your bare hands.
– 2 days.
— It is -40℃ outside.
– 4 days.
— The Kamaz is underwater.
– It doesn’t make any sense, you are changing the conditions! What’s the point? You developers are constantly telling some nonsense instead of simply estimating your work time…

Parsing, parsers, top-down / recursive descent, etc

EOF