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
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

my homie dhall posted:

Im not sure I buy that theres a significant difference between APIs for interactive vs non-interactive applications as its not like the user is interacting directly with the API. presumably you own the frontend and thus you own the way the frontend interacts with the backend.

an example of an interactive use is html responses, with links and forms, rendered by a browser. the user is literally interacting with the api

an example of a non-interactive use is pulling hardcoded keys out of json responses at hardcoded urls

(if that was already clear and you maintain what you say, then fair enough!)

Adbot
ADBOT LOVES YOU

FamDav
Mar 29, 2008
the reason why the client specifies their schema came to be in the first place was to effectively manage what clients were actually using in the first place so you could know what could be changed or removed. you could build this into anything

then you get the and lets use this to give clients deep control over how they query the backend part and oops its actually bad

ikanreed
Sep 25, 2009

I honestly I have no idea who cannibal[SIC] is and I do not know why I should know.

syq dude, just syq!
Clients exist to give me money, not to tell me what to make

mystes
May 31, 2006

ikanreed posted:

Clients exist to give me money, not to tell me what to make
Counterpoint: you can tell me to make whatever you want as long as it's money

zokie
Feb 13, 2006

Out of many, Sweden
in 10 years of developing I have yet to encounter a rest api that is much more than http endpoints for sql tables. and that is poo poo for making a frontend app.

GraphQL has allowed me to force backend developers to provide data in a form that much better represents our business objects. and as stated before, it gets rid of so much promise-bullshit and juggling multiple requests that it allows me to move much much faster. currently we have a Java backend being the GraphQL server and it works great, at my last job we set up a nodejs GraphQL BFF that us frontend developers maintained and doing that was so much better than what wed been doing before.

if I had to go somewhere with out GraphQL and do frontend stuff Id setup a BFF day 1.

(it really shines with typescript and generated types from the schema)

MrMoo
Sep 14, 2000

If you DB tables are not matching business entities, then you may want to just rethink the DB? Or, idk, learn to use a view? GraphQL doesn't add anything other than magical random latencies, and sad attempts to limit that.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


I mean, if "front end developers" would stop insisting on using idiot platforms and just used the MVC pattern then you wouldn't have this problem. My database represent s my models, my view renders them and my controller routes requests between them. you get consistency and binding and you can even pretend you're using a rest API because you can serialise or deserialise from/to your model

'emit event', 'update DOM' they have played us for absolute fools

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Powerful Two-Hander posted:

I mean, if "front end developers" would stop insisting on using idiot platforms and just used the MVC pattern then you wouldn't have this problem. My database represent s my models, my view renders them and my controller routes requests between them. you get consistency and binding and you can even pretend you're using a rest API because you can serialise or deserialise from/to your model

'emit event', 'update DOM' they have played us for absolute fools

i also agree django is the best web framework

ikanreed
Sep 25, 2009

I honestly I have no idea who cannibal[SIC] is and I do not know why I should know.

syq dude, just syq!

zokie posted:

in 10 years of developing I have yet to encounter a rest api that is much more than http endpoints for sql tables. and that is poo poo for making a frontend app.

GraphQL has allowed me to force backend developers to provide data in a form that much better represents our business objects. and as stated before, it gets rid of so much promise-bullshit and juggling multiple requests that it allows me to move much much faster. currently we have a Java backend being the GraphQL server and it works great, at my last job we set up a nodejs GraphQL BFF that us frontend developers maintained and doing that was so much better than what we’d been doing before.

if I had to go somewhere with out GraphQL and do frontend stuff I’d setup a BFF day 1.

(it really shines with typescript and generated types from the schema)

The trick is I'm too lazy to find a DBC that works with my client application framework, so gently caress you and give me my shallow maintenance headache wrapper.

cool av
Mar 2, 2013

zokie posted:

in 10 years of developing I have yet to encounter a rest api that is much more than http endpoints for sql tables. and that is poo poo for making a frontend app.

GraphQL has allowed me to force backend developers to provide data in a form that much better represents our business objects. and as stated before, it gets rid of so much promise-bullshit and juggling multiple requests that it allows me to move much much faster. currently we have a Java backend being the GraphQL server and it works great, at my last job we set up a nodejs GraphQL BFF that us frontend developers maintained and doing that was so much better than what wed been doing before.

if I had to go somewhere with out GraphQL and do frontend stuff Id setup a BFF day 1.

(it really shines with typescript and generated types from the schema)

