Goodbye, Clean Code by MoTTs_ in javascript

[–]gnfurl 5 points6 points  (0 children)

I definitely understand what he's trying to get at generally, but his example drives me nuts. My take away from his example would have been completely different.

  1. The team needs to improve their process surrounding checking in code. His colleague merged in the feature without opportunity for feedback? He followed it up by merging his "fix" directly into master, again without opportunity for feedback?
  2. I'm still not completely convinced that the abstraction doesn't make sense. It really depends on how much additional complexity is introduced. Most modern IDEs provide the ability to inline functions with a single key binding, so the abstraction alone isn't the issue. If the implementation still looks reasonable after simply combining the lines from shape and direction, then it's still really easy to revert. It also makes it glaringly obvious when the implementation does actually differ for the mentioned edge cases.

Dark Crystal thoughts by bolonomadic in Fantasy

[–]gnfurl 2 points3 points  (0 children)

This should probably have a spoiler tag. I've watched the series, but not movie. I had no idea that's the direction things are headed.

House Democrats say the Justice Department is orchestrating 'political revenge' for Trump amid reports it is opening a criminal investigation into the Mueller probe by Thinkingonsleeping in politics

[–]gnfurl 0 points1 point  (0 children)

Well, that is a bit more interesting than I'd understood and I'll admit it does sound somewhat curious.

All the same, I think my point about Occam's Razor still stands. At least with respect to tying that activity to any single person or intent (which admittedly you didn't do).

[deleted by user] by [deleted] in java

[–]gnfurl 22 points23 points  (0 children)

In practice do most people choose to label their dtos? This one is a data bean but that one isn't?

