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
Chalks
Sep 30, 2009

c tp s: Pushed a new set of builds to QA at the end of the day, first thing reported was if you submit multiple requests at once it hangs the entire enviroment - every database, every request to every server.

lol what have we done oh well time to go home

Adbot
ADBOT LOVES YOU

Chalks
Sep 30, 2009

Deep Dish Fuckfest posted:

well bright side is if you're deadlocking your db with incomplete transactions or whatever that means you should be immune to someone accidentally dropping your prod db like that other guy

That would be a pretty straight forward explanation, but since it's affecting multiple separate databases I'm thinking it's more like the ghost of Sybase is coming to punish us further for using their lovely database engine. It already has a habit of exploding with errors like "Unable to access page (null)" which blows up the entire service and takes down every database running on it. Rebuild the database as much as you want, poo poo just keeps happening.

Although everything locking up (can't even log into any of the databases) is a new one.

Chalks
Sep 30, 2009

code:
if (
	bar
) 
{
	/* oh yeahhhhh */
}

Chalks
Sep 30, 2009

Boiled Water posted:

but now you have a visual basic program to maintain

I mean you're writing software for windows 95 so I guess you're past the point of worrying about things like that.

Chalks
Sep 30, 2009

Powerful Two-Hander posted:

this is how terrible I am: when you open any script file in our solution vs will barf a load of warnings of "==, I think you mean ===" and I ignore them all

carry on then posted:

i've got this but with "use single quote not double quote" in typescript.

tslint autoFixOnSave is the setting you've been waiting for.

Chalks
Sep 30, 2009

code:
10.20 * 100
1019.9999999999999
Thanks javascript.

Thavascript

Chalks
Sep 30, 2009

Zlodo posted:

floats are ok as long as you keep in mind that pretty much every single thing you do with them can go horribly wrong

I can see why they'd be the only option in javascript then.

Chalks
Sep 30, 2009

gonadic io posted:

scala status: gently caress you oracle, seriously


That trustarc thing is such garbage, I can't work out if they've intentionally made it slow just to gently caress with people who don't want advertising cookies.

Chalks
Sep 30, 2009

mystes posted:

This doesn't even loving break anything and yet all these crazy people are getting upset that python isn't going to use the word slave any more.

I understand the removal of slave I guess but removing "master" seems pretty silly. That use of terminology isn't even IT specific.

Chalks
Sep 30, 2009

necrotic posted:

primary/secondary is a fine replacement for master/slave imo

parent/child seems to fit better in the cpython case though, or anything related to forking

Depends on the context, master is good for a bunch of stuff. Slave has always been clumsy terminology IMO

Chalks
Sep 30, 2009

Shaggar posted:

master/slave isn't even that good for most scenarios.

active/active active/passive active/readonly, etc... are better for like dbs and load balancing or stuff w/ peers

parent/child is good for something with hierarchy like processes, markup, or layout.

Master works well for stuff like master passwords, or a master database containing access information for a bunch of other databases. It implies one system is in control of others to some degree, but isn't necessarily interchangeable or the origin of those systems.

Slave implies that a system not only provides a service to another, but is also incapable of providing services to any other system besides the one specifically assigned as its master. I struggle to think of scenarios where that's a good fit.

Chalks
Sep 30, 2009

You just need to drag and drop the exe into a word document then double click on it to execute it via the OLE container. Easy peasy.

Chalks
Sep 30, 2009

Yeah, milliseconds is the way to go, very few time representations deal with sub millisecond precision.

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.

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.

Chalks
Sep 30, 2009

MononcQc posted:

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.



In my case it is a website, and since my developers both write and consume the api (primarily) I'm also interested in identifying our fuckups on both ends by reporting on 5xx and 4xx errors, so that's part of my motivation. A bunch of 404 errors are a sign that someone's coded something wrong in the client site rather than someone keeps doing searches that return no results.

Chalks
Sep 30, 2009

MononcQc posted:

yeah, though trying to create a user that already exists, by that map, should yield a 409 Conflict response telling you the resource you're attempting to create is already there.

We would for a primary key conflict, but if our customers try to type the same email address into two contacts it's not a programming issue and the consuming system should handle it as one of the expected outcomes of the operation. I guess it boils down to what you define an error as. Although there is a problem with what the user tried to do, it's just as valid an outcome as any other from a programming perspective.

It's like returning a 200 code for a search that returns no results. Sure, there was probably a problem with what the user was trying to do, but we really don't care as programmers.

Chalks fucked around with this message at 22:15 on Sep 20, 2018

Chalks
Sep 30, 2009

Kevin Mitnick P.E. posted:

there are two cases i care about

1. it worked
2. it didnt

you want to make that 3 cases

1. it worked
2. it didnt
3. it looks like it worked but actually gently caress you heres an error code in the response

this is wrong

A search that returns no results "worked" just fine. From a user's perspective it didn't but returning a 4xx error code would be really weird. A client is entirely capable of displaying an appropriate message to the user in this case without needing an error code.

This third state always exists.

Chalks
Sep 30, 2009

Kevin Mitnick P.E. posted:

well yes if the search was successful you would get 200. your op "is find everything satisfying the search" and you have shown that nothing does. but some knob suggested that failing to create a user might somehow also be appropriate for a 200. thats a straight up failure and the only thing code cares about whether it is retryable, ie 5xx, or not retryable, ie 4xx.

look this is like the only good thing about rest. HTTP provides a wide variety of response codes so fricking use them. of course also the response body has an error description to show the user. there is no sane justification for returning 2xx from an endpoint when the postcondition isn't satisfied

It depends how you define your endpoint. If the functionality is "create this user or return details of the user if it already exists" it's not an error condition if it already exists. Something can "fail" to do what the user is attempting, without being an error as long as it's an anticipated part of your process flow.

An error condition of "everything is completely fine, we expect this to happen all the time" isn't really an error condition. There was no mistake.

Chalks
Sep 30, 2009

Kevin Mitnick P.E. posted:

i feel like "this endpoint may or may not do anything, have fun" *should* be a bold position to adopt but actually probably everything works like this and i'm just so so so lucky to only have to deal with poo poo like that maybe once a month

As long as it accurately reports the situation and is documented properly this shouldn't be a controversial position.

Take a payments API for example. In every one I've used, if you attempt to take a payment and get a problem like the card being declined, you get a 200 response telling you that the card was declined. It's not an error, cards being declined is a perfectly normal part of payment processing.

Chalks
Sep 30, 2009

Soricidus posted:

yes, but that kind of case isn’t what the other side is talking about

I’m talking about poo poo like getting a 200 if you provide incorrect credentials, which is a textbook loving 401. I’d also accept 403. not 200. and the server still claims it sent you application/json even though the content is the bare text “invalid credentials”

Yeah, sorry, not trying to strawman - 401 for invalid credentials is correct, especially when most API interactions are done via tokens and invalid tokens are a programming issue not a user issue.

Chalks
Sep 30, 2009

brap posted:

tbh I’m disappointed that talk mostly fails to say anything concrete. I’d like to know anything specific about how you manage complexity when writing a web app sans frameworks.

I think in his specific situation he's written something extremely complex that no framework would handle anyway. That makes it easier to justify.

I think the ultimate take away from that talk for me isn't so much "don't use frameworks" as "don't drive yourself mad trying to pick the perfect one and learn everything about it".

Chalks
Sep 30, 2009

c tp s:

code:
update dba.butt join dba.fart on fart."id" = 1 set butt.date1 = fart.date2;

Table '' not found
SQLCODE=-141, ODBC 3 State="42S02"
Line 1, column 1
Ok sure, cool.

Chalks
Sep 30, 2009

anatoliy pltkrvkay posted:

i assume react is probably not any better, but my knowledge of vue is that it turns any js traceback into a giant pile of inscrutable utility loader functions, half of which are anonymous. trying to figure out which levels are poo poo i should care about (our code rather than vue's poo poo) is a painful and tedious process, and the sentiment of our frontend devs is that they have no idea what to pay attention to either.

i do not understand how or why the stack that arguably has the best live debugging tools around has apparently gone out of their way to then make those tools unusable

It's all the reactive stuff, it remaps everything under the hood so that it can trigger redraws appropriately when data changes.

That said, as long as you've got an error handler set up, this sort of thing is only really a problem with errors during the render.

The vue developer tools are reasonably functional as well, worth getting if you don't use them already since they can actually shed light on what the hell is going on under the layers of vue stuff.

Chalks fucked around with this message at 15:45 on Oct 17, 2018

Chalks
Sep 30, 2009

Shaggar posted:

id rather just not write any javascript.

well yeah, wouldn't we all - but if that's not an option, npm + typescript are your best bet at getting javascript to behave like a real programming language.

Chalks
Sep 30, 2009

eschaton posted:

no they don’t, users want mobile apps and some developers and management think they can cheat and make web pages pretend to be mobile apps

People generally don't want to install random poo poo that could just be on a web page.

Chalks
Sep 30, 2009

mystes posted:

Probably both are true? At the very least, if users are going to go through the trouble of installing an app, it better not just be a webview displaying the web page.

Usually when the question of apps comes up, it's because the person involved in the sales process who doesn't know what the gently caress they're talking about has been told that you must have an app and no telling them that a webpage will work just fine will satisfy them.

If you can answer "yes" to the "do you have an app?" question they'll be happy. No requirements for what that app should do or indeed any idea of why they demanded it. Slap the web page into an app, watch as nobody downloads it but still be able to answer yes to the app question during the sales process.

Chalks
Sep 30, 2009

Kevin Mitnick P.E. posted:

discord is basically this though? i remember a discord dev going on about how they got REAL CROSS PLATFORM with react or some poo poo so i assume the discord app on my iphone is more or less the same as osx as windows 10 as in the browser. it works ok in all those places which is what i care about

same as slack. i expect i could use them in iphone safari or desktop firefox but why would id o that when i can install app and have a special taskbar button to be obnoxious on the internet

I assume that adds things like message notifications and game overlays though.

I mean I'm not saying that nobody makes pointless apps that offer no features over the website, or that people download apps for no good reason, but poo poo like push notifications tend to be enough to get people to download apps for things.

Chalks
Sep 30, 2009

quote:

Speak no useless words or words that move to laughter.

:thunk:

Chalks
Sep 30, 2009

Powerful Two-Hander posted:

it's OK as long as you never have to query it

like we store blobs to avoid having to generate them from the db every time but we never try to actually query them

the html this thing is generating is loving mind bending

It is possible to query XML in databases and it's not too syntactically terrible in my experience, but I wouldn't want it going anywhere anything that needs to be fast.

Chalks
Sep 30, 2009

cinci zoo sniper posted:

also im not sure i understand what xml attribute cardinality refers to (language barrier generally), and i concur with posters above that json should have normal number handling, comments, and formal schema support for me to like it

XML has some good features, but on the other hand, CDATA

Chalks
Sep 30, 2009

Main Paineframe posted:

today i discovered an empty value somehow getting read into a variable as "undefined"

no, not undefined. a string whose value was "undefined"

thanks, javascript

js string concatenation does this for some dumb reason. i'd love to know who genuinely wants undefined + "" to result in "undefined".

Chalks
Sep 30, 2009

Doom Mathematic posted:

I'd be more worried that, for example, JSON.stringify(undefined) is undefined, which is not a string, and JSON.stringify([undefined]) is "[null]"??

In that first example, passing undefined to a function is the same as passing no argument, I think, so you're getting undefined because calling JSON.stringify() returns undefined.

The second one is loving stupid and proves javascript is terrible.

Edit: bonus - JSON.parse() throws "Unexpected token u in JSON at position 0" because it's running it on undefined and treats it as a string because javascript motherfuckers!

Chalks fucked around with this message at 14:41 on Nov 7, 2018

Chalks
Sep 30, 2009

pointsofdata posted:

idk if you're joking but this doesn't work with e.g. dst

As long as the front end is always sending you data in UTC or with time zone information attached you're fine, yeah?

Chalks
Sep 30, 2009

eschaton posted:

I’m sure there are many fine JavaScript date & time libraries for the front end dev hahahaha

moment.js works fine, displaying dates on a webpage is a pretty solved problem in 2018

Chalks
Sep 30, 2009

cinci zoo sniper posted:

hold on ill plug you into this skype chat where me a 2 developers are arguing about the real tz on database

It's fine, we're in the UK so we've got 6 months until everyone realises our database server clocks aren't UTC and the panic starts

Chalks
Sep 30, 2009

cinci zoo sniper posted:

then eu will phase out winter or summer time

yeah, but I'm in the UK :suicide:

CRIP EATIN BREAD posted:

i once had to explain to someone why a time without a date didn't make sense to have a timezone and nor did it matter, and it drew out into a long argument

kinda depends on how you're sending timezone information, ISO 8601 uses 08:24:46+03:00 so it doesn't actually matter what day it is because you're specifying the exact offset.

poo poo gets interesting when you only want to show dates and you're intentionally sending midnight as the start of a day, but their timezone means that's actually the previous day so what are you actually going to show on the screen?

spherical planets were a mistake.

Chalks
Sep 30, 2009

sharepoint is a perfect case study in why search boxes are poo poo

Chalks
Sep 30, 2009

AggressivelyStupid posted:

what is the actual use case for SharePoint, because I'm like 90% certain what we're doing isn't it

It's for when you're looking for something specific but would rather find every powerpoint slide that mentioned the topic created by anyone at your company over the last decade.

Adbot
ADBOT LOVES YOU

Chalks
Sep 30, 2009

eschaton posted:

if your HTML doesn’t represent hypertext documents where the semantics are straightforward and the styling is purely an aesthetic matter, then what you’re doing should not involve HTML, you should write a native app

The horse has bolted on this one, it turns out that nobody wants to download a native app any more.

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