Better HN
topnewbestaskshowjobs
Log inSign up

nmilo

1,205 karma · joined Jan 2, 2022 (4y ago) · 235 submissions

Submissions

comment 4y ago · link · parent

Really? You see a joke project made for fun and the first thing you do is try every horrifically racist and homophobic slur you can think of? Do you always look for things to be mad about?

comment 4y ago · link · parent

Obviously modelling your program like Car extends Vehicle is bad, but thinking in terms of real-life relations makes thinking about complex subtyping relations like covariance much easier to grasp.

Compare:

> If B and C are subtypes of A, then List<T> must be invariant over T since List<B> should not be a subtype of List<A>, which can contain both B and C.

with:

> List<Cat> can't become List<Animal>, because you might add Dogs to that list!

comment 4y ago · link · parent

You already have a "dynamic slider control" for everything you read, it lives in your brain and it's called "skimming." Well-written articles already expose the essential point in an easy-to-find way, and I couldn't imagine what a "give me the tl;dr now" button would do to our already ruined attention spans. The tl;dr might exist for some articles, but most of the time, the essential point requires a lot of build-up and context to understand; you can't just take that context away.

comment 4y ago · link · parent

> We built a social network for pets. [...] Every story update is appended in a homemade "blockchain" running in WebAssembly in the Lambda worker.

Dear God.

comment 4y ago · link · parent

Avoid second-person pronouns such as "you're".

comment 4y ago · link · parent

Careful, you might lose an hour on that site.

comment 4y ago · link · parent

The bin forever? I don't know anyone who gets their news and blog posts straight from Google search. Google can't stop you from putting up an RSS feed, sharing the link to friends, or posting it to content aggregators like HN or Reddit, which I think are far more important for building a real audience than Google search.

comment 4y ago · link · parent

Of course there's no counterculture---(but not for the reasons given in the article)---the Internet has made it a part of mainstream culture. No matter how absurdly counter-mainstream you make a piece of music, film, etc., you will find an audience enjoying it online. There is no counterculture because almost everyone is a part of at least one niche subculture. The fact that you're posting this on a forum that would have undoubtedly been called "countercultural" 30-40 years ago is telling of how far culture has changed since the times when the Top 40 chart was relevant.

comment 4y ago · link · parent

Yes, that's how society works. If you use a service respectfully you get rewarded with the ability to keep using that service.

comment 4y ago · link · parent

You're conflating developers who write in Go with developers who write Go. It's easier for me to write weird "function returns function" tricks than it is to fork a compiler.

comment 4y ago · link · parent

I mean, of course they're slow, it's varargs (on the heap, garbage collected), dynamic function closures (on the heap, garbage collected), and a series of indirect function calls. You really don't need a bunch of benchmarks to tell me it's slow, I believe you. But as much as it pains me, and any premature optimizer, to write "...func(*config)", I don't see the problem unless you find it in a hot section of real code and then do real benchmarks on the code to solve a real problem; these blog post benchmarks are not helpful. I bet regexp.Compile is slow too, but I don't complain about it until I find it in a hot section of code.

comment 4y ago · link · parent

That sounds absolutely insane, no way people care that much about their programming languages. Do you have some evidence or is this a pipe dream?

comment 4y ago · link · parent

Rust's approach is definitely safer, but my point is that the concerns are overblown. The Go compiler raise an error if a variable (error) goes unused, and just ignoring this error by naming it "_" is obviously dangerous. Yes, Rust makes it easier to never ignore an error, but I don't think I've ever accidentally ignored an error that I shouldn't have in Go.

comment 4y ago · link · parent

I see this point everywhere about Rust's union types and it always kind of irks me:

> The point is, this [Result type] makes it impossible for us to access an invalid/uninitialized/null Metadata. With a Go function, if you ignore the returned error, you still get the result - most probably a null pointer.

It's all about framing. You can just as equally say it is "impossible" to access an invalid Go FileInfo, because you'll get a panic for derefencing a null pointer. Or you can just as equally say it is "possible" to access an invalid Rust Metadata, just by doing .unwrap(). Everyone knows an unchecked .unwrap() is just bad Rust code, but then again dereferencing a pointer without checking the returned error is just bad Go code.

Anyways the rest of the article seems like just a criticism of Go's file system API, which seems fair but also seems a little niche given how difficult it is to create a good cross-platform file system API. This particular point irks me though:

    > stat "$(printf "\xbd\xb2\x3d\xbc\x20\xe2\x8c\x98")"

    > fmt.Printf("      %s\n", e.Name())
