Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
just use spanner for everything it's cool

Adbot
ADBOT LOVES YOU

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

jit bull transpile posted:

It's more complex than that unfortunately. There's *layers of abstraction * involved and we have to have the pipeline fail when data is invalid so it can be cleaned. We can't quietly drop bad data. A pain when doing tests but necessary for production.

Can you add a step before pipeline failure to count all the garbage data and generate some kind of report? then give it to whomever and tell them you can't accept their data unless it passes this validation

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

Triglav posted:

i wanna write terrible programs for money that go fast and dont use a lot of ram

is knowing only c decently employable or do the businessmen really mean c++ when they write "c/c++"

I usually interpret "c/c++" as "c++ but used really badly in a c-like way"

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
There's something I've run into a few times in slightly different forms, and I'm wondering if there's a name for it or common pattern for handing it.

basically, there's some data at rest. A serving job loads some of that data and validates it in order to handle a request. Separately, there is code that loads all of the data and validates some of the same invariants. Conceptually it seems like a really good idea for the code that validates stuff to be completely shared. In practice, I have never seen it works out that way.

Often, the serving job possesses additional context or privileges necessary for certain checks.

Or perhaps the validation job is able to perform more checks because it operates on all the data rather than a subset.

Or maybe in one context the data is in text form and you want line numbers + human actionable messages for every single issue, but in the other context the data is in a serialized binary format and you only want to know good/bad and fail quickly.

So have y'all run into stuff like this? What kind of things do you consider when working on this problem?

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

comedyblissoption posted:

is there something better than git's distributed immutable dag for programming source control

seems deece enough for me

piper b*tch

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

cinci zoo sniper posted:

aws docs seemed ok but that was much earlier and i was doing much simpler things (also was way more clueless than now if that sounds believable to you)

now gcp intuitively appears to be trashfire, so im genuinely curious how off about their docs specifically i am, that is one cloud ive had not even a tangential relationship with

I wrote some bad docs for the gcp product I work on but my team has a tech writer now, so they should be getting better.

I like the parts of gcp I've used on my gently caress around / learn stuff projects. right now it uses gcp dns, load balancer, cdn, and cloud storage. GCLB recently added 'automatically managed https certificates' which is nice because now I don't have to run a bunch of letsencrypt commands every couple months. I'm confident https://www.goatse.gop could efficiently handle millions of users if it ever needed to (it won't).

Cloud shell is also really convenient, and I've enjoyed loving with cloud build and kubernetes engine.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

MrMoo posted:

Working with Boost.ASIO and Boost.Beast this week. Yesterday I get a TLS server up and running and today HTTPS, I'm getting the distinct impression the API is worse than Perl in number of permutations of doing the same thing. Every example and usage is annoyingly different.

Asio is a piss template hell api. I'm sure it's very efficient and zero-overhead or whatever but the code you have to write to make things work is loving incomprehensible to anyone who hasn't spent hours studying the docs.

I am not an asio expert, but one option to simplify things: figure out exactly what concurrency model you want to use, and just bake that into your code everywhere. Don't try to make things too flexible. Ie: if you're going to spawn a coroutine for every incoming connection, you're gonna need to plumb a yield_context& parameter through hella functions and you should just live with that.

Once you've got the hang of asio, beast's http stuff feels straightforward but barebones. It's like, here's a struct with a field for each part of the http request. beast will serialize it on the wire for you. Go look at the RFC if you want to know how the connection-token and keep-alive header should be handled by your code.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
because my brain is broken and I enjoy writing c++ for regular everyday tasks

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
90% of the time when I'm writing a regex it's because a tool I'm using accepts them for filtering or find/replace, and I'm writing ".*something.*" or whatever. Imo this level of regex ability is important for everyone to learn.

If a regex isn't immediately understandable or pulled directly from an RFC, I'm probably pushing back hard in code review.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
the bazel equivalent is a data dependency https://docs.bazel.build/versions/master/build-ref.html#data

This probably isn't helpful for cmake, but maybe it'll point you to some new search terms or find a project with both bazel and cmake configured and copy them.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

redleader posted:

so how do goog handle storage (+ dbs, although i appreciate that dbs at goog are probably of a different scale) if k8s sucks at it

you just put everything in spanner. how does spanner handle storage? very carefully

if you work with bigass blobs of unstructured data, you might put them in google cloud storage or maybe an older system built directly on colossus. idk I don't work with that kind of data.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

hackbunny posted:

as usual, herb sutter to the rescue with a proposal to steal features from other languages (in this case, Swift). incidentally, it also explains the issues with c++ exceptions much better than I have

this is cool and well written and I hope to use it some day.

At work, we heavily use error propagating macros like the paper describes. eg.

RETURN_IF_ERROR(DoFoo()) << "DoFoo() failed handling " << request.DebugString();

as you can see, they also have a relatively convenient way to append debugging detail as an error propagates the layers of the stack between the 'throw' and the 'catch'.

how can/should a programmer add this kind of detail in the exception world of that paper? A try-catch that just appends detail and re-throws sounds unwieldy to me, but that could be because I've been living in an exceptionless world for so long.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
I like bazel a lot

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

ratbert90 posted:

I just learned of the Bazel build system and I am truly and utterly horrified by it.

It requires Java, uses protobufs for configuration, and cross-compiling is a giant lol bag of nope.

Basically, I don't think I will ever get envoyproxy into Buildroot because of it.

it works great inside Google where there are whole teams for managing different toolchains.

also I like it for my personal garbage because it's what I'm used to and I never need to cross compile anything anyway.

