New around here? Register your SA Forums Account here!

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.

DELETE CASCADE posted:

they should make a malloc that, if it fails due to oom, it asks amazon to give the vm more ram, then tries again

it's called ecs

Adbot
ADBOT LOVES YOU

animist
Aug 28, 2018

DELETE CASCADE posted:

they should make a malloc that, if it fails due to oom, it asks amazon to give the vm more ram, then tries again

there've been "remote memory paging systems" since at least the 90s, because it turns out that copying memory over the network + storing it in the ram of the server next door is still faster than writing a spinning disk, lmao

mostly academic tho. idk if people actually use them

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
it was sorta mindblowing the first time i worked on a system where the network was faster than the disk

Space Whale
Nov 6, 2014

animist posted:

there've been "remote memory paging systems" since at least the 90s, because it turns out that copying memory over the network + storing it in the ram of the server next door is still faster than writing a spinning disk, lmao

mostly academic tho. idk if people actually use them

Ok but
NVME

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Powerful Two-Hander posted:

this is the future that orm developers want

orm developers, no

orm users, probably

floatman
Mar 17, 2009
Why stop there? Why not create a stored proc that would take in, say, the web applications' post request body and parse that to be stored into the correct tables in the database?
We can just use one stored proc for all post scenarios as this will reduce maintenance cost.
Everybody knows that handling everything on the database level is more optimised than code level. BARE METAL IS BETTER.
To make things safer, let's only accept the POST body as an argument into our stored proc once it has been transformed to fit our very own bespoke XML schema.
Oh by the way the stored proc only runs on that version of MSSQL that's going to be EOL soon, but I'm sure it can be easily rewritten in an hour.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

floatman posted:

Why stop there? Why not create a stored proc that would take in, say, the web applications' post request body and parse that to be stored into the correct tables in the database?
We can just use one stored proc for all post scenarios as this will reduce maintenance cost.
Everybody knows that handling everything on the database level is more optimised than code level. BARE METAL IS BETTER.

http://postgrest.org/en/v5.2/

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
https://www.graphile.org/postgraphile/

pseudorandom
Jun 16, 2010



Yam Slacker

HoboMan posted:

guy here likes to inert into the db via stored procedures where there is only one augment which is an xml blob of whatever you are updating/inserting.
it skips having to do an explicit mapping and lets the same proc handle any number of items, but it still feels wrong despite not having anything specific to point to.
what terrible thing am i missing?
or is this fine?

e: the xml blob is automagically parsed and the data properly put in the appropriate columns, not just jammed in the db


Do you accept user input, and if so, have you tried submitting "foo</column><column>bar"?

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
send a bunch of null chars to it and see what happens

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

DELETE CASCADE posted:

they should make a malloc that, if it fails due to oom, it asks amazon to give the vm more ram, then tries again

HoboMan
Nov 4, 2010


hell yeah

Share Bear
Apr 27, 2004

is there a good generalized guide to writing docs that i could provide most high-school level english writing programmers i work with? i know this is a skill that people need to work on to improve

i've been going with saying "who (is this for, made it), what (is it for), how (to build and run it, add features), and why (was this made, what problem does it attempt to solve)"

we've only had how to build and run it up until recently

Zlodo
Nov 24, 2006

Share Bear posted:

is there a good generalized guide to writing docs that i could provide most high-school level english writing programmers i work with? i know this is a skill that people need to work on to improve

i've been going with saying "who (is this for, made it), what (is it for), how (to build and run it, add features), and why (was this made, what problem does it attempt to solve)"

we've only had how to build and run it up until recently

i'd be interested in this too, I want to write more docs but I dont really know where to begin and how to structure it, I just wing it

Schadenboner
Aug 15, 2011

by Shine

Zlodo posted:

i'd be interested in this too, I want to write more docs but I dont really know where to begin and how to structure it, I just wing it

:same:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Zlodo posted:

i'd be interested in this too, I want to write more docs but I dont really know where to begin and how to structure it, I just wing it

