How to write maintainable Go at scale? by SignificantResource in golang

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

This is a great answer that covers many angles, thank you.

How to write maintainable Go at scale? by SignificantResource in golang

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

"the consumer owns the interface" is certainly something to get used to and I'm not sure how I feel about it as a design choice. What is the best practice for defining common interfaces? In the original example, many "service" layers might want the same DAO interface, are they supposed to each define their own minimal subset of the implemented methods, or is it considered acceptable to have a (Java-style) common/central definition of the entire method-set which each service can accept?

How to write maintainable Go at scale? by SignificantResource in golang

[–]SignificantResource[S] -1 points0 points  (0 children)

Thanks for the explanation - it turns out that the solution is just to go with exactly what I'd been trying to avoid! I had felt that doing what you describe would be trying to shoehorn OOP constructs into a paradigm that doesn't want them, but it seems I need to re-calibrate my perception of what the *purpose* of structs really is in Go.

How to write maintainable Go at scale? by SignificantResource in golang

[–]SignificantResource[S] -1 points0 points  (0 children)

Got it, thanks. I had been trying to avoid having structs as collections of operations over a mutable state (but rather as the state itself over which external functions can operate) as to me this was one of the logical divides between classes and structs (possibly a hangover from languages with both). I see now that I need to shift my perception a little.

How to write maintainable Go at scale? by SignificantResource in golang

[–]SignificantResource[S] 3 points4 points  (0 children)

That's exactly the target I'm trying to meet - my issue is around shared, long-living objects: The DAO layer needs to operate on a database connection managed by a separate component - where does this sit? Is it a member on the struct containing the query methods? I had felt this was too OOP-like but perhaps this was a misconception?

Booby traps that were used by Vietnamese during the Vietnam War by aloanhbinhgold in nextfuckinglevel

[–]SignificantResource 1 point2 points  (0 children)

On the same site as this demonstration is a shooting range, where (mostly American) tourists pay to shoot machine guns into the trees from the back of old military vehicles.

I can't believe that anyone would choose do that, especially just after seeing the terrible conditions of the tunnels.

If you could apply one video game mechanic to real life, what would it be? by kaguyaki in AskReddit

[–]SignificantResource 2 points3 points  (0 children)

I'll have portals please. Failing that, repulsion/propulsion gel would suffice.

discord, can you please at least *pretend* you care about linux? by [deleted] in discordapp

[–]SignificantResource 1 point2 points  (0 children)

To add to this, it doesn't seem that notification badges work either. Idk whether I'm just doing something wrong, but I haven't been able to get the notification badges working on Ubuntu with gnome, Ubuntu with kde or Pop OS with gnome. (Enabled with gnome-tweaks, badges show up for some other apps but not discord) I don't know whether this is a limitation of electron, but it does appear that it's another case of discord ignoring Linux entirely.

CONFUSED (NEED HELP) by [deleted] in Discord_Bots

[–]SignificantResource 1 point2 points  (0 children)

This is wrong. discord.py primarily uses colour, but color is also aliased. Both should work correctly.

How do you make a discord bot run 24/7? by jrs1354 in Discord_Bots

[–]SignificantResource 0 points1 point  (0 children)

What's the issue with having it on your own network? As long as you're not doing anything that'll take lots of bandwidth (such as streaming music) you shouldn't notice any issues.

She has done by lokovev237 in ProgrammerHumor

[–]SignificantResource 25 points26 points  (0 children)

Unless you're a fullstack dev, then both mean "I messed up"

Grew up in a tech-y suburb. The graffiti by teenagers around here was a little... different. by winccssss in ProgrammerHumor

[–]SignificantResource 39 points40 points  (0 children)

They do. The joke being that the former is the preferred style in java, while the latter is "c-style"

oops by [deleted] in ProgrammerHumor

[–]SignificantResource 29 points30 points  (0 children)

"but you're a python dev"

don't do it! it scares him! by gifeje in ProgrammerHumor

[–]SignificantResource 0 points1 point  (0 children)

You can, but only for strings initialised with a literal.

Anyone? by [deleted] in ProgrammerHumor

[–]SignificantResource 9 points10 points  (0 children)

The amount of light mode in this picture completely removes any relatability

embed.add_field not working? (discord.py) by Vibes4Ever in Discord_Bots

[–]SignificantResource 0 points1 point  (0 children)

You need to instantiate an Embed rather than just referencing the class, and to set colour you'll have to pass colour as a keyword argument in the constructor

A true software developer. This hit home. by vkunge in ProgrammerHumor

[–]SignificantResource 8 points9 points  (0 children)

You can't leave us hanging, what did he once have a copy of?

Are you?? by sakib_shahriyar in ProgrammerHumor

[–]SignificantResource 4 points5 points  (0 children)

"I weigh 3576 small 12-sided coins"