diff --git a/src/drafts/professional-lessons-and-opinions.draft.org b/src/drafts/professional-lessons-and-opinions.draft.org index db2976a..e167b18 100644 --- a/src/drafts/professional-lessons-and-opinions.draft.org +++ b/src/drafts/professional-lessons-and-opinions.draft.org @@ -58,3 +58,36 @@ No magic, just taking care of the state and not writting spaggethi code. * How I choose - Functional programming is superior to imperative and object oriented languages + +* Programming Languages Quality/Fun + +- C, too low level, no higher level function, pb with portability +- Ruby, slow, concets not clean enough +- Python, C-like script, pretty efficient, but quite easy to write bad code, often slow +- Java, cumbersome, lot of boilerplate, not that bad, but bad underneath + philosophy (try to make programming scalable by multiple user, replace coder by gears, + in practice it is often wrong) + +** Not suitable for production/ toy language + +- logo +- basic + +** Inferior languages + +Supersede by Rust: + +- C, go, pascal + +Supersed by Clojure/Haskell: + +- Ada, C++, Eiffel, Ruby, Python + + + +** Best choice of language depending of usage + +- do something fast and dirty: zsh, perl for program shorter than 200 lines. +- very complex big software: Haskell, Clojure, Purescript, Clojurescript +- low level fast, fine grained memory control: Rust + diff --git a/src/index.org b/src/index.org index e45b1ac..882b9d4 100644 --- a/src/index.org +++ b/src/index.org @@ -27,7 +27,7 @@ With [[http://orgmode.org][org-mode]] You can have a basic demo about most supported content styles/type (paragraphs, lists, tables, etc...) [[file:./demo.org][here]]. -* Code magic :noexport: +* Code magic :noexport: #+begin_src elisp :results none (require 'org) (require 'ox-publish) @@ -63,6 +63,22 @@ lists, tables, etc...) [[file:./demo.org][here]]. " | ") "")) + + (defun str-time-to-year-float (date-str) + (/ (float-time + (apply 'encode-time + (mapcar (lambda (x) (if (null x) 0 x)) + (parse-time-string date-str)))) + (* 365.25 24 60 60))) + + (defvar blog-creation-date "2019-07-01") + + (defun y-date (date-str) + "Number of year since the begining of this blog" + (let ((y (- (str-time-to-year-float date-str) + (str-time-to-year-float blog-creation-date)))) + (format "∆t=%.2f" y))) + (defun org-blog-preamble (info) "Pre-amble for whole blog." (concat @@ -89,7 +105,7 @@ lists, tables, etc...) [[file:./demo.org][here]]. (format "
Author: %s
" email author) (format "
Author: %s
" author))) (when-let ((date (get-from-info info :date))) - (format "
Created: %s
" date)) + (format "
Created: %s (%s)
" date (y-date date))) (when-let ((keywords (plist-get info :keywords))) (format "
Keywords: %s
" keywords)) (format "
Generated: %s
" @@ -201,5 +217,10 @@ lists, tables, etc...) [[file:./demo.org][here]]. (add-to-list 'org-export-filter-link-functions 'my-org-export-add-target-blank-to-http-links) - #+end_src + +#+begin_src elisp :results value verbatim +#+end_src + +#+RESULTS: +: 42.362765229295