679 karma · joined Mar 3, 2019 (7y ago) · 680 submissions
comment 2y ago · link · parent
Look, you wanna plug your ears then do so, I do so as well, but claiming that the weather wont be that much different is provably false and irrelevant when we're undergoing a massive extinction event that is urgent, just because we have time limits. doesn't diminish from the situation or undermine from its continued urgency.
comment 2y ago · link · parent
We also haven't agreed to punitive actions, tax credits incentivize cleaning, but there is barely any punishment or accounting of it. Else coal which is probably the worst form of energy production would not exist.
comment 2y ago · link · parent
DVCS stands for distributed version control system, it has nothing to do with binary blobs, whether or not it supports it, is an implementation detail.
comment 2y ago · link · parent
What are you talking about here? I'm not talking about eliminating branching, but the fact that merging a branch is usually just a fake single commit that hides away the complexity and decisions of the branch. see [0] into how you can leverage branches and the log for a sane commit history.
> that was a feature of a bunch of source controls and a reason among others why they lost to git.
Given the article, git won because it was foss, torvalds and speed, if you have proof of a good amount of people saying "I hate the division of data and repository!" then its a believable claim, or maybe you're confusing the data/repo division with cvs? git also didn't have to fight much, the only contender was hg
comment 2y ago · link · parent
comment 2y ago · link · parent
FWIW, mercurial seems to have an advantage over git, and that support for BIG repositories which seems to be provided by facebook of all people, so until facebook moves to git, mercurial lives on.
comment 2y ago · link · parent
assert() also exists for this very reason.
PS: there is a performance penalty between doing d["foo"] v d.foo, one expects an expression, the other does not. So it cannot be compiled. lua also errors on use of a nil value, d.foo() will error, d.foo + 3 will also error. So while it does "silently return a marker" it will crash on runtime.
comment 2y ago · link · parent
You can have a hack of sorts using a schema and tables as in
local schema = { a = "number", b="string" } -- key = "type" local data, link = {a=4, b="default value"}, {} -- link -> data, link itself is always empty local tbl = setmetatable(link, { __index = data , __newindex = function (t,k,v) if schema[k] and type(v)==schema[k] then data[k] = v return true end error"type does not match schema" end })
tbl.b = 5 -- this will error because its the wrong type
There are certain solutions you can do with functions, lsp is also really good at telling you when you went wrong.
comment 2y ago · link · parent
x = f() or "default value"
or maybe you want it to error
x = f() or error"F failed"
or maybe x is an object in which case you can just
setmetatable(x,{__index = function () return "" --[[default value here]] end})
or maybe you don't want nils, in which case
debug.setmetatable(nil, {}) -- actually this one is complicated, but yeah, you can use this.
comment 2y ago · link · parent
Software is utilitarian in nature, the goal is the task, but, how do you accomplish a task with an infinite amount of tools? and not only that, but how can you be sure that the tool is secure and stable?