> It... silently prints a wrong version of the path.

What did you want it to do? The author even admits go strings are just byte slices, not UTF8, and then passes a non-UTF8 string to a function that expects UTF8. If there's a chance the file path your program works with might not be UTF8, then you should validate it. I think moving the complexity UTF8-ness out of the type system was a necessary evil.

comment 4y ago · link · parent

I can't even begin to follow this line of thought. Is 'billionaire' offensive because it distinguishes those who own billions of dollars versus those who don't? How, by your logic, is 'property owner' not offensive?

comment 4y ago · link · parent

I think you're misreading. Nowhere in the article did the author say she "liked the tool" for removing whitelist/blacklist.

comment 4y ago · link · parent

Youtube-dl's site is yt-dl.org, not youtube-dl.org. Not surprised the second one doesn't show up. Not sure why this blogspam is here on HN either.

comment 4y ago · link · parent

Generally I find if you're writing code like that, your code is too high level. Okay, you've propagated errors, but what is the calling code going to do with those errors? I find large functions like that usually have enough context to handle the errors themselves. Errors, after all, are just conditions with a special name. It's not common to propagate conditions up several layers of code, so why do the same with errors?

comment 4y ago · link · parent

Don't split hairs; it says "GOP", same thing. And words in the title and lead paragraph hold about 10x the weird.

comment 4y ago · link · parent

So, yes, it is nothing more than a consulting firm with the Republican party as one of their clients. The other questions still stand:

> What's the point of making "Republican" so prominent in the article? Is it just to use the negative connotation most WP readers have about the Republican party to malign Facebook a little more?

comment 4y ago · link · parent

What is a "Republican strategy firm?" A consulting firm with the Republican party as one of their clients? What's the point of making "Republican" so prominent in the article? Is it just to use the negative connotation most WP readers have about the Republican party to malign Facebook a little more? It seems like we're just spectating an op-ed war, and discussing this article as if there's any meaning to it other than to malign Facebook.

comment 4y ago · link · parent

Unsafe isn't too bad in any code. The point of unsafe is that it is a declaration that the programmer has verified the code is safe. It is certainly easier to verify something along the lines of:

    unsafe { transmute::<u32, Error>(error_code) }
than it is to verify that the weird macro code in the article is correct. There is no data races, use-after-free, etc. in that block, it does exactly what the article needs. To me, Rust programmers seem to have a weird notion that just the word "unsafe" is enough to conjure demons and monsters into otherwise totally normal code.

comment 4y ago · link · parent

An unsafe block is significantly better than the code proposed in the article.

comment 4y ago · link · parent

Who's we? The great thing about text files is that they're editor agnostic. If there already exists 1000 editors that work, should that really be stopping me from making the 1001st that works for me better?

Also I disagree with the idea that teams should use the same editor. I, for example, hate vscode, so if I join your team, I'm stuck either using a less productive editor, or re-creating the launch configs and save actions in my editor. To me it seems like a failure on the editor's part to separate concerns---a code editor should edit code. If it compiles or launches the code, it should do so using an external program, e.g. make, where all the launch configs can go in the Makefile, and not in some editor specific file.

comment 4y ago · link · parent

How is that ironic?

comment 4y ago · link · parent

But which bank are you trusting in a time of war? We've seen countries have the power to subvert savings accounts, e.g. Greece limited bank withdrawls to £5000/month. Do you trust these banks more than a distributed ledger? This is a question that needs real thought and evaluation, and crypto might be a useful option. Diversification is important.

comment 4y ago · link · parent

Agreed, the (2001) is almost a little ridiculous---we all know 9/11 happened in 2001, and the year in the title is supposed to refer to publication date.

comment 4y ago · link · parent

Not really, it's on github, they can't control that. I guess they could make a static github pages, but a github repo gives hosting and community contribution for free.

comment 4y ago · link · parent

> And before someone says Go doesn't have exceptions: It does, 100%, in all but name.

But here the name actually matters. They're called "panic"s, not exceptions. When you panic, you signal a fatal error that should ideally terminate the program. You shouldn't care about closing files or freeing memory, because well-written Go does not panic, and if it does, execution will end very soon. A panic in a String() method is just bad code, don't do it. Meanwhile in C++ you can reasonable expect an exception anywhere. Bad arguments, invalid states, IO failures, and other errors that should be expected in the execution of a program all throw exceptions in idiomatic C++.

1
45678