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
Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

Shaggar posted:

also related to dbs and .net, why in the gently caress is the .net team still promoting entity framework? Its so loving awful. Is the vs/.net team just totally incompetent when it comes to databases?

same reason vs makes tools for java script: because despite how awful it is, it's still widely used.

Adbot
ADBOT LOVES YOU

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
Entity framework is really bad, and I am surprised to be agreeing with shaggar

(But great if you want to poo poo out a database backed app from scratch that will use the bare minimum of db functionality and will never be maintained) (.net core must serve this use case)

Doom Mathematic
Sep 2, 2008

jit bull transpile posted:

time is probably the most difficult thing there is to represent computationally

...Says the person with a human name.

I mean, I assume.

akadajet
Sep 14, 2003

Shaggar posted:

also related to dbs and .net, why in the gently caress is the .net team still promoting entity framework? Its so loving awful. Is the vs/.net team just totally incompetent when it comes to databases?

lol another team is using EF at my company and I think they've just realized they made a mistake

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

prisoner of waffles posted:

Entity framework is really bad, and I am surprised to be agreeing with shaggar

(But great if you want to poo poo out a database backed app from scratch that will use the bare minimum of db functionality and will never be maintained) (.net core must serve this use case)

I'm currently deploying code to our staging k8s cluster that uses EntityFramework OnModelCreating to create tables. Ostensibly, this will eventually create tables in production and I loving hate it. This is running side-by-side with the liquibase migration process in the same codebase.

Thanks, Russian contractors!

gonadic io
Feb 16, 2011

>>=

Doom Mathematic posted:

...Says the person with a human name.

I mean, I assume.

String

Easy. You can never do anything with the string except display it. That part can be difficult if you have bad Unicode support.

E: although I guess if we're talking from scratch then Unicode is quite hard yeah. I'd still argue that dates and times are harder though

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
come talk about being terrible programmers in discord: https://discord.gg/EYJc6d2

the difference here is that this is actually already a discord that exists that people post in! mostly from coc. it’s good, come chat, we can add general channels and stuff too

Bloody
Mar 3, 2013

no

AggressivelyStupid
Jan 9, 2012

i think we're using PLM software as... a repository for software/firmware builds??.? I want to die

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Doom Mathematic posted:

...Says the person with a human name.

I mean, I assume.

names are easy: "do not, in any circumstance, attempt to normalize, tokenize, sort, or otherwise manipulate names"

names should be a natural key for a record related to a human that is mutable only by the human themselves.

JawnV6
Jul 4, 2004

So hot ...

AggressivelyStupid posted:

i think we're using PLM software as... a repository for software/firmware builds??.? I want to die

lmao

Ms. Twiggy
Sep 9, 2018

Floppy drives should be stylish and fun

jit bull transpile posted:

names are easy: "do not, in any circumstance, attempt to normalize, tokenize, sort, or otherwise manipulate names"

names should be a natural key for a record related to a human that is mutable only by the human themselves.

okay but what about people who died before computers were a thing?

genealogists need software too

CPColin
Sep 9, 2003

Big ol' smile.
That's when Marketing goes, "But how do we make our email blasts start with, 'Hi there, ${firstName}!'???" and we tell them to quit making their loving email blasts touch the database.

AggressivelyStupid
Jan 9, 2012

hm yes let me just find the most recent version of source code on this piece of hardware they want me to debug

hmm it's Part Number 6482-3556-846 revision b

wait what the gently caress

oh no


steps to find the source for a build:
Go to PLM, search for a loving part number

If you find it, you go to the attached files, there's sometimes (but not always!!!) a file helpfully named SourceCodeLocation.txt

Inside this text file (which may or may not exist) is the server, depot, stream, and snapshot for the source code in accurev

how do I make them stop doing this holy gently caress

Shaggar
Apr 26, 2006

Fiedler posted:

the point of splitting into separate projects is to allow different deployment cadences. i'm not talking about entity framework. you can't use a database project in your .NET code.


