Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
goto11
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
75 ms
·
871.
▲
by
goto11
5y ago
You can easily write a parser for this in Python. As long as you only support expressions it should be pretty straightforward.
872.
▲
by
goto11
5y ago
How about representing the logic as a JavaScript expression: (credentialData.rapidSarsCov2PCRTest.testResult==='negative') || credentialData.covid19Vaccination.hasVaccination) ? 'valid' : 'inv
873.
▲
by
goto11
5y ago
URLs are not supposed to change since a URL identifies a resource. It is weird arguing for HATEOS as a mitigation for breaking a more fundamental constraint of REST.
874.
▲
by
goto11
5y ago
I see this so often with fake news. People spread it because they want to believe it because it confirms their worldview. So when you point out the story is fake, they insist that it might as well be true.
875.
▲
by
goto11
5y ago
But what is the point? Why introduce an extra layer of complexity to mitigate changing URL's, something which has no purpose in the first place?
876.
▲
by
goto11
5y ago
> Well the problem is exactly that they do change sometimes. Well they shouldn't! And if the API arbitrarily changes URLs around without reason, then surely they might also change the URL for the initial request.
877.
▲
by
goto11
5y ago
What is the problem with hard-coded URLs? It is certainly simpler than having to extract the URLs from some other request. If they don't change (and they shouldn't!) I don't see the problem.
878.
▲
by
goto11
5y ago
It is the style of API's people commonly call REST API's which he suggest should be rebranded to HTTP API's. Because they are not really REST and don't need to be. He is not suggesting rebranding the architectural style
879.
▲
by
goto11
5y ago
The problem is not REST per se, the problem is people thinking a machine-to-machine API "should" conform to REST. I have not seen a coherent argument for why HATEOAS should be a useful property for API's beside "REST say
880.
▲
by
goto11
5y ago
I think HTTP API is fine. "Web" implies some form of hypertext or hypermedia, but this is not required in a API.
881.
▲
by
goto11
5y ago
> I've had developers use the 'partial' feature in C# to meet Martin's length restrictions That is not the fault of this book or any book. The problem is people treating the guidelines as rituals instead of understand
882.
▲
by
goto11
5y ago
Then so is this code: function main() { let name = prompt('Hello, what is your name?'); alert('Hello, ' + name); } This function can also be passed around, kept in lists etc. without executin
883.
▲
by
goto11
5y ago
The problem is not really with this book IMHO. Most of its advice and guidelines are perfectly sensible, at least for its intended domain. The problem is people applying principles dogmatically without seeing the larger picture or consideri
884.
▲
by
goto11
5y ago
It basically means "append only". You can add new data to the database, but you can't change or delete existing data.
885.
▲
by
goto11
5y ago
Yes but it was already relevant, since it was the lingua franca of higher education. It wansn't like Latin only became relevant later. I'm just confused about who would even suggest Latin was "useless" in the first pla
886.
▲
by
goto11
5y ago
> When Shakespeare was born there wasn’t yet a professional theater in London. His ‘useless’ Latin drills prepared him for a job that didn’t yet exist.…Why are we wasting precious classroom hours on fleeting technical skills—skills that
887.
▲
by
goto11
5y ago
My point is just that input/output is not pure in Haskell. I believe it is an unfortunate misconception that obscures what the actual cool properties of Haskell is. IO functions like putStrLn is curried by default, so you can pass them
888.
▲
by
goto11
5y ago
Probably, since the local name part can be basically anything. But the way to prevent injection attacks is not to disallow or sanitize input, it is to escape correctly when interpolating strings in other languages.
889.
▲
by
goto11
5y ago
But why restrict the syntax arbitrarily in the first place? It is not going to catch the common typos anyway. Most typos will just result in a wrong but still syntactically valid email address.
890.
▲
by
goto11
5y ago
I disagree. This code: main = do putStrLn "Hello, what's your name?" name <- getLine putStrLn $ "Hello " ++ name is not pure in any meaningful sense. At least not any more
891.
▲
by
goto11
5y ago
The JavaScript equivalent would be: const io_actions = ["hello", "world"].map(s => () => console.log(s)); io_actions[1](); which also prints "world" when the JavaScript runtime evaluates the
892.
▲
by
goto11
5y ago
But isn't it the case in any programming language that impure operations only have side effects when they are executed? You might as well argue that a JavaScript program on its own is pure - it is only when it is executed by the runt
893.
▲
by
goto11
5y ago
This is beside the point. Haskell have a number of built-in unpure operations like putStrLn. You can use the built-in IO type to execute these unpure operations. If you define your own type called IO you can't use it to execute unpure
894.
▲
by
goto11
5y ago
> monads allow you to maintain a pure language while performing IO I/O is by definition not pure, but the use of monads allow a strict separation between the pure and impure parts of the code. I guess you can say that monads allow y
895.
▲
by
goto11
5y ago
But there are many generations of cruft. Table-based layouts is just one thing, how about font-tags, quirks-mode-triggering doctypes, frames, float-based layouts, <!--[if IE]> and so on. Each of these might by necessary to understand
896.
▲
by
goto11
5y ago
My peeve is really about how to structure teaching. Teachers often seem to forget how they learned things themselves. You learn a programming language by diving into it it and making things work - not by first studying its historical roots
897.
▲
by
goto11
5y ago
Email is a different can of worms, but it does not just correspond to web design 20 years ago. You can use a lot of CSS in email, but in a different way and under weird constraints with never exited on the web.
898.
▲
by
goto11
5y ago
How would that eliminate cruft? Browsers would still have to support old version for backwards compatibility. Much better IMHO to extends the languages in a backwards-compatible manner.
899.
▲
by
goto11
5y ago
Abuse only in the sense they were not designed for this purpose. Like people using <blockquote> to create margins. It is like using a screwdriver to knock in a nail because you don't have a hammer - better than nothing, but not w
900.
▲
by
goto11
5y ago
Sure, but that is an advanced subject. Don't put it before explaining what the technology actually does!
More ›