I am always skeptical about making anything useful "free". Because unless there is no cost associated with that, "free" is a fake term, which only means someone else absorbs the cost. There are cases which makes sense, but not sure "civic tech" is one of them.
Another dev who doesn’t show respect to what has been done and expect a particular language will do wonders for him. Also I don’t see this is much better in term of readability.
Where do you see the lack of respect? The author wanted to learn how gzip works and chose to implement it in a language they like to do so. As a learning tool, not because the world needs another gzip decompressor.
#define MAXBITS 15
#define MAXLCODES 286
#define MAXDCODES 30
#define MAXCODES
#define FIXLCODES 288
struct state
local int bits(struct state *s, int need)
local int stored(struct state *s)
struct huffman
local int decode(...)
local int construct(...)
local int codes(...)
local int fixed(...)
local int dynamic(...)
int puff(...)
Yeah, just because you can grab from your refrigerator a piece of raw meat and put it in a cup of milk in 10 secs and it tastes bad doesn’t mean the refrigerator should be blamed because of this.
Yeah, but if the refrigerator is built in a way that makes it very easy to grab some refrigerant when you want to pour yourself a glass of milk (to the point that one has to be careful and skilled to safely drink milk), maybe we should get a new refrigerator.
Why would someone want to learn Unix Programming using OCAML? Not a smart choice. Also this does not look easier to read than a shell script either.
let rec copy_rec source dest =
let infos = lstat source in
match infos.st_kind with
| S_REG ->
file_copy source dest;
set_infos dest infos
| S_LNK ->
let link = readlink source in
symlink link dest
| S_DIR ->
mkdir dest 0o200;
Misc.iter_dir
(fun file ->
if file <> Filename.current_dir_name
&& file <> Filename.parent_dir_name
then
copy_rec
(Filename.concat source file)
(Filename.concat dest file))
source;
set_infos dest infos
| _ ->
prerr_endline ("Can't cope with special file " ^ source)
OCaml is a weird teaching choice for broad Unix programming, but it makes more sense than bash once the code stops being toy-sized and starts touching files, processes, and error paths in more than one place. Shell scripts let typos turn into state changes, and C gives you the usual memory footguns.
That snippet is ugly. Cleaner OCaml is easier to maintain than the average bash blob if you care more about finding mistakes before prod than saving ten minutes on ML syntax.
Even agree with most of the stuff he said, however in real life, you won't be able to win a fight using these arguments. You can only create a environment to execute these strategies first to get a good product and them use them as a propaganda afterwards.
Even GPL never seems to be great idea to me. But at least it considers a core problem of any knowledge sharing seriously. Can you just steal other people’s work? I would rather trust GPL folks than this guy.
reply