yes, you actually have to manually move files into the correct project when initially setting things up. the tools aren't magically able to figure out which parts are shared. shared objects, though, work fine and i mentioned the appropriate project structure above.

and no, two logically disjoint applications (by which i mean two applications whose data models are entirely separate, as in no shared database objects) don't belong in the same database. multiple applications that share parts of their data model in the same database is, of course, fine.

of course the models aren't separate. these are applications that share a bunch of the model and then each have related, app specific models that reference the shared model.

They cant be split out because even the app specific stuff references the shared stuff so putting app specific objects into a separate db would eliminate transactional integrity.
Even if you split them apart, you still have the shared objects that may be changed during development for multiple applications so the split doesn't fix anything.

What sucks about the vs db tools is even if you manually separate your application specific objects into their own project, the tools still assume the entire db is part of your project and will attempt to import every single thing in the database every time you do a diff. You then have to manually remove every object you don't want which can be hundreds of objects. The diff tool will also completely lock visual studio for like a minute if you select more than like 20 objects.

JawnV6
Jul 4, 2004

So hot ...

AggressivelyStupid posted:

how do I make them stop doing this holy gently caress

is there a fig leaf of justification like "13485" or is this just home-rolled goofiness

Shaggar
Apr 26, 2006

Fiedler posted:

same reason vs makes tools for java script: because despite how awful it is, it's still widely used.

The visual studio javascript tooling is trash because the language is trash. In current VS js tools are the worst ever because they are litterrally node.js based which is what every other javascript "developer" uses. Microsoft could maybe make good js tools, but they decided not to and its kind of understandable.

EF is entirely Microsoft owned. It litterrally originates with the vs/.net teams. They're including it because they don't understand databases. If they did they'd just stop developing EF and its tooling.

Shaggar
Apr 26, 2006

CPColin posted:

That's when Marketing goes, "But how do we make our email blasts start with, 'Hi there, ${firstName}!'???" and we tell them to quit making their loving email blasts touch the database.

that still works cause you store givenname and surname and maybe a displayname, but they're all for display purposes. You don't make any kind of referential or logical decisions based on their values because they can change at any time.

Doom Mathematic
Sep 2, 2008

jit bull transpile posted:

names are easy: "do not, in any circumstance, attempt to normalize, tokenize, sort, or otherwise manipulate names"

names should be a natural key for a record related to a human that is mutable only by the human themselves.

What about people with multiple different names?

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
EF is extremely good for making the fast food version of a db-backed application

Shaggar
Apr 26, 2006
EF is bad at everything. theres no scenario where it should be used.

AggressivelyStupid
Jan 9, 2012

JawnV6 posted:

is there a fig leaf of justification like "13485" or is this just home-rolled goofiness

I think it's hardware people who have been very confused about how to deal with software and firmware in relation to their hardware and they've been doing this for years and don't know any better

I'm currently in the process of going through the Bill of Materials that contains sub Bills of Materials and downloading all these loving text files in the attachments for the sub-BoMs just so I can find the source code and fix this bug

What I really want to do is find the CEO, turn him upside down, and shake him until money for git(lab/hub) and jira falls out because holy poo poo that would be such a massive improvement

CPColin
Sep 9, 2003

Big ol' smile.

Shaggar posted:

that still works cause you store givenname and surname and maybe a displayname, but they're all for display purposes. You don't make any kind of referential or logical decisions based on their values because they can change at any time.

Congrats, you've just assumed the person has a given name, a surname, and some sort of displayable name.

Bloody
Mar 3, 2013

AggressivelyStupid posted:

hm yes let me just find the most recent version of source code on this piece of hardware they want me to debug

hmm it's Part Number 6482-3556-846 revision b

wait what the gently caress

oh no


steps to find the source for a build:
Go to PLM, search for a loving part number

If you find it, you go to the attached files, there's sometimes (but not always!!!) a file helpfully named SourceCodeLocation.txt

Inside this text file (which may or may not exist) is the server, depot, stream, and snapshot for the source code in accurev

how do I make them stop doing this holy gently caress

hahahahaha what the fuuuuuuck

