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
jesus WEP
Oct 17, 2004


here’s a go tutorial for you: go get a new job

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 15, 2013




insane snipe energy

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

cinci zoo sniper posted:

insane snipe energy

Xarn
Jun 26, 2015
Probation
Can't post for 21 hours!

cinci zoo sniper posted:

insane snipe energy

cool av
Mar 2, 2013

Private Speech posted:

I actually find the first easier to read than the second

then again I also really don't like filter at al, at least unless it's genuine filtering rather than some chained transform monstrosity

I don't mind lambdas and for_each though

what the heck, for_each is the one not to like

Captain Foo
May 11, 2004

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

cinci zoo sniper posted:

insane snipe energy

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

jesus WEP posted:

here’s a go tutorial for you: go get a new job

new title?

cinci zoo sniper
Mar 15, 2013




if it fits im all for it

vanity slug
Jul 20, 2010

cinci zoo sniper posted:

insane snipe energy

Zlodo
Nov 25, 2006

cinci zoo sniper posted:

insane snipe energy

Shaggar
Apr 26, 2006

NihilCredo posted:

sql is a bit of a tragedy because the "runtimes" are so freaking good but it's impossible to fix the relatively minor design flaws in its frontend

type coercion, pervasive nulls, no null vs undefined distinction, clunky and limited "variables" (ctes and temp tables)... any other language with such wide adoption would have since sprouted a runtime-compatible with those frontend flaws fixed. java -> kotlin, js -> ts, erlang -> elixir etc.

every few years somebody tries to make sql 2.0 that compiles to sql and it never catches on because compiling to a language that is almost fully declarative and only barely standardized is leaky as hell, and also its flaws aren't so bad for 95% of its use cases (basically any program under 200 lines or so)

for the most part i think sql is fine and i wouldnt really change much. nulls are a sign of bad data or bad data design which cant be fixed by language.

on the other hand, ansi nulls are objectively wrong and microsoft should have punted on implementing them at all in sql server.

Truman Peyote
Oct 11, 2006



Xarn posted:

Apparently I get to maintain a bunch of Go code, because the teams using our library from Go cannot be trusted to do the sane thing and write common utility functions once, so there are now 4 subtly different versions of conceptually same code between different go projects.

What is a good Go tutorial?

besides the snipe, the "tour of go" on the official golang web site is actually a great introduction

Presto
Nov 22, 2002

Keep calm and Harry on.

Arcsech posted:

these functions that are semantically clearer than looping
That's what you think, mister. :colbert:

Presto
Nov 22, 2002

Keep calm and Harry on.

Sagacity posted:

golang user spotted
Never touched it.

NihilCredo
Jun 6, 2011

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

Shaggar posted:

for the most part i think sql is fine and i wouldnt really change much. nulls are a sign of bad data or bad data design which cant be fixed by language.

on the other hand, ansi nulls are objectively wrong and microsoft should have punted on implementing them at all in sql server.

