Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jjnoakes
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
121.
▲
by
jjnoakes
3y ago
Unsafe Rust is safer than C++, and even if it wasn't, 5% unsafe in Rust programs (in well-marked locations) is vastly superior to 100% unsafe in C++ programs. Any analogy that equates the two is silly.
122.
▲
by
jjnoakes
3y ago
I feel like a few languages are better than others in a related but not quite identical area: Languages like Java and Go, while they CAN escape to native libraries, have cultures that tend to avoid that kind of thing. At least, in my projec
123.
▲
by
jjnoakes
3y ago
This is my experience as well. I find it much easier to work faster when the compiler is helping me, and I don't consider it a "straitjacket" at all.
124.
▲
by
jjnoakes
3y ago
Sure, and if a typical Rust program that I write has no unsafe in it directly, and 5% of its dependencies' code have unsafe in them, that's also the same as writing a program in the "not c++" language directly, and using
125.
▲
by
jjnoakes
3y ago
This is great - I will definitely check this out. I'm curious - have you been using this for long? Have you noticed any code which this flagged and which you thought it was being too strict? I feel like I would want this flag on all of
126.
▲
by
jjnoakes
3y ago
Agreed on all counts.
127.
▲
by
jjnoakes
3y ago
> It helps avoiding number of arguments problems, though This issue is all about the number of arguments problem, and TypeScript (in cases like this) won't flag that problem. Which is something I think it should. If you manually unr
128.
▲
by
jjnoakes
3y ago
I agree that it would be nice if it flagged this kind of thing. But TypeScript disagrees. https://github.com/microsoft/TypeScript/wiki/FAQ#why-are-fun...
129.
▲
by
jjnoakes
3y ago
TypeScript allows this too, unfortunately. https://www.typescriptlang.org/play?#code/MYewdgziA2CmB00QHM...
130.
▲
by
jjnoakes
3y ago
TypeScript has the same problem.
131.
▲
by
jjnoakes
3y ago
> rust demands that I cross every last t before I can run it at all. which is great if you already have a crystal notion of what you are building Maybe I'm a weirdo, but I don't find this to be the case for me. When I'm kn
132.
▲
by
jjnoakes
3y ago
I agree it is more flexible and might be more preferable to some, but it is also more dangerous, and I believe it is harder to maintain as well. Since the comment I replied to specifically said "better", that's what I directe
133.
▲
by
jjnoakes
3y ago
I'd be curious if there were any studies done on how much effect this kind of approach has on the number or severity of bugs or security issues in a code base.
134.
▲
by
jjnoakes
3y ago
> C is better because it doesn't try to program for you, it isn't clever, convenient, or have any ideas about how you structure or solve a particular problem Why is that better though? I personally appreciate it when cleverness
135.
▲
by
jjnoakes
3y ago
> pointers are handles Pointers are quite limited handles - they would all to be handles to the same array with base pointer 0, but that removes many of the useful benefits you get from having different arrays with different base pointer
136.
▲
by
jjnoakes
3y ago
I agree and I've been thinking about this in general (not only in the context of go, but for programming in general). I've settled on "caller adds context" because it is only the caller who knows if the error can be hand
137.
▲
by
jjnoakes
3y ago
Would you take anonymous cash?
138.
▲
by
jjnoakes
3y ago
SystemTap or ebpf might be the way to go for visibility at that level. Not quite a debugger, but they can be very helpful.
139.
▲
by
jjnoakes
3y ago
> That 16-bit payload length is actually written somewhere else, as bytes 3 and 4 of Buffer.allocUnsafe()’s global pool. These bytes may well be part of another active buffer, and thus we also stand a good chance of corrupting data elsew
140.
▲
by
jjnoakes
3y ago
> angry Seems like an unnecessary assumption.
141.
▲
by
jjnoakes
3y ago
It can be done well though, and when it is, it removes friction from the development process.
142.
▲
by
jjnoakes
3y ago
Sure but if a developer already has a JS runtime and they don't have Make installed, you've added unnecessary friction to the development process. I hate JS as much as the next guy, but if I'm developing in JS, I use a JS tas
143.
▲
by
jjnoakes
3y ago
Every time I've tried chatgpt I've been shocked at the mistakes. It isn't a good tool to use if you care about correctness, and I care about correctness. It may be able to regurgitate code for simple tasks, but that's al
144.
▲
by
jjnoakes
3y ago
Maybe, but I've always had lucrative jobs and my work has always been appreciated. Maybe you just have to find the right employer. I think longer-term, employers that value high quality work will have the upper-hand. And to be honest,
145.
▲
by
jjnoakes
3y ago
I don't mean to pick on you specifically, but this kind of approach doesn't fit the way I like to work. For example, just because the manifest.json worked doesn't mean it is correct - is it free of issues (security or otherwi
146.
▲
by
jjnoakes
3y ago
Existing compilers that know nothing of the new annotations can still compile the code (without the checks obviously) using the macro definitions provided in the article.
147.
▲
by
jjnoakes
3y ago
I think if productivity is high enough then there should just be fewer working hours. Edit: I also want to be clear that I don't really think about productivity as an instantaneous measure, but more of an average over time. Someone (at
148.
▲
by
jjnoakes
3y ago
No disagreement here. I think office workers should be productive too.
149.
▲
by
jjnoakes
3y ago
Not the author of the comment, but it is pretty clear to me that they are saying you can work from home and coast, or you can work from home and be productive, and they suggest that everyone who works from home should do the latter. I agree
150.
▲
by
jjnoakes
3y ago
> Unfortunately, if myself and the IRS come a disagreement about my filings, I can end up in jail or at the very least deal with an expensive criminal prosecution. I think there's a huge gap between facing an audit in most circumsta
More ›