AggressivelyStupid
Jan 9, 2012

there's a file in the top level bill of materials titled SourceCodeLocation.txt :siren:







It tells you to download the other ones :negative:

JawnV6
Jul 4, 2004

So hot ...

AggressivelyStupid posted:

I think it's hardware people who have been very confused about how to deal with software and firmware in relation to their hardware and they've been doing this for years and don't know any better
ugh that's so much worse

like a PLM can be aware of sw/fw, but have each build or assembly or w/e have a git tag and leave the production of build artifacts out of it

having to use it for SOURCE lookup is... i can't even imagine

AggressivelyStupid
Jan 9, 2012

It's a bunch of EEs and poo poo and like they can do C and know how to design and build hardware and whatnot but uh


There's no testing for software, unless it manually done, there's the aforementioned PLM abuse, they barely use an issue tracker. There will be references to tickets in the SCM and PLM software but clearly they're not linked in any capacity. Builds are done manually, using black magic some batch scripts and a really old version of CodeWarrior to produce SREC files.

I want to unfuck all this but I'm an intern so I'll just take this as a very valuable lesson about asking about their Process in an interview and suffer for the next 4-5 months

e: actually not sure how much CodeWarrior is needed since you apparently use .exes to build???

AggressivelyStupid fucked around with this message at 19:13 on Sep 20, 2018

gonadic io
Feb 16, 2011

>>=

AggressivelyStupid posted:

I want to unfuck all this but I'm an intern so I'll just take this as a very valuable lesson about asking about their Process in an interview and suffer for the next 4-5 months

When you do remember to ask about this, it's also very important to notice if they're saying how their infra IS, or how they want it to be/it nearly will be/it's about to be

Like maybe you get unlucky and arrive just as they are competently effecting improvements

But far more likely its been "about" to get better for 10 years now

gonadic io fucked around with this message at 19:32 on Sep 20, 2018

gonadic io
Feb 16, 2011

>>=
Also ctps we're getting official work-related 10% time tomorrow (as opposed to the unofficial way I spend 10% of my time on the posting thone) and I'm p excited. Going to build a sbt plugin that integrates swagger (openapi) spec files into the build process and constructs a http4s routes object for you.

That way they're forced to be up to date, you don't have to write the code, they're type safe, and you still can choose any middleware/server setup you want since it doesn't do any of that stuff

Swagger-gen only generates server stubs as a one-time thing and there's a swagger-spray plugin which I'm going to crib from but it's incomplete and dead and not http4s

E: also swagger provide parser libraries in java, if I had to parse the files there's no way I'd bother

gonadic io fucked around with this message at 19:33 on Sep 20, 2018

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

Shaggar posted:

of course the models aren't separate. these are applications that share a bunch of the model and then each have related, app specific models that reference the shared model.

They cant be split out because even the app specific stuff references the shared stuff so putting app specific objects into a separate db would eliminate transactional integrity.
Even if you split them apart, you still have the shared objects that may be changed during development for multiple applications so the split doesn't fix anything.

What sucks about the vs db tools is even if you manually separate your application specific objects into their own project, the tools still assume the entire db is part of your project and will attempt to import every single thing in the database every time you do a diff. You then have to manually remove every object you don't want which can be hundreds of objects. The diff tool will also completely lock visual studio for like a minute if you select more than like 20 objects.

yeah so this is why i was talking about database references earlier. you put the shared objects into a sqlproj named shared.sqlproj, the stuff specific to fartApp1 into fartDb1.sqlproj and the stuff specific to fartApp2 into fartDb2.sqlproj. then you just add a database reference from fartDb1.sqlproj to shared.sqlproj, and also a database reference from fartDb2.sqlproj to shared.sqlproj. when adding the database references just select "same database." this tells the vs tools that these database projects are deployed into the same database, and you'll have an option to deploy shared.sqlproj when you're deploying fartApp1.sqlproj or fartApp2.sqlproj

as for schema compare: that perf bug was fixed years ago. also, if you're making changes in the database first and then importing back into your sqlproj then you're doing it backwards and you should stop doing that.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

