5 ms·
Exception Patterns (2013)
- gwbas1c 4y agoI don't get the navigation pattern on the page. When I click on a link it opens a panel that I can't close, but then if I push refresh I'm taken to a page with a broken back button. IMO: Just do a normal site where links take you to pages. Don't be creative with the UI. Maybe you could use some bog-standard wiki software? The content itself looks very valuable, but because the UI is so bonkers, it's just too hard to use or link to.
- marginalia_nu 4y agoSeems to work if you right click and open in a new tab. Although I do agree it's a bit of an accomplishment to break an otherwise already working browser feature. Sadly not an uncommon one.
- jiyuhtrfdrct 4y ago> Just do a normal site It actually used to be normal HTML... the site is the first wiki. For some reason it was reimplemented as a broken JS app.
- twic 4y agoA while ago, Ward had some sort of idea about next-level hypertext: https://www.wired.com/2012/07/wiki-inventor/ https://www.wired.com/2012/07/wiki-inventor/ But his implementation of it for some reason involved rewriting it as an SPA, which he entirely botched.
- marcosdumay 4y agoWhoever designed this site spent a great deal of effort to make it behave like this. Adding my opinion, also let the text use the page width. Limiting it to 120 characters or whatever is fine, but what this site does is really not.
- codetrotter 4y ago> When I click on a link it opens a panel that I can't close, but then if I push refresh I'm taken to a page with a broken back button. On mobile I just tap outside of the panel to close it. Probably on desktop it will close as well if you click outside of it?
- enobrev 4y agoUnfortunately not. I thought this thread was being overly-picky until I opened the link. This is awful.
- yosef123 4y agoI agree, this also breaks the reader feature on iOS
- donatj 4y agoIt really is a shame all this interesting information is stuck in this bizarre unusable site. Update - took me a solid 3 minutes of futzing with it to figure out you can close something by clicking on it's parent. Clicking on the grey area does not work.
- marginalia_nu 4y agoAs a random tangent, this is an "exception pattern" (Java). int foo() { int i; for (i = 0; i < 10; i++) { try { throw new RuntimeException(); } finally { if (i < 5) { continue; } else { break; } } } return i; } Compiles. Runs. Returns 5.
- layer8 4y agoThis is not an “exception pattern”. It’s just how the language works, and is a consequence of the concept of “abrupt completion”. It means that you can unconditionally (i.e. independent from whether there is an exception or not) divert the control flow using finally. It’s not much different from how when an exception is thrown from the finally block, the prior exception gets lost. From the language spec [0]: If the finally block completes abruptly for reason S, then the try statement completes abruptly for reason S (and the throw of value V is discarded and forgotten). [0] https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.2 https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.htm...
- marginalia_nu 4y agoIt is a pattern with an exception.
- layer8 4y agoPatterns are solutions or practices applicable to a certain problem. The code you presented isn't that.
- marginalia_nu 4y agoThat is one definition of the term.
- civopsec 4y agoThe cool thing with all these links is that I can pick whichever one I want to talk about! > Don't use assertions. BairsLaw applies - what will you do if the assertion fails? (Fix the bug, perhaps?) If you don't like the parameters you're given, throw an IllegalArgumentException. If you don't get a correct result, your UnitTest will tell you. There is no room left for assertions. Disagree. How does the “law” apply? Yes, I would like to fix the bug if the assertion uncovers it… not unlike a validation error. Assertions are only turned on in Java if `-ea`. Which means that you can fail fast for local development and maybe just log things in production.
- epolanski 4y agoThe biggest "issue" with exceptions is that they are not exceptions at all. One of the authors of Stoplight [1] once said during a talk that actually in an http transaction so many things can be wrong (30 major causes in a simple GET http request alone can derive from parsing) that writing http clients or mock servers is actually about handling errors and exceptions and stopping to think about those as unhappy cases, happy cases are, if anything, exceptions. He then pushed for a complete rewrite of their tools using fp-ts and treating exceptions and errors as normal (algebraic) data types which brought critical failures and bugs to basically 0. https://github.com/stoplightio https://github.com/stoplightio
- monkpit 4y agoIs there any post you know of documenting this in more detail? I’d be interested to read more.
- valenterry 4y agoUnfortunately, even with fp-ts, typescript does not yet have the means to enable ergonomic handling of errors without exceptions. I hope they improve this in the future though.
- epolanski 4y agoAs a daily fp-ts user I'm not sure I agree, you handle them with the appropriate data type: Either. Exceptions are a path like any other, there's nothing really magical about those, you catch the functions that could throw and handle the fact they have thrown the error, which error, why? There's two helpers for that in fp-ts [1][2] plus the obvious lazy and asynchronous counter parts in the TaskEither and ReaderTaskEither modules. [1]https://gcanti.github.io/fp-ts/modules/Either.ts.html#trycatch https://gcanti.github.io/fp-ts/modules/Either.ts.html#trycat... [2]https://gcanti.github.io/fp-ts/modules/Either.ts.html#trycatchk https://gcanti.github.io/fp-ts/modules/Either.ts.html#trycat...
- valenterry 4y agoI think it's a matter of perspective. I tried to user Either, but without proper pattern matching and syntactic sugar for monadic operations, I didn't quite like it. That being said, I think the authors did a great job to make it as good as possible given the limitations.
- monkpit 4y agoc2 is such a dumpster fire
- Izkata 4y agoI'm on Firefox on Android and all I get is a neverending loading spinner and > This site uses features not available in older browsers. This site used to be good, just plain html, no javascript, little styling to get in the way... What happened to it?