I think you're right, and if that's the case, aren't these libraries (Lowtype, Literal) more akin to Design by Contract mechanisms?
1,283 karma · joined July 25, 2013
I think you're right, and if that's the case, aren't these libraries (Lowtype, Literal) more akin to Design by Contract mechanisms?
Why include the letters Std then? This seems like a purposeful typo-squatting effort and definitely makes me suspicious.
I would personally find it really difficult to produce a scream that replicated the sound of abject terror produced by the whistle.
This can be accomplished in statically typed languages too. For example, Java has an ORM called Cayenne that generates models based on database tables. You can get similar functionality and ensure you're not accidentally calling something like `find_by_nam`
def log_then_get(url, context)
puts "Requesting #{url}..."
get(url, context)
end
def get(uri, context)
response = Net::HTTP.get(uri)
puts caller(0).join("\n")
response
end
def get_http_thread(url)
Thread.new do
log_then_get(URI(url), Thread.current)
end
end
Good example of the downsides of dynamic typing:1) get_http_thread takes a url (String) and converts it to a URI object
2) log_then_get defines its parameter as `url`, but really its expecting a URI object
3) get defines its parameter as `uri`, but we're passing it an argument called `url` from within log_then_get.
Lots of traps readily awaiting an unsuspecting programmer or newcomer to a project that contains code like this.
I'm guessing their use of "disintegrated" there is supposed to be taken literally as dis-integrated, but upon first read, I took it for its more colloquial meaning (which to me is closer to pulverized, turn to dust, dissolve etc).
Edit: I have no idea what the actual messaging looks like. It could indeed have a timestamp. I’m just hypothesizing.
https://web.archive.org/web/20230831003431/https://www.portu...
You're spot on. Looking to this very comment section, you have people calling this line out as being enlightening:
>While breadth comes from reading and talking and seeing, depth comes from doing.
I would hope this is self evident to anyone who has ever tried _anything_.
I find this an odd point to be arguing given that in a dynamically typed language you have no idea what _anything_ refers to.
> Would you also deny that a fungus could never fruit the the toenail of a human that spent a lot of time in the Amazon Rainforest?