What do you mean by the protobuf part though? i've never had to use a protobuf to configure anything

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

ratbert90 posted:

I thought the config files were derived from protobufs?
Also, the documentation sucks and is outdated/often wrong.
BUILD files are hosed up python lol
https://docs.bazel.build/versions/master/skylark/language.html

Yeah I agree the docs are frequently outdated in frustrating ways. It's also changing fast enough right now that a build I set up like 6 months ago straight up doesn't work today because the config language was revised / some syntax was deprecated.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

I'm not familiar with rust, and I feel like I'm missing something. what's the difference between this and like a std::optional<T>? Does this avoid the runtime cost of keeping track of whether there's a value or something?

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
ctps: yesterday I fixed a race condition by reordering members in a c++ class.

initializing the first member started a thread that touched the other members. that thread raced with with the initialization of the other members. solution: make the thread member the last member of the class. C++ is a really dumb language sometimes.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

DuckConference posted:

code:
DoButtStuff(0, 0x1234567, 0x321)
While reviewing the code, I left a comment to ask if they could #define the values somewhere or something instead of calling a function with magic numbers. The next patch set looked something like

code:
DoButtStuff(/*fart=*/ 0, /*butts=*/ 0x1234567, /*foo=*/ 0x321)
I didn't want to argue so I approved it, but I don't like it.

I see/use that comment syntax at work sometimes. It's a clang-tidy linter check iirc. if you write /*fart=*/ and 'fart' isn't the name of that parameter then you'll get warnings/errors. Useful for avoiding passing arguments of the same type in the wrong order and such.

IMO, if callsites aren't readable without those comments, it may be time to refactor. like if the function signature is void(int, int, int, int, int) then nobody is gonna get that right. Also agree that giving those constants names would help in your case.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

this makes more sense in the context that internally google uses a monorepo where 'library version' isn't a concept so nobody at google has any idea how this supposed to work.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
bazel is a really good build system if one of these applies to you:
* You don't depend on any external libraries
* The external libraries you depend on already use bazel.
* You have teams of people maintaining bazel build configs for all your dependencies

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

Spazmo posted:

fuckers were so indoctrinated by borg and blaze and the monorepo and the rest of it that they have no idea how to get anything done without first reinventing those wheels.

this is me and it sucks. every time I start a new fuckaround personal project I spend like two hours setting up the perfectly hermetic reproducible build and thinking about kubernetes and then I log the gently caress off having accomplished nothing of value and never touch it again.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
my recent pet peeve is when a function starts out clean. like it has one or two input parameters and returns a value. nice

later, someone adds another parameter like like "bool do_slightly_different_thing" or "also_do_other_thing." mayyybe this is reasonable.

repeat 1-3 more times. now the function is 10x harder to understand and annoying to refactor because it's called in multiple places for only tangentially related purposes.

is there a pithy phrase for this problem?

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
I work on a product that is implemented in C++. We rarely define new C++ (non-rpc) interfaces. I've kinda groomed our test strategy for "unit tests" to be like:
* Wherever possible, use real implementations.
* When required, use fakes/mocks (generally for the remote services we depends on)
* Rarely mock anything else.

It's going pretty OK for us! Hope this helps

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

pointsofdata posted:

When you see some code you don't like do you:
* Sigh and move on?
* Start up a committee to improve "code standardisation"
* Go and find the authors latest PR and comment on that?
* Write a new Coding Style Guide extolling the obvious superiority of your approach and send it to the whole engineering team?

If I really don't like some code, I'll change it myself and send the code review to the original author with a description like "I think this change has has advantages X, Y, and Z. The behavior is mostly the same except for case W. Am I overlooking anything about the original implementation?"

where xyz are like "reduces complexity", or "improves readability" or "more consistent with the rest of our codebase". Sometimes it's a knowledge-sharing thing like "hey have you seen this new C++20 feature? You can use a ranged-for loop now"

I send this kind of thing pretty often. I like to think I'm helping / mentoring, but I do worry about looking like a code dictator or something.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

abigserve posted:

the future of on-prem is the poo poo like Azure on-prem DC (whatever it's called) where it's literally the Azure product suite, interface, etc, except it's delivered as a big rack you plug into your data centre. AWS has a similar thing too.

how does this work maintenance-wise? like, who debugs / fixes things when something goes wrong with a piece of software running in that big opaque rack? Does an azure eng just remote in whenever necessary and people are OK with that?

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
I'm late for yaml-chat, but every time I've used yaml for anything it's because some other team we have to work with requires it. and every single time it's like

yaml, but one string is named "query" and it's where you put a giant sql query.

or yaml, but with string named "command" and that's where you put a bash script.

etc

and it's like cool, now my ide can't display or properly auto-format this query/script and none of our automated tooling can maintain it, thanks. also the syntax is poo poo and I hate it

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
hermetic - start an environment with whatever changes you want whenever you want. Some dependencies are faked.

Dev - pushed from head hourly.

Staging - promoted from dev daily (if dev tests pass).

Prod - promoted weekly from staging (if staging tests pass).

It's not perfect, but I'm happy. Having entire teams creating release automation systems is one of the nice things about working at a giant company.

Adbot
ADBOT LOVES YOU

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
wish we could just never launch new features. whenever something goes wrong it's always triggered by a customer using an awkward combination of features that never actually got tested because exhaustively testing every feature with every other feature has become infeasible due to the combinatorial explosion of terrible code we wrote

every product should just do one thing, and then never change in any meaningful way, except insofar as it allows me to get paid for refactoring code to be prettier

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply