HNHacker News
TopNewBestAskShowJobs

bfrydl

605 karma · joined November 8, 2017

submissionscomments
bfrydl··on Why don't we have Wayland on Raspberry Pi yet? (2018)
> Who in their right mind would ever write a shell script

I quite enjoy writing fish scripts. Largely because I can actually remember the syntax for conditionals and loops.

bfrydl··on Meal Kits Have a Smaller Carbon Footprint Than Grocery Shopping, Study Says
> But store meals required purchasing food in larger quantities than necessary (think a 12-pack of hamburger buns for a two-person meal).

This is the key, and one of the reasons I love Blue Apron. The meals come in such exactly portioned amounts that the only thing left when I'm done eating is the packaging. There is zero food waste, ever. (Incidentally, this makes an effective weight-loss diet if your problem is overeating like me.)

That being said, I wonder if Blue Apron would still come out ahead of home cooking if you did not attempt to make the same meals but instead more typical home cooked meals. Blue Apron recipes on average are more varied and have more ingredients than what a person would normally cook, so I wonder if the extra food waste is more a consequence of trying to reproduce them.

bfrydl··on Selfie Deaths in the Outdoors
In the first example, the author is trying to claim that the woman died on a quest to take a selfie in a bikini. That woman was a mountain climber. She died trying to summit a 10,000 foot plus mountain. It seems disrespectful to focus on the selfie aspect and place her in the same category as a man who tried to take a selfie with a wild bear.

> It’s easy to write off these tragedies as catastrophically bad judgment.

Yeah, because they are. I have never once thought about risking my life for a selfie. The only thing the author offers to explain why this isn't true is that some selfie deaths occur while the photographer is engaged in “non-risky” behavior. That would make them accidents. Whether someone was holding a phone when an unforeseeable accident befalls them seems pretty irrelevant.

Overall I'm not sure 259 people dying in six years worldwide can be called an epidemic, especially when you consider that they may have died this way even without handheld cameras to document it. It seems very silly to call it “our obsession” with photographing risk-taking when obviously the overwhelming majority of people do not do this.

bfrydl··on Things I Enjoy in Rust: Error Handling
While I too love Rust's error handling, this explanation of it seems incomplete without discussing the ? operator and its interaction with the From trait. The convenience methods on Result itself are nice of course but they aren't really the main mechanism of error handling in my opinion.
bfrydl··on Ask HN: Products that suck but you still use?
The web.
bfrydl··on US Wages Finally Get Back to Where They Were in 1973
> The median salary only accounts for the top 30% of Americans

I'm not a mathematician but this doesn't sound right to me.

bfrydl··on Bosque Programming Language
The description suggests the syntax and type system are based on TypeScript. After looking through the docs I have to say I wish this were much more true. It seems like Microsoft Research has thrown out half the good ideas TypeScript has in favor of overly noisy, complex syntax.
bfrydl··on Cursive Seemed to Go the Way of Quills and Parchment. Now It’s Coming Back
Cursive in general, meaning letters connected together to minimize pen lifts, still exists because it's easier and faster than block lettering. It's the particular kind of looped cursive taught in America that was designed for dip pens and other older instruments. Writing this script with a modern pen or pencil trades legibility for writing speed and comfort.

My point is that if we want to keep teaching kids connected writing, there are cursive scripts that are easier to teach, easier to write, and easier to read than the one we've clung to for so long.

bfrydl··on How being Freelancer is not same as being an Entrepreneur?
Freelancer is where you work for yourself doing contracts to make money.

Entrepreneur is where you have a Twitter full of Gary Vee memes and Elon Musk retweets.

bfrydl··on Cursive Seemed to Go the Way of Quills and Parchment. Now It’s Coming Back
Typical cursive is a form of connected writing originally designed for pens and quills with flexible nibs. Letters like ℓ have loops because when writing with these tools the downstroke is thicker than the upstroke. The result is a recognizable lowercase L with a thin stroke on the side. It's easy to read even if you've never had to before.

This form of writing was dated as soon as the ballpoint pen was invented, which was in the 19th century. Writing it with a pencil makes even less sense. By tradition we have clung to this terrible writing style instead of introducing something more sensible and modern like italic cursive, which is connected but without loops.

bfrydl··on Value Objects – DDD with TypeScript
> How can you restrict the very possibility of creating invalid instances of a User this way? There's nothing stopping me from using the "new" keyword and making an invalid user with a name 400 characters long.

Why do you need to restrict this possibility? How many places in your code create new users, and how many places in your code need to validate users? If the answer is “many,” you have serious design problems that should not be solved by introducing more classes but by restricting how many different areas of code do the same job.

Also, the private constructors do absolutely nothing. The static factory methods in this blog post could be written the exact same way as a constructor, and they would work exactly the same. The only reason the author uses a static factory method is because that's what he was taught to do in Java.

It's just OOP for OOP's sake in a language with tons of features designed for avoiding OOP.

bfrydl··on Value Objects – DDD with TypeScript
This seems like overengineering and a needless application of OOP. The author presents ideas like service classes or static factory methods as if they are self-evident, but I don't understand what would make someone write TypeScript code this way besides too much Java experience. The final solution has the value of the “name” field nested multiple objects deep!

How about this code instead:

    export interface User {
      readonly name: string;
    }

    export namespace User {
      export function validate(user: User) {
        // In "strict" TS, `name` is required at compile time to not be null or undefined.
        if (name.length < 2 || name.length > 100) {
          throw new Error('User must be greater than 2 chars and less than 100.');
        }
      }
    }
Unlike the OOP solution, there's no guarantee that any given `User` is valid unless you check it with `User.validate`, but there should be minimal places if not one single place where users are actually validated, such as where they are saved to the database or backend.
bfrydl··on The Dreams of a Man Asleep for Three Weeks
If you want to remember your dreams you can train yourself to do so. Keep a journal on your nightstand. The moment you wake up, write down all the details you can remember. After doing this for a while, you will remember more and more and the memories won't fade so easily.

You can also cheat a bit in my experience by waking up maybe 45-90 mins before you normally would, then going back to sleep. The dreams you have in this period should be more vivid and easier to remember.

bfrydl··on Npm Layoffs
Is it normal for an ex-employer to help laid-off employees find new jobs? I would never expect that.
bfrydl··on Rust in Production (2018)
The specific problem he is referring to should now be fixed with NLL, yeah. That doesn't mean lifetimes aren't still hard to learn at first, though.
bfrydl··on Kidfluencers' Rampant YouTube Marketing Creates Minefield for Google
Either way, the system clearly works.
bfrydl··on Kidfluencers' Rampant YouTube Marketing Creates Minefield for Google
This user is from 2017. I've read Hacker News for a long time. I think you need to get over yourself a bit.
bfrydl··on A world of message-oriented programming languages (2018)
It's not relevant. I really only corrected you in case someone wants to google it.
bfrydl··on A world of message-oriented programming languages (2018)
That's actually object destructuring. Object spreading is where you “spread“ an object's keys and values into a new object literal:

   const foo = { x: 1, y: 2 };
   const bar = { ...foo, z: 3 }; // has x, y, and z
bfrydl··on Kidfluencers' Rampant YouTube Marketing Creates Minefield for Google
I can indeed deny it. I think you are also giving yourself too much credit. I would be very surprised to see a comment like that one not at least colored grey, even without your heroic involvement.
bfrydl··on Kidfluencers' Rampant YouTube Marketing Creates Minefield for Google
You happened to catch that comment 3 minutes after it was posted. When I came to this thread not 15 minutes later, the comment was already flagged so much it got collapsed. There is no cause for alarm or doomsaying.
bfrydl··on Docli – A declarative language for command-line interfaces in Go
It's a little strange that I had to open the tutorial to find out what language this is for.
bfrydl··on In a study of senior CS majors, U.S. students are tops in skills
Yeah if this were a Software Engineering test the correct answer to the question would be: ”First I would ask the client why they needed this. If they didn't have a good answer I would advise them not to do it. If they still want it anyway: 720.”
bfrydl··on In a study of senior CS majors, U.S. students are tops in skills
It's considerably worse when you see bizarre password restrictions because they usually mean the password is stored in plaintext. For example, your bank definitely is doing that.

Don't use that same password for anything else!

bfrydl··on In a study of senior CS majors, U.S. students are tops in skills
This is a Computer Science test, not a Software Engineering test. I think it's even worse as a test for the latter.

I don't really agree that these questions test debugging skill. In real life if I read a bit of confusing code and get tricked, I will usually know immediately thanks to my IDE, compiler, automated tests, debugger, or behavior of the program. On this test if I get tricked, I just lose points.

In my experience most debugging presents as trial-and-error (a terrible test-taking strategy) or seeing a bug and reasoning at a high level which component of the software is responsible and gradually narrowing it down. Carefully reading through lines of code is usually the last step, unless I've got an especially elusive bug.

> And the variable naming quip... are you serious? One of the worst mistakes you can make when trying to read code for understanding is to rely on documentation layers like comments and variable names. Those things lie. Read the code.

I'm not sure what sorts of code you're reading but this opinion seems extreme. Do you really just wholly ignore comments and variable names? I have encountered inaccurate examples of both but I have never thought to distrust them by default. As far as I recall this has not caused me serious issues while debugging.

bfrydl··on In a study of senior CS majors, U.S. students are tops in skills
I didn't mean to say this question is scandalous. It is a needlessly confusing question. No PIN I've ever heard of requires unique digits, and the question does not actually have anything to do with PINs.

If a CS student taking this test does not get “tricked” by this question, they should definitely be able to answer it.

bfrydl··on Implementing a NES Emulator in Rust
OP is using unsafe to store a mut pointer to a boxed value so that it can be mutated in two places. So the statement is just referring to data races.
bfrydl··on Implementing a NES Emulator in Rust
OP mentions that the use of unsafe code means it's single-threaded, so yes it's likely that RefCell could be used instead of unsafe code.
bfrydl··on In a study of senior CS majors, U.S. students are tops in skills
I took a look at the sample questions for the test, having never heard of it. It's 66 multiple choice questions, and many of them seem like “gotcha” questions where one of the answers is an off-by-one error or something like that.

And how about this lovely question:

> A personal identification number that opens a certain lock consists of a sequence of 3 DIFFERENT digits from 0 though 9, inclusive. How many possible PINs are there?

Putting aside the value of this question in the first place, the correct answer is 720 but it also includes the answer 1000 in case you didn't notice the emphasis on “different”.

Doesn't seem like a great test to me unless it's about your reading comprehension and ability to decipher code with single-letter variable names.

bfrydl··on In a study of senior CS majors, U.S. students are tops in skills
Wow, just goes to show you journalists will editorialize anything!
← PreviousPage 2 of 4Next →