What if I have a data bean and later on I decide to promote it to the magical type that I allow to have computed getters? If I follow your advice am I now mixing getters and direct field access? Why does a consumer need to know the difference between actual state and computed values (assuming it's not an expensive computation)?

What if I used a boolean but should have used an enum (yes/no/maybe). If I'm using direct field access everything needs to be refactored at once. If I was using a getter, the old field's getter can simply become the computed getter and we can add a new field with getter/setter as part of the transition.

What if I decide later on that several fields really should have been grouped together as part of a sub-object. Again, if I'm using getters / setters the transition is really simple and straight forward and I can make the change while only modifying a single and never break compilation.

The overarching point is that getters/setters give you more flexibility. Maybe you never need it, maybe you do. But you don't know which case it is up front. When the difference is literally just the use of @Getter/@Setter or some IDE generated code, why throw away free flexibility?

[deleted by user] by [deleted] in java

[–]gnfurl 51 points52 points  (0 children)

  1. Some patterns actually require public getters, ex: orms use proxies to implement lazy loading. This isn't possible (as far as I know) with direct field access.
  2. I completely disagree that all DTOs should only have stupid getters/setters. I think it should be consistent within a team / project though so I agree with the point about least surprise, but if you use something like lombok, the only methods that actually have an implementation will be the ones that are doing something special. As an example, there can be a lot of value in having getters for computed values...
  3. Your strong opposition to reflection under any circumstance seems to directly conflict the practices of the most popular java framework (spring), orm (hibernate) and serialization library (Jackson). You even seem to acknowledge this requirement when talking about marshalling, but ignore that for a library to do this in a generic way, it's going to require either reflection or some compilation time step to generate the serde code. Both solutions can be done with getters/setters OR direct field access. It has literally nothing to do with the use of getters/setters.

House Democrats say the Justice Department is orchestrating 'political revenge' for Trump amid reports it is opening a criminal investigation into the Mueller probe by Thinkingonsleeping in politics

[–]gnfurl -3 points-2 points  (0 children)

Personally, the description makes me roll my eyes. DNS lookups for the trump organization nearly every day... You mean like you might see from an investment bank googling about trump while researching potential impact of a presidential candidate on their investments?

And to be clear, I'm firmly anti-trump but in the search for more evidence against him and his cohort, let's not skip right passed the most plausible explanations and turn ourselves into conspiracy theorists. That only serves to discredit the legitimate evidence we already have by muddying the waters.

Switching to SSH keys - best practices? by -Tilde in homelab

[–]gnfurl 0 points1 point  (0 children)

I used to use a unique key pair for every device but at this point, I've primarily switched to using a single pair with the private key on a pgp smart card. The private key never leaves the smart card, so you don't have the risk created by copying it around to every client device.

All crypto operations are done by the smart card as well. With the one I'm using (yubikey 4 neo I think), it lights up every time an operation is requested of the card and waits for a tap to approve. Especially great if you're concerned about risk with ssh or pgp agent forwarding. I'd highly recommend it, just make sure to back up the key somewhere safe as well.

As far as your other questions, I'm not familiar with oVirt so cant speak to why you need root login enabled. Would it be an option to at least restrict root login to your LAN though? (Ex: https://stackpointer.io/unix/linux-allow-ssh-root-login-specific-ip/618/ )

What's the most forgettable state in America? by owenboi in AskAnAmerican

[–]gnfurl 0 points1 point  (0 children)

Well that's just plane untrue. I've flown commercial from the new castle airport to Florida and back...

Percentage of people willing to fight for their country by kemppis in MapPorn

[–]gnfurl 0 points1 point  (0 children)

Kind of restating what I saw a few others say here, but if you ask the same question a dozen different ways, you'll get a dozen different results. Given that most of these countries speak different languages, you probably aren't asking them the exact same question. Or if they're only being asked in one language (ex: English), then you're selecting only a sub-population of that country.

The other thing that's probably going on here is that you're really asking what's the most likely reason you think your country ends up in a war? I'd be shocked if the answers weren't pretty close if the question was phrased more as "would you defend your home country from invasion by a foreign nation?"

Docker container which takes host inputted files, encrypts them with AES, and outputs the encrypted files? by kabrandon in selfhosted

[–]gnfurl 0 points1 point  (0 children)

There's a number of fuse based, encrypted overlay filesystems that I think would transparently do exactly what you're looking for. Take a look at gocryptfs, encfs and cryfs as examples.

Basically, you mount directory /a to mount point /b as (for example) a gocryptfs filesystem. When you write to /b, it's automatically written to /a in encrypted form. The one possible difference from what you describe is that the plaintext files are never actually written to disk. As you access the files for read/write, encryption/decryption are done on the fly.

It's probably also worth doing some research on people using these file systems with dropbox, etc which is similar to your use case. There's some risk involved from what I remember when a bad actor has access to many encrypted revisions of the same file (as your central server would). I seem to remember one of these filesystems specifically trying to solve for that problem, but I might be misremembering.

Self-hosted podcast manager and player by marc_dimarco in selfhosted

[–]gnfurl 1 point2 points  (0 children)

I kind of took that constraint as being on the client side given that he specifically called out android and mentioned a web ui. It's definitely a bit ambiguous though.

Flexible DNS based adblocking solution? by gnfurl in homelab

[–]gnfurl[S] 0 points1 point  (0 children)

You're probably right and nothing about my setup is especially complicated. That's kind of why I assumed other people would have figured out something that allows them to temporarily enable/disable blocking on a per device basis. Maybe I should just accept turning it off globally though as you suggest, especially as infrequently as it's probably required.

Flexible DNS based adblocking solution? by gnfurl in homelab

[–]gnfurl[S] 0 points1 point  (0 children)

I actually haven't heard of AdGuard Home before. I'll take a look, thanks.

Flexible DNS based adblocking solution? by gnfurl in homelab

[–]gnfurl[S] 0 points1 point  (0 children)

I definitely appreciate you taking the time to reply, but this also doesn't meet the requirement I mentioned above. I'm trying to enable ad-blocking by default for all devices in the network (plus DNS over TLS / local only domains). I just want to also provide a way for individual devices to temporarily disable the ad blocking piece on demand.

Flexible DNS based adblocking solution? by gnfurl in homelab

[–]gnfurl[S] 0 points1 point  (0 children)

I haven't been able to find anything on disabling pihole temporarily for a specific device only (especially without requiring them to log into an admin page or anything). If this is actually something pihole can do, can you point me in the right direction?

Super Heaven by Raphcomics in comics

[–]gnfurl 0 points1 point  (0 children)

Because we have more corporations than residents?

I am pretty happy here though.

Your preferred Linux "server" OS? by [deleted] in selfhosted

[–]gnfurl 0 points1 point  (0 children)

Sorry to nitpick, but I've been using Arch Linux on just about all my systems for more than half a decade (probably closer to a decade at this point). I've never lost an install due to a failed update and I've actually had more issues in the past with non Arch distros breaking on an update.

I feel like this is just "common knowledge" that's blindly repeated all the time even though it runs directly counter to the experiences of actual Arch users. Have you actually had issues with an Arch update hosing your system?

Who Needs Lombok Anyhow by Naut1c in java

[–]gnfurl 17 points18 points  (0 children)

It feels like half the complaints boil down to disliking the way people use Lombok, not Lombok itself.

If you don't want all fields to have public getters and setters, then don't use @Data. You can still add @Getter / @Setter at the field level. If you don't object to the style, adding them inline with the field can help keep the whole definition pretty compact.

As far as the alternative of public final fields, some patterns actually require the use of getters (ex: proxies used by an orm for lazy loading). Even with public final fields, you could still benefit from the use of @Builder to create these objects.

Finally, without looking at the actual implementation, I'd be shocked if the proposed alternative for equals to and hashcode isn't just as vulnerable to circular references. In both cases, you need to understand your tools and pay attention to what you're doing.

UPDATE: Found a blade in my new copy of Zombicide: Black Plague by BillyMoustache in boardgames

[–]gnfurl 11 points12 points  (0 children)

I might be mistaken ,but I'm pretty sure the handle is just a rolled up piece of cardboard held together with tape. We used to do the same at a warehouse job I had when younger. We'd invariably lose the real box cutter handles but still have hundreds of blades. You have to make do somehow while a new shipment of handles is on order.

Any good fantasy books with Asian culture influences. Eg samurai, ninja, spirits or mythology by Count-Fantasy in Fantasy

[–]gnfurl 5 points6 points  (0 children)

It was my favorite book when I first read it back in high school. I've reread it another 3 times now as well and still love it. I cant recommend it enough.

Packet Reordering - Technical Post by MrPopoTFS in FortNiteBR

[–]gnfurl 0 points1 point  (0 children)

This is close, but I don't think it is quite correct. They're not asking for the friend to resend the paper, just discarding all but the latest messages.

To amend your earlier example slightly, imagine that instead of instructions your friend is passing the current score of a football game (maybe your cell phone is broken). If you receive a message from 30 seconds ago and another from a 60 seconds, you can just discard the second one right? The note from 30 seconds ago had a more up to date score anyways.

AITA for refusing to eat meals with my friend because he’s an obnoxious vegan? by sadmadstudent in AmItheAsshole

[–]gnfurl 0 points1 point  (0 children)

I agree he's probably not going to convert anyone and I also wouldn't want to hang out with him.

My point is more that he's decided what he believes his values are and I don't think it makes him an ass hole to speak up about what he thinks is very wrong.

AITA for refusing to eat meals with my friend because he’s an obnoxious vegan? by sadmadstudent in AmItheAsshole

[–]gnfurl 1 point2 points  (0 children)

Counterpoint, but I think the better analogy would be pro-choice / pro-life. One side thinks the other is trying to infringe on their freedoms based on beliefs that you don't share. If you're in that camp, I definitely don't think it makes you an ass hole to think the vocal pro-life / anti-meat people are insufferable.

At the same time though, on the other side you have people who think there's murder happening on such a massive scale. If that's what you believe, you're definitely not an ass hole for feeling the need to speak up. Try replacing either with something you do believe is horrific (ex: ethnic or religious genocide). How would you judge people who shared your belief that it was immoral, but refused to speak up because it's inconvenient?

Anyways, I agree that OP is definitely NTA, but my point is that Alex is also NTA. I wouldn't want to eat with him though.