Dan Forsberg

1.2K posts

Dan Forsberg banner
Dan Forsberg

Dan Forsberg

@isecurefi

CEO & Founder @BoilingData, @ISECurefi, husband, father for 3 sons, AWS cloud, #serverless enthusiast. Big Data, Security, TS/NodeJS (was: @CujoAI, @DeepCrawl)

Helsinki/Finland Katılım Haziran 2015
622 Takip Edilen318 Takipçiler
Dan Forsberg
Dan Forsberg@isecurefi·
@robertwhurst @jpschroeder So, I’m just really puzzled of the current state of FE and UX. AI is not going to fix it, unless you know what you need to fix.
English
0
0
0
19
Justin Schroeder
Justin Schroeder@jpschroeder·
React is the wrong tool for this era. Ecosystem and libraries are less important than ever. Good performance by *default* means more than ever. Choose Vue.
English
111
32
585
59.7K
Dan Forsberg
Dan Forsberg@isecurefi·
@iavins In other words, you’re using asserts as ”input validation” in the logical design level for achieving modularity. Like with state machine steps you validate some parts of the world within the state (like transaction handling state with locks).
English
0
0
0
218
v
v@iavins·
We use asserts all the time in Turso DB and also in the Turso Server. They're in release builds and shipped to production. And yes, they could crash the server. Asserts are my favorites, and I use them whenever possible. Just yesterday I merged a PR that contained asserts and nothing more. So when do you use them? Use asserts for checking invariants. If that invariant has failed, then something must have gone horribly wrong; I'd prefer to crash the server than continue. Like this made-up example: let a = 5; let b = 7; assert!(a < b, "likely the world has ended"); Asserts help quickly catch logical bugs and prevent something catastrophic. In a database, if some invariant isn't holding up, it could lead to corruption, data loss, or failure of ACID guarantees. Crashing is preferred over proceeding. However, it's incorrect to use them as error handling. 1. You can assert that a write txn has the exclusive write lock before it writes 2. When you read a page from disk, if the read is successful, you can assert that the page exists in the buffer pool 3. Like in MVCC, you can assert that the row's timestamp is less than the txn's (i.e., a txn cannot read rows from some future txn) In practice, we have two macros: `assert` and `debug_assert`. We have a friendly wrapper on top of these. `debug_assert` is fatal in debug builds and logs the condition and message as an error in release builds. `assert` is shipped in both - it's fatal on failure. Rust has a rich type system. Sometimes types help, but most of the time we need asserts. Last year I spent a lot of time writing state machines and used plenty of asserts to check conditions. For example, if the code isn't supposed to be in state X without condition A being true, that's checked with an assert. Asserts also go well with Deterministic Simulation Testing. DST is the one strong reason that we have asserts all over the place. DST is that magical testing philosophy which lets you reproduce the super hard bugs easily. I keep running the simulator, let the asserts fail and then fix the logical bug. We don't use asserts for data from user inputs or S3 (we assume S3 could get corrupted), and for tenant-specific cases we raise errors instead since we're multi-tenant.
v tweet media
v@iavins

Arguably, Go doesn't have asserts because, well, Pike doesn't like them 🥲

English
11
6
143
46.8K
Dan Forsberg
Dan Forsberg@isecurefi·
@robertwhurst @jpschroeder I just want know why and what should I tell my React devs as chief architect or CTO. How can I help them? But if I’m asked, I definitely do not want to see ever worsening UX like in AWS Console. Help me!
English
1
0
0
43
Dan Forsberg
Dan Forsberg@isecurefi·
Also, take major vendor websites today and the UX is unbearable. Menus, components and what not hop on the screen several seconds (eg AWS Console). Like wtf are you FE devs doing there, probably using React ”components” with Router and hoping the best? I’ve seen this shit in many pages (probably outsourced to consulting companies doing React).
English
1
0
0
26
Dan Forsberg
Dan Forsberg@isecurefi·
🎉 BoilStream v0.7.9 released with support for prepared statements with binary parameters. The postgres interface is also now more resilient and does not block with misbehaving/slow clients. Download and run! 🚄 github.com/boilingdata/bo…
English
0
2
2
153