both your complains derive from the same flaw, the conflation of 'undefined' nulls (from missing outer joins) and 'null' nulls (to represent nonexisting values, which is a legitimate data design, it just shouldn't be the default)

ansi nulls are correct for the former, because you don't want 'a.foo = b.foo' to return true when there is no match in either a or b

imagine if LEFT JOIN returned 'undefined' instead of 'null' when the condition failed, and the special rules only applied to undefined. now if you filter for 'a.foo = b.foo' you get:

- if there's no record in either a or b => false
- if there's a record in both a and b, but both columns are intentionally null => true

which is what you would expect

Carthag Tuek
Oct 15, 2005

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



i dont like that you have to use is for null, its annoying

PIZZA.BAT
Nov 12, 2016


:cheers:


oh advent of code doesn't show anywhere how many attempts it's taken you to solve the problem? this is bullshit. how am i supposed to brag??

mystes
May 31, 2006

PIZZA.BAT posted:

oh advent of code doesn't show anywhere how many attempts it's taken you to solve the problem? this is bullshit. how am i supposed to brag??
You probably realize this but if you want to go down the dumb rabbit hole of actually doing AoC as a competition there's a leaderboard for the first people who finish and you have to solve the problem by like 12:00:00.0001 every night if you want to get on it...

mystes fucked around with this message at 17:58 on Dec 3, 2021

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


mystes posted:

You probably realize this but if you want to go down the dumb rabbit hole of actually doing AoC as a competition there's a leaderboard for the first people who finish and you have to solve the problem by like 12:00:00.0001 every night if you want to get on it...

Humans will always optimize the fun out of anything

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
default behavior of multiple args to "for" in lisp is cartesian product of sequences and you gotta use the loopin dsl to gently caress w things in less circuitous way and its pissing me off

cinci zoo sniper
Mar 15, 2013




Carthag Tuek posted:

i dont like that you have to use is for null, its annoying

imo it’s one of the redeeming features of the null, as my personal preference would be to have N/A (“undefined”) and NULL (“void”) separately. but i also had to supervise a dozen non-technical sql query authors for a few years, so ive seen bad and then some

Carthag Tuek
Oct 15, 2005

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



cinci zoo sniper posted:

imo it’s one of the redeeming features of the null, as my personal preference would be to have N/A (“undefined”) and NULL (“void”) separately. but i also had to supervise a dozen non-technical sql query authors for a few years, so ive seen bad and then some

tbh its a small annoyance, i think i just dont get why it has to be that way

null is a keyword right? is there a case where "select * from table where x = null" shouldn't produce the same results as "select * from table where x is null"?

MrQueasy
Nov 15, 2005

Probiot-ICK

Carthag Tuek posted:

tbh its a small annoyance, i think i just dont get why it has to be that way

null is a keyword right? is there a case where "select * from table where x = null" shouldn't produce the same results as "select * from table where x is null"?

null has no value, therefore null == null is false.

Carthag Tuek
Oct 15, 2005

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



MrQueasy posted:

null has no value, therefore null == null is false.

i know it makes logical sense, but is there a scenario where it makes practical sense is what im asking

like i always have to work around it, i cant think of a db structure where null did not equal null (for the same column type)

Corla Plankun
May 8, 2007

improve the lives of everyone

Carthag Tuek posted:

tbh its a small annoyance, i think i just dont get why it has to be that way

null is a keyword right? is there a case where "select * from table where x = null" shouldn't produce the same results as "select * from table where x is null"?

i think the issues arise when you're doing the opposite of your examples; i.e. just going about your day joining existing (hopefully but not necessarily) non-null things to other things. If null=null then if you have nulls in the join columns on both sides they explode in a really gross and bad way

Corla Plankun
May 8, 2007

improve the lives of everyone
i tried to think up an example but the timer went off for my quiches so that exercise is left to the reader

distortion park
Apr 25, 2011


I love SQL but for the sake of new people I'd love it if the order of statements was changed and select went at the end

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
the good thing about sql is that it uasnt fundamentally changed in 50 years cuz problem didnt change

the bad thing is not composable. fix w query gen imo

Carthag Tuek
Oct 15, 2005

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



pointsofdata posted:

I love SQL but for the sake of new people I'd love it if the order of statements was changed and select went at the end

yeah tbh im not a fan of delete & update without a clause just going ahead. id like if you had to go "yes everything" in the statement

at least as a config option

NihilCredo
Jun 6, 2011

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

Carthag Tuek posted:

i know it makes logical sense, but is there a scenario where it makes practical sense is what im asking

like i always have to work around it, i cant think of a db structure where null did not equal null (for the same column type)

NihilCredo posted:

ansi nulls are correct for the former, because you don't want 'a.foo = b.foo' to return true when there is no match in either a or b

Carthag Tuek
Oct 15, 2005

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




maybe if your data isnt poo poo, that wont be a prroblem?

im too buzzed to think of an example where i dont want null = null

can you do :iiaca:

MrQueasy
Nov 15, 2005

Probiot-ICK

Carthag Tuek posted:

maybe if your data isnt poo poo, that wont be a prroblem?

im too buzzed to think of an example where i dont want null = null

can you do :iiaca:

it's less null == null and more null <> null and null < null.

Carthag Tuek
Oct 15, 2005

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



MrQueasy posted:

it's less null == null and more null <> null and null < null.

yeah those make sense

i guess i just want an option where = includes null

y know for my bespoke queries that i spend a lot of time on making sure wont gently caress me, but i also dont want to spend the time typing is instead of =

give me a footgun pls

cinci zoo sniper
Mar 15, 2013




Carthag Tuek posted:

maybe if your data isnt poo poo, that wont be a prroblem?

yeah if you’re unemployed and have no real world data at all it’s not a problem

Carthag Tuek
Oct 15, 2005

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



cinci zoo sniper posted:

yeah if you’re unemployed and have no real world data at all it’s not a problem

just gimme write on prod, whats the worst that could happen?

Powerful Two-Hander
Mar 10, 2004

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


Carthag Tuek posted:

just gimme write on prod, whats the worst that could happen?

I had write access on prod when I first joined years and years ago and was young and dumb. all the passwords were the same for everything (username backwards). I remember sitting with a Dev and saying "there's a missing criteria on this join that's why this stuff fails" and him going "this here? *F5* fixed" and thinking "oh cool we can do that?"

I only hosed up once and deleted some minor historic export table which I then manually restored before anyone noticed (nobody cared anyway), that was a scary enough experience I was glad it happened with something minor.

pretty sure I was still cowboying in updates/inserts in like 2011 before anyone started actually looking at what we were doing. Now it's all controlled but the people applying the controls know gently caress all about what were doing so really have no idea if we're just writing a messed up delete statement and wrecking poo poo.

DELETE CASCADE
Oct 25, 2017

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

NihilCredo posted:

no null vs undefined distinction

only a javascript programmer could possibly think this is something you'd WANT to have

DELETE CASCADE
Oct 25, 2017

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

Carthag Tuek posted:

yeah those make sense

i guess i just want an option where = includes null

y know for my bespoke queries that i spend a lot of time on making sure wont gently caress me, but i also dont want to spend the time typing is instead of =

give me a footgun pls

instead of "=" you can write "is not distinct from" and get the behavior you want

Carthag Tuek
Oct 15, 2005

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



this post was in the chamber so im posting it:



(i actually do have write in prod now, but also its a 20 year old db that moves fairly slow so even a weeks loss is less than 1k insert/updates)

one time 15 years ago, i got full access immediately, cause this guy i never met vouched for me*. i hosed up a lot with that db... but the good thing is that the system itself was brittle as gently caress and there was no logging and nobody got hurt except multinationals

* i was doing 1st line support & he had my email from talking about the file format from a 90s game online. idk** why he just quit, but he reached out and i apprenticed for a bit and took over his job. then he went to work for spies or something

** the bosses were garbage. very cargo cult startup energy :barf:

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 15, 2013




DELETE CASCADE posted:

only a javascript programmer could possibly think this is something you'd WANT to have

when i was working on data quality management topics a few jobs ago, i ended up standardising everything around 3 types of nulls - “this is not possible”, “explicitly void”, and “other”

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