This is what I don't get. What about graphQL "forced backend developers to provide data in a form that better represents business objects"? GraphQL doesn't have any features that do that, but maybe you used "GraphQL" to mean "actually thinking about the API design" which I feel like a lot of my coworkers do too.

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
stack up the joins to stack up the figgies

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
90% response time: 3.5 figgies

zokie
Feb 13, 2006

Out of many, Sweden

cool av posted:

This is what I don't get. What about graphQL "forced backend developers to provide data in a form that better represents business objects"? GraphQL doesn't have any features that do that, but maybe you used "GraphQL" to mean "actually thinking about the API design" which I feel like a lot of my coworkers do too.

when I started here they were using GraphQL but the schema made me wanna puke. I made my own version and then booked a meeting with all the developers were I showed them both versions in a visualizer theirs barely looked like a graph at all.

then I showed them how I could use code generation to get types and with those types I could develop against mocked data using storybooks so we could decouple a lot of frontend and backend development while still feeling safe

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

zokie posted:

when I started here they were using GraphQL but the schema made me wanna puke. I made my own version and then booked a meeting with all the developers were I showed them both versions in a visualizer theirs barely looked like a graph at all.

then I showed them how I could use code generation to get types and with those types I could develop against mocked data using storybooks so we could decouple a lot of frontend and backend development while still feeling safe

and then they stood and clapped?

(I hope, that sounds pretty cool)

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

floatman posted:

I don't know about graphql.
I mean, yeah "the client only gets what it wants to get" which is great if you're only the client. It feels efficient for the client but in the end the backend is just some badly cobbled clownshite and you're still retrieving all your table via your "backend" ORM and dumping all the extra data and viola "the client only gets what it wants".
Like it's all "graphql is great because there's no versioning" but yeah in the end it's only great if you're looking at it from a client only side. What usually happens is you gotta update the client, update the backend for new stuff, then update the graphql layer as well, and it's basically about the same work as rest, except that due to the "the client only gets what they want" you can end up with people using your graphql layer in really bad combinations which leads us to the part that ultimately graphql abstracts away the consequences of the backend and you think you're doing an efficient thing but your graphql layer is node hell and hammering your db because of bad implementation.

In my experience graphql is a technical solution to a social problem. That's not always a bad thing, but often it just papers over a lot of other dysfunctions.

Zaxxon fucked around with this message at 06:59 on Aug 30, 2021

distortion park
Apr 25, 2011


We did some developer experience research and none of the devs we spoke to preferred consuming graphql APIs over a "rest" one with an openapi spec. (I say "rest" because other than like html web pages I'm not sure anything does it as originally intended)

Since neither the consumers nor the people building it (us) wanted graphql we decided not to use it.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Zaxxon posted:

In my experience graphql is a technical solution to a social problem. That's not always a bad thing, but often it just papers over a lot of other dysfunctions.

Yeah, "a technical solution to a social problem" is a bit of a thought-terminating clich, but there are times when a social solution is legitimately not possible.

Someone brought up the example of a Github-scale public API and it's a great one, are you going to establish healthy working relationships with thousands of podunk IT companies all over the world? Not going to happen, but pouring thousands of engineer man-hours into locking down and performance-tuning a set of graphgql specs, while challenging, is at least doable.

cinci zoo sniper
Mar 15, 2013




i feel like im missing something extremely obvious. say im setting up dynamic jobs for 500 tables with pyspark for a remote cluster. does poo poo like managed big cloud spark clusters expect me to generate 500 text files with python scripts and submit them to the cluster instance i rent? that seems to be the preferred option, but isnt this complete degeneracy?

cinci zoo sniper
Mar 15, 2013




wait no never mind, im the op of this thread. i just need to specify the correct cluster type to remote into it like a normal person. gently caress all the technical writers involved in the documentation i saw though

Achmed Jones
Oct 16, 2004



cinci zoo sniper posted:

but isnt this complete degeneracy?

new thread title

Corla Plankun
May 8, 2007

improve the lives of everyone

Achmed Jones posted:

new thread title

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Achmed Jones posted:

new thread title

raminasi
Jan 25, 2005

a last drink with no ice
lol i spoke too soon re: soap, i'm trying to set up another service consumer and this time it's not working and the error message is pretty much "go gently caress yourself"

cool av
Mar 2, 2013

you dropped the soap

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

raminasi posted:

lol i spoke too soon re: soap, i'm trying to set up another service consumer and this time it's not working and the error message is pretty much "go gently caress yourself"

yeah that's pretty much the soap experience. really wonderful when it works and a nightmare when it doesn't.

Share Bear
Apr 27, 2004

my only experience with graphql is through working with zuck's fascist gently caress and suck directly and if that's what you all want instead of openAPI docs go nuts

emblematic of like
code:
response: 200
body: {"error":"500 internal server error"}
as a good thing

Achmed Jones
Oct 16, 2004



wtf share bear nms that poo poo

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Share Bear posted:


code:
response: 200
body: {"error":"500 internal server error"}
as a good thing

lmao, task failed successfully

Ocean of Milk
Jun 25, 2018

oh yeah

Kernel Sanders posted:

has anyone here used onion/hexagonal/“clean”[1] architecture? at face value it makes a lot of sense and coupled with the mediator pattern makes for easy writing of very small and focused chunks of code which are easily testable.

[1] I love how “uncle” bob just up and slapped a name on something existing and usurped ownership of it

We're in a tech migration project large parts of which is copy+pasting quite a bit of java code into a new codebase and one of the parts where we go beyond c+p is decoupling things into onion style adapters that are only allowed to communicate via the domain/core/thing-in-the-middle. I guess it's more elegant than before, and it should assist us to change/re-think the DB schema in the future without touching the core (persistence is one adapter), which is one of the things we might want to do. Ofc the interfaces in the domain need to be well tested for this cause that's how you actually ensure the contract does not get broken.
Our senior (I'm noob) gets all giddy like "we could switch our messaging from JMS to Kafka with little new effort" when obviously that's never gonna happen.
If you're in java, use ArchUnitTest. It allows you to specify a unit test that fails when you violate your architectural pattern. Pretty cool, at this point I think this whole architecture thing is worthless without some thing slapping you when you ignore it.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

CarForumPoster posted:

lmao, task failed successfully

deranged

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


today i was trying to work out why some log messages were getting mixed together line-by-line in 20yo common code. was expecting to find that there were no mutexes or other synch and i'd have to add it, ho hum

turns out, there is a mutex, but... well
C++ code:
void writeString(string str) {
  for (int i=0; i<str.len(); ++i) {
    mutex.Lock();
    writeChar(str[i]);
    mutex.Unlock();
  }
}
:shepface:

mystes
May 31, 2006

Needs a comment like
//Release mutex for each character for performance

FlapYoJacks
Feb 12, 2009

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ocean of Milk posted:

Our senior (I'm noob) gets all giddy like "we could switch our messaging from JMS to Kafka with little new effort" when obviously that's never gonna happen.

I have no experience with either but I'm gonna guess that either the non-code-related bits will be far more relevant to the success of that transition, or it's completely irrelevant in which case that transition will never happen (as you suspect)

Ciaphas posted:

today i was trying to work out why some log messages were getting mixed together line-by-line in 20yo common code. was expecting to find that there were no mutexes or other synch and i'd have to add it, ho hum

turns out, there is a mutex, but... well
C++ code:
void writeString(string str) {
  for (int i=0; i<str.len(); ++i) {
    mutex.Lock();
    writeChar(str[i]);
    mutex.Unlock();
  }
}
:shepface:

amazing

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

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
i've avoided using many technologies simply due to their yaml configuration format

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


we solved that issue in our gitlab by having the yml file call a shell script that it fetched with git

MrQueasy
Nov 15, 2005

Probiot-ICK

duz posted:

we solved that issue in our gitlab by having the yml file call a shell script that it fetched with git

I dont know if this is better or worse than having to write the shell script as yaml array elements

Qtotonibudinibudet
Nov 7, 2011



Omich poluyobok, skazhi ty narkoman? ya prosto tozhe gde to tam zhivu, mogli by vmeste uyobyvat' narkotiki

Share Bear posted:


code:
response: 200
body: {"error":"500 internal server error"}

trying to black box analyze failures in the salesforce webapp is so incredibly annoying because all their poo poo is like this and there are TONS of requests

then even if you do find the one that failed its stupid JSON body doesn't actually provide any useful information, it's just like "error: ref code klgjldfgdgdfgdlj" that you have to have some admin go and look up in the log that actually contains useful info

this is extremely nonsense for an application designed around allowing middle management types to write their own mini-applications in (or rather, contract out writing their applications at obscene rates) with the end result being that everything is extremely brittle and error-prone

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

Illusive gently caress Man posted:

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

get a better ide

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