fabic974 random (binary) wanderings in the philament empires…

Programming resources out there

Concepts

Design patterns

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

  • SLOCs : Source Lines Of Code
    • See also cost estimation in software engineering
    • 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…

  • tool: AlDanial´s cloc – “Count lines of code” – written in Perl; does a good job – ability to give it a commit hash, or HEAD and it will consider just those files that are under Git control, ex.:

      $ cloc HEAD
          1821 text files.
          1785 unique files.
           598 files ignored.
    
      github.com/AlDanial/cloc v 1.76  T=3.02 s (410.4 files/s, 106625.6 lines/s)
      -------------------------------------------------------------------------------
      Language                     files          blank        comment           code
      -------------------------------------------------------------------------------
      CSS                            166          13764           4230         122450
      JavaScript                     323          13314          18795          75322
      PHP                            487           6480           9048          25284
      Blade                          211           1854            882          11649
      JSON                             8              3              0          10534
      Sass                             9            795            101           4699
      Markdown                         8            309              0            764
      HTML                            15            163              3            662
      Vuejs Component                  7             29              2            390
      Bourne Shell                     1             16              9             38
      XML                              1              1              0             30
      Cucumber                         1              1              0              8
      YAML                             1              1              1              6
      -------------------------------------------------------------------------------
      SUM:                          1238          36730          33071         251836
      -------------------------------------------------------------------------------
    

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

CORS

Other

EOF