i hate my writing more than anything else but i dont know how to change it

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Zlodo posted:

i'd be interested in this too, I want to write more docs but I dont really know where to begin and how to structure it, I just wing it

i usually do a stream of consciousness style thats impossible to follow, and then someone else steps in and rewrites it so i don't have to.

gonadic io
Feb 16, 2011

>>=
i just let somebody attempt to use it while i'm with them, and then i write down all the things as i tell them. if nobody uses it, then no docs no problem

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
if you implemented the system it's near impossible to write good documentation for it, since you've used it so many times you've been doing things that is not the way the user will use it.

HoboMan
Nov 4, 2010

seriously how do i REST?
i never realized how much i never thought about this with my old job's crappy old webforms project.

like there are several screens where we have a list with some bare-bones info and can click on the item to get detail and edit.
what to do for the endpoints?
do i eager-load all the detail data for the basic list?
do i re-use the detail object for the list and just have a bunch of null fields returned from a different endpoint on the controller?
or do i make a separate object and controller?

the last one seems "correct" but it's the most work

HoboMan fucked around with this message at 18:08 on Apr 26, 2019

Aramoro
Jun 1, 2012




Separate object and controller, or service or proxy what ever you want to call it to marshall your REST response into your object. It is the most work but good idea for things beyond the most noddy of projects.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

HoboMan posted:

seriously how do i REST?
i never realized how much i never thought about this with my old job's crappy old webforms project.

like there are several screens where we have a list with some bare-bones info and can click on the item to get detail and edit.
what to do for the endpoints?
do i eager-load all the detail data for the basic list?
do i re-use the detail object for the list and just have a bunch of null fields returned from a different endpoint on the controller?
or do i make a separate object and controller?

the last one seems "correct" but it's the most work

Be a madman and implement the PATCH verb and use json-patch. I've never seen it done correctly, though, except in things like Open Policy Agent.

The hardest part about plain forms is that "null" can be a valid value so sending "don't change" can be hard because you need some other model representation for that poo poo.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

gonadic io posted:

i just let somebody attempt to use it while i'm with them, and then i write down all the things as i tell them. if nobody uses it, then no docs no problem

this plus get people to update the docs (or at least tell you) whenever they get stuck. every first impression is incredibly valuable

also: examples. start with the simplest smallest example that could possibly be useful to anybody. then add a couple more

Aramoro
Jun 1, 2012




CRIP EATIN BREAD posted:

Be a madman and implement the PATCH verb and use json-patch. I've never seen it done correctly, though, except in things like Open Policy Agent.

The hardest part about plain forms is that "null" can be a valid value so sending "don't change" can be hard because you need some other model representation for that poo poo.

We did this, even though a REST api is supposed to be idempotent, because our objects can be huge. You're right the intentionally blanking is the hardest part.

Pie Colony
Dec 8, 2006
I AM SUCH A FUCKUP THAT I CAN'T EVEN POST IN AN E/N THREAD I STARTED

CRIP EATIN BREAD posted:

if you implemented the system it's near impossible to write good documentation for it, since you've used it so many times you've been doing things that is not the way the user will use it.

not really. do you just start implementing a system without giving any thought to how or if the user will use it?

redleader
Aug 18, 2005

Engage according to operational parameters
oh no, another rest bikeshedding opportunity

redleader
Aug 18, 2005

Engage according to operational parameters
ask 10 programmers about implementing a RESTish api and you'll get back 11 opinions

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Pie Colony posted:

not really. do you just start implementing a system without giving any thought to how or if the user will use it?

no, but once you've been knee deep in it for a long time you start doing things differently.

but honestly i just dont give a poo poo about writing documentation thast some other turd's responsibility

Powerful Two-Hander
Mar 9, 2004

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


HoboMan posted:

seriously how do i REST?
i never realized how much i never thought about this with my old job's crappy old webforms project.

like there are several screens where we have a list with some bare-bones info and can click on the item to get detail and edit.
what to do for the endpoints?
do i eager-load all the detail data for the basic list?
do i re-use the detail object for the list and just have a bunch of null fields returned from a different endpoint on the controller?
or do i make a separate object and controller?

the last one seems "correct" but it's the most work

do the last one or you are cursing yourself for later

or maybe create a base object for view and extend for edit but you'll probably hit a wall at some point later with that if the objects are complex enough

alternative that I do not recommend (but have sort of done) put every single property into its own getter so you can lazy load from the db if you need it later but only do this if you have like 3 properties or you hate your database

akadajet
Sep 14, 2003

redleader posted:

ask tef about implementing a RESTish api and you'll waste 11 hours

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
write aspirational documentation at the start of implementation, outlining the ways in which you want your product to be usable

that way the people actually using your product later get to figure out for themselves all the ways in which you fell short of your goals

pseudorandom
Jun 16, 2010



Yam Slacker

Share Bear posted:

is there a good generalized guide to writing docs that i could provide most high-school level english writing programmers i work with? i know this is a skill that people need to work on to improve

i've been going with saying "who (is this for, made it), what (is it for), how (to build and run it, add features), and why (was this made, what problem does it attempt to solve)"

we've only had how to build and run it up until recently


Most of what I write ends up being:

CRIP EATIN BREAD posted:

stream of consciousness style thats impossible to follow

But, that's still better than nothing.

One big emphasis I'd make is that if there were any points where you struggled or spent a non-trivial amount of time thinking about how to implement something, then you should somehow summarize the problem and some of the reasoning at lead to the implemented solution.

Depending on the type of documentation, a good expansion on the above suggestion is: if you took an answer from stack overflow (or other online resource), explain the problem you encountered, then include a link to the SO answer.

This is just brain storming, but for teaching others, a nice exercise might be something like having them attempt to document another peer's code, or to try to explain another peer's code after reading the other's documentations. Or, depending on how long the course has lasted, just give them some of their own code from earlier in the course and see if they can remember what the gently caress they were thinking, then see if they can think of some notes that would have helped guide themselves when re-reading their own code.

Documentation is about making the life of a developer easier, be it you, a coworker, a stranger looking at open source work, someone reviewing a PR, etc. It should be the calm, helpful narrator guiding you through a cryptic landscape. It need not be perfect, but it should provide enough additional context that the combination of it, plus the thing being documented, helps a reader understand why a thing was written as it was and/or what that thing does.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



reason no. 10004 i am a terrible programmer:

i keep putting off writing utility functions because i dont think i will have a need for them until ive written the same goddamn thing a billion times and now that i did write the utility function, i have to replace everything in a hundred files

gonadic io
Feb 16, 2011

>>=

Krankenstyle posted:

reason no. 10004 i am a terrible programmer:

i keep putting off writing utility functions because i dont think i will have a need for them until ive written the same goddamn thing a billion times and now that i did write the utility function, i have to replace everything in a hundred files

it's a classic

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



gonadic io posted:

it's a classic

and the files are latex :shepicide:

gonadic io
Feb 16, 2011

>>=

Krankenstyle posted:

and the files are latex :shepicide:

I hear Belize is nice this time of year

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



im already packing

Powerful Two-Hander
Mar 9, 2004

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


Krankenstyle posted:

reason no. 10004 i am a terrible programmer:

i keep putting off writing utility functions because i dont think i will have a need for them until ive written the same goddamn thing a billion times and now that i did write the utility function, i have to replace everything in a hundred files

next level: write the utility functions then forget you did and write another set again later

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



on it, chief

Adbot
ADBOT LOVES YOU

NihilCredo
Jun 6, 2011

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

Powerful Two-Hander posted:

next level: write the utility functions then forget you did and write another set again later

im at the "it would be really nice to have a utility function that does X, let's go write it. *writes function* 'Error 42069: you already wrote this function two years ago, dumbass'" level

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