gonadic io posted:

Also ctps we're getting official work-related 10% time tomorrow (as opposed to the unofficial way I spend 10% of my time on the posting thone) and I'm p excited. Going to build a sbt plugin that integrates swagger (openapi) spec files into the build process and constructs a http4s routes object for you.

That way they're forced to be up to date, you don't have to write the code, they're type safe, and you still can choose any middleware/server setup you want since it doesn't do any of that stuff

Swagger-gen only generates server stubs as a one-time thing and there's a swagger-spray plugin which I'm going to crib from but it's incomplete and dead and not http4s

E: also swagger provide parser libraries in java, if I had to parse the files there's no way I'd bother

lol i had to use two swagger created api docs and they were poop from a butt. probably because they did not know how anything works but the docs had all useful information hidden behind js drawers and all arguments were of type string, because of course they were. and those arguments came with zero explanation what it stood for so i had the greatest time trying to piece together the difference between buttId, subButId, IdButtProject, buttIssuerId, etc!!! also zero information on what kind of errors could happen and what they might mean. gj on returning a http 500 error code in json within a http 200 response idiots

dont do that please

gonadic io
Feb 16, 2011

>>=

karms posted:

lol i had to use two swagger created api docs and they were poop from a butt. probably because they did not know how anything works but the docs had all useful information hidden behind js drawers and all arguments were of type string, because of course they were. and those arguments came with zero explanation what it stood for so i had the greatest time trying to piece together the difference between buttId, subButId, IdButtProject, buttIssuerId, etc!!! also zero information on what kind of errors could happen and what they might mean. gj on returning a http 500 error code in json within a http 200 response idiots

dont do that please

i don't see how that's different from regular hand-made rest apis lol

Chalks
Sep 30, 2009

Apparently whether or not you should return errors as 500 responses or as 200 with error data in the body is a complete mystery to everyone and nobody seems to agree on what you should do.

Personally I prefer 500 responses for unexpected crashes, and 200 with a client data for fuckups that aren't the server's fault - but other people just blanket do one or the other which seems dumb.

gonadic io
Feb 16, 2011

>>=
i prefer to crash the server and then be the only one who knows how to restart it

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Chalks posted:

Apparently whether or not you should return errors as 500 responses or as 200 with error data in the body is a complete mystery to everyone and nobody seems to agree on what you should do.

Personally I prefer 500 responses for unexpected crashes, and 200 with a client data for fuckups that aren't the server's fault - but other people just blanket do one or the other which seems dumb.

400-series is theoretically for requests that fail due to something wrong with the request, which means sure the can user them for application-level errors if you like

The pretension that REST means a clearly-defined means of interaction over http(s) is laughable. It's an architectural style / several different subsets of HTTP functionality that people say you should use at the application level

Shaggar
Apr 26, 2006
yeah rest is stupid, but returning 400s for request errors instead of 200s is correct.

Nomnom Cookie
Aug 30, 2009



200 means everything worked and if you disagree i hate you

MononcQc
May 29, 2007

if you get a 2xx it worked and you can move on
if you get a 4xx you hosed up and unless you fix things you're hosed
if you get a 5xx the server hosed up and you may retry while hoping you got idempotence right

I've seen application/content-types that would do negotiation that way. Rather than using OPTIONS, which few endpoints support, you'd send the message with the new format (application/whatever+some-spec) and if it crashed, rolled it down to an older version until you hit a non-400 answer, then cached the content-type for a period of time before retrying.

Chalks
Sep 30, 2009

But then you have errors like "there's already a user registered with this email address" and things like that. 400 error codes for "you're using the API wrong" are fine, but 400 codes as standard application flow seem wrong to me.

If an application is expected to encounter the problem during normal usage I'd use a 200 response. Everything is fine, tell your user that the thing they wanted didn't happen for reasons.

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

If it's not a website I'd just 4xx with a content body.

The old webmachine diagram is the best way to go around and structure a REST framework for actual resource usage.

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