What is ValidatedData? A subset of the Data that is valid? This makes no sense to me. The way I see it is you use ‘validate’ when the format of the data you are validating is the exact same format you are gonna be working with right after, meaning the return type doesn’t matter. The return type implies transformation – a write operation per se, whereas validation is always a read operation only.
> What is ValidatedData? A subset of the Data that is valid?
Usually, but not necessarily. `validate()` might add some additional information too, for example: `validationTime`.
More often than not, in a real case of applying algebraic data type & "Parse, don't validate", it's something like `Option<ValidatedData>` or `Result<ValidatedData,PossibleValidationError>`, borrowing Rust's names. `Option` & `Result` expand the possible return values that function can return to cover the possibility of failure in the validation process, but it's independent from possible values that `ValidatedData` itself can contain.
> The way I see it is you use ‘validate’ when the format of the data you are validating is the exact same format you are gonna be working with right after, meaning the return type doesn’t matter.
The main point of "Parse, don't validate" is to distinguish between "machine-level data representation" vs "possible set of values" of a type and utilize this "possible set of values" property.
Your "the exact same format" point is correct; oftentimes, the underlying data representation of a type is exactly the same between pre- & post-validation. But more often than not "possible set of values" of `ValidatedData` is a subset of `Data`. These 2 different "possible set of values" are given their own names in the form of a type `Data` and `ValidatedData`.
This distinction is actually very handy because types can be checked automatically by the (nominal) type system. If you make the `ValidatedData` constructor private & the only way to produce is function `ValidatedData validate(Data)`, then in any part of the codebase, there's no way any `ValidatedData` instance is malformed (assuming `validate` doesn't have bugs).
Extra note: I forgot to mention the "Parse, don't validate" article implicitly implies a nominal type system, where 2 objects with equivalent "data representation" doesn't mean it has the same type. This differs from Typescript's structural type system, where as long as the "data representation" is the same, both object are considered to have the same type.
Typescript will happily accept something like this because of structural
type T1 = { x: String };
type T2 = { x: String };
function f(T1): void { ... }
const t2: T2 = { x: "foo" };
f(t2);
While nominal type systems like Haskell or Java will reject such expressions
class T1 { String x; }
class T2 { String x; }
void f(T1) { ... }
// f(new T2()); // Compile error: type mismatch
Because of this, the idea of using type as a "possible set of values" probably felt unintuitive to Typescript folks, as everything is just stringly-typed and different type felt synonymous with different "underlying data representation" there.
You can simulate this "same structure, but different meaning" concept of nominal type system in Typescript with some hacky workaround with Symbol.
> The return type implies transformation – a write operation per se, whereas validation is always a read operation only
Why does the return type need to imply transformation and why is "validation" here always read-only? No-op function will return the exact same value you give it (in other words, identity transformation), and Java & Javascript procedures never guarantee a read-only operation.
I agree. I used to use vscode, then switched to Zed and used it for over a year (without AI). In February of this year, I started using Cursor to try out the AI features and I realised I really hated vscode now. Once Zed shipped agent mode, I switched back, and haven’t looked back. I very strongly never want to use vscode again.
I'm in the same boat but a neovim/cursor user. I desperately wish there was a package I could use in nvim that matched the multiline, file-aware autocomplete feature of Cursor. Of course I've tried supermaven, copilot etc, but I've only ever gotten those to work as in-line completions. They can do multiline but only from where my cursor is. What I love about Cursor is that I can spam tab and make a quick change across a whole file. Plus its suggestions are far faster and far better than the alternative.
That said, vscode's UX sucks ass to me. I believe it's the best UX for people that want a "good enough and just works" editor, but I'm an emacs/vim (yes both) guy and I don't like taking my hands off the keyboard ever. Vscode just doesn't have a good keyboard only workflow with vim bindings like emacs and nvim do.
If anyone's interested, I published a short, ad-free YouTube series on Dynamic Programming about 4-5 years ago [1]. I haven't had a chance to continue it, but many people have found the course eye-opening.
> No one is going to invest there for a very long time after what Russia did.
Many large businesses have returned to Russia. "No one is going to invest" is a naive childish thinking. They outperformed growth expectations in 2024, unemployment rate dropped from 5.8% in 2020 to 2.3% in 2025. GDP is surging, insane tech and energy investments from China. Plus Russia has a very low public debt. All in all, their economy is pretty resilient despite what they say in the mainstream media.
> Because a massive amount of men were conscripted?
That's an emotional oversimplification. Unemployment fell not because of conscription, but due to massive import substitution and rising labor demand in construction, logistics and manufacturing.
Despite sanctions, Russia's ruble-adjusted budget deficit remains manageable, and the trade balance is strong due to record energy exports. Military spending has driven industrial revitalization. Factories reopened, supply chains revamped and domestic R&D expanded.
Whether you agree with the morality or not, economically it’s not just money burned. It has multiplier effects: jobs, tech development and regional growth. Dismissing that is lazy.
I just tried Grok 4 and it's insanely good. I was able to generate 1,000 lines of Java CDK code responsible for setting up an EC2 instance with certain pre-installed software. Grok produced all the code in one iteration. 1,000 lines of code, including VPC, Security Groups, etc. Zero syntax errors! Most importantly, it generated userData (#!/bin/bash commands) with accurate `wget` pointing to valid URLs of the latest software artifacts on GitHub. Insane!
The problem is that code as a 1-off is excellent, but as a maintainable piece of code that needs to be in source control, shared across teams, follow standard SLDC, be immutable, and track changes in some state - it's just not there.
If an intern handed me code like this to deploy an EC2 instance in production, I would need to have a long discussion about their decisions.
No, have you? They always seem to be missing from these types of posts. Personally I am skeptical, as AI has been abysmal at 1 shot provisioning actual quality cloud infrastructure. I wish it could, because it would make my life a lot less annoying. Unfortunately I have yet to really see it.
No, they're not. People talk about LLM-generated code the same way they talk about any code they're responsible for producing; it's not in fact the norm for any discussion about code here to include links to the code.
But if you're looking for success stories with code, they're easy to find.
> it's not in fact the norm for any discussion about code here to include links to the code.
I certainly didn't interpret "these types of posts" to mean "any discussion about code", and I highly doubt anyone else did.
The top-level comment is making a significant claim, not a casual remark about code they produced. We should expect it to be presented with substantiating artifacts.
I guess. I kind of side-eyed the original one-shotting claim, not because I don't believe it, but because I don't believe it matters. Serious LLM-driven code generation runs in an iterative process. I'm not sure why first-output quality matters that much; I care about the outcome, not the intermediate steps.
So if we're looking for stories about LLMs one-shotting high-quality code, accompanied by the generated code, I'm less sure of where those examples would be!
I could write a blog post exactly like this with my chatGPT history handy. That wasn't the point I was making. I am extremely skeptical of any claims that say someone can 1 shot quality cloud infrastructure without seeing what they produced. I'd even take away the 1-shot requirement - unless the person behind the prompt knows what they're doing, pretty much every example I've seen has been terrible.
I mean, I agree with you that the person behind the prompt needs to know what they're doing! And I don't care about 1-shotting, as I said in a sibling comment, so if that's all this is about, I yield my time. :)
There are just other comments on this thread that take as axiomatic that LLM-generated code is bad. That's obviously not true as a rule.
Please share your result if possible. So many lines in a single shot with no errors would indeed be impressive. Does grok run tools for these sorts of queries? (linters/sandbox execution/web search)
[0] https://www.researchgate.net/figure/Global-reserve-currencie...
reply