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.
 
  • Locked thread
Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
hot take: frontend dev is not as legitimate as backend

The further I get from pjarvascript the more legit I am.

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

Mao Zedong Thot
Oct 16, 2008


Finster Dexter posted:

hot take: frontend dev is not as legitimate as backend

The further I get from pjarvascript the more legit I am.

https://twitter.com/steveklabnik/status/783322064497307649

and then the real :goonsay:

https://twitter.com/steveklabnik/status/783323004856045568

Sapozhnik
Jan 2, 2005

Nap Ghost
create table facts (
id text not null,
attr text not null,
val text not null
);

there i fixed all ur database problems

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

tef posted:

just one thing: don't use auto increment, use uuids

why? i'm genuinely curious and i can't recall hearing about that before. or think of any advantages uuids would have off the top of my head

HoboMan
Nov 4, 2010

HoboMan posted:

tef posted:

just one thing: don't use auto increment, use uuids

yeah we got guids for most primary keys (except the tings our last dba built out is all autoincrementing ints since they hated guids because they are annoying to type out)


Finster Dexter posted:

It's worth noting that you if you're using GUID primary keys you should still have an autoincrement clustering key to avoid bonkers fragmentation.

huh?

e: i don't know why that one quote is hosed up. looks like a bug in the forums because it's this: [quote="tef" post="465028358"]

HoboMan fucked around with this message at 16:33 on Oct 6, 2016

AWWNAW
Dec 30, 2008


plangsplaining

FamDav
Mar 29, 2008

Deep Dish Fuckfest posted:

why? i'm genuinely curious and i can't recall hearing about that before. or think of any advantages uuids would have off the top of my head

* don't rely on your database for pkey uniqueness
* keys are unique across tables, databases
* which makes it much simpler to shard across multiple databases
* you can layer (partial) sequencing on them if you really want to

jony neuemonic
Nov 13, 2009


this guy is putting "people are lovely to front end developers" and "there's too much churn in front end" against each other but... both are true??

Shaggar
Apr 26, 2006

HoboMan posted:

yeah we got guids for most primary keys (except the tings our last dba built out is all autoincrementing ints since they hated guids because they are annoying to type out)


huh?

index fragmentation means the index content is spread out across more pages on disk. When sql server needs to read a section of indexes it does it pages at a time so the more fragmented your indexes are the more pages they're on and the more disk sql server has to read.

optimizing index storage for uniqueids is hard because theres a shitload of possible values and they aren't sequential. that means they can fragment your index pretty easily.

on the other hand, sequential auto increment ids are the easiest possible index to predict so they make for totally unfragmented indexes.

So why not always use auto-increment ids? Cause if you're doing active-active replication you can get collisions on the auto incremented values. one solution is to set auto increment ranges and another is to use guids. guids is more scalable from a design standpoint because you don't need to setup auto-increment ranges on every database instance, but the downside is index fragmentation.

However! if your entire index is already in memory this is totally irrelevant! The performance hit is on the initial disk read to get the pages into memory. So the best solution is get more ram and keep everything you can in memory and never go to disk ever.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

HoboMan posted:

e: i don't know why that one quote is hosed up. looks like a bug in the forums because it's this:

that doesn't really tell me why you'd want to use uuids instead of autoincrements, though

not using uuids for clustering indices definitely makes sense to me though: the clustering index determines the physical layout of entries on disk, so just adding things to that table will effectively have you do random inserts all over disk. it also means creating new pages whenever you try to insert something in a full one, leading to more partially full pages all over the place and worse disk usage, instead of the tightly packed full pages you'd get from an autoincrement clustering index

edit: gently caress, beaten by shaggar

Shaggar
Apr 26, 2006
the biggest advantage of guids over auto increment ids is that the guids are going to be unique across database instances

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

FamDav posted:

* don't rely on your database for pkey uniqueness
* keys are unique across tables, databases
* which makes it much simpler to shard across multiple databases
* you can layer (partial) sequencing on them if you really want to

eh, ok, that does make sense. i wasn't really thinking about things beyond the "single machine classic rdbms" realm, i guess

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Mr SuperAwesome posted:

re ide and gitchat just use git at the command line and vim, its p great

i've been trying to learn it for the last few days and i have such a hard time with those really interactive emacs modes. just buffers going everywhere and the buffers i want not being sticky and so on.

i actively trying to get better because i switch between projects frequently and having to switch to a shell in $PROJECT_DIR just for git is getting old

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Shaggar posted:

index fragmentation means the index content is spread out across more pages on disk. When sql server needs to read a section of indexes it does it pages at a time so the more fragmented your indexes are the more pages they're on and the more disk sql server has to read.

optimizing index storage for uniqueids is hard because theres a shitload of possible values and they aren't sequential. that means they can fragment your index pretty easily.

on the other hand, sequential auto increment ids are the easiest possible index to predict so they make for totally unfragmented indexes.

So why not always use auto-increment ids? Cause if you're doing active-active replication you can get collisions on the auto incremented values. one solution is to set auto increment ranges and another is to use guids. guids is more scalable from a design standpoint because you don't need to setup auto-increment ranges on every database instance, but the downside is index fragmentation.

However! if your entire index is already in memory this is totally irrelevant! The performance hit is on the initial disk read to get the pages into memory. So the best solution is get more ram and keep everything you can in memory and never go to disk ever.

Or add a separate autoincrement column that is configured as the clustering index and you get the best of both worlds.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
lol at this loving truth table for javascript holy poo poo

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
lol

quote:

Why would you ever want && and || to give back anything but a boolean? After working with this for a while, though, you will likely realize you would not want it any other way.

For example, suppose you want to initialize something to an initial value, but only if not already set:
code:
if(!someVariable) someVariable = someDefault; 
//or
someVariable = someVariable || someDefault; 

hell yeah i want it another way. i want option types and sensible behavior of logical operators. wtf, our internal training is 100% dedicated to ensuring you drink the koolaid on whatever we use.

Shaggar
Apr 26, 2006
javascript is very very very bad and front end web "developers" are definitely retards you can and should look down upon

AWWNAW
Dec 30, 2008

nope everything is equally good or bad and there are only opinions and some people are really mean

Shaggar
Apr 26, 2006
nope. javascript is objectively bad and front end web "developers" have been promoting it and its bad conventions for like 15 years now

Luigi Thirty
Apr 30, 2006

Emergency confection port.

eschaton posted:

I know a couple people with the Spectrum hardware, people without the GCR model had to do weird things to talk Macs into formatting disks as 720KB MFM with HFS and copy software onto them

of course the cracks for the Spectrum software that let you use it with ROM images were very popular as well

there were also a couple equivalents for Amiga, but I think the Amiga drives could at least read and write Mac disks

yeah and iirc sheepshaver is descended from the Amiga mac emulators

I downloaded the Spectre manual and wow, it was all done by one guy disassembling the macintosh ROM in his basement

Mao Zedong Thot
Oct 16, 2008


Shaggar posted:

nope. javascript is objectively bad and front end web "developers" have been promoting it and its bad conventions for like 15 years now

yeah

If I was in a room with shaggar and javascript and had a gun with one bullet, I'd shoot javascript

close tho

Sapozhnik
Jan 2, 2005

Nap Ghost

dear god

so the de-facto hdl is a php-tier mess of gotchas within gotchas and the entire field is full of tiny bug childs who throw a tantrum at any attempts to make tools whose design isn't actively malevolent

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

LeftistMuslimObama posted:

lol at this loving truth table for javascript holy poo poo

thing is it's not too different from most of the other p-langs

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Finster Dexter posted:

thing is it's not too different from most of the other p-langs

then they deserve all the hate they get. i tolerate and trick myself into enjoying mumps cuz its my job, but any time ive set out to do something and the only library out there to do it has been for python, i spend about 5 minutes before i decide "gently caress it ill roll my own thing in a real language".

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
I think the antipattern of using NULL as false in database design is from idiot php devs that grew up learning that null == 0 == false.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
what the gently caress? how can this be common enough to be deemed an antipattern? what possible reason would you have to do this when there's a boolean type and null is handled differently from every- ah gently caress it why am i trying to make sense of this

VikingofRock
Aug 24, 2008




Arcsech posted:

Itym tcl scripts

Wrote some TCL yesterday. Writing some more today. :whatup:

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Deep Dish Fuckfest posted:

what the gently caress? how can this be common enough to be deemed an antipattern? what possible reason would you have to do this when there's a boolean type and null is handled differently from every- ah gently caress it why am i trying to make sense of this

It's in the SQL Antipatterns and I've seen it a lot in bad database schema quite a lot. I think they get tripped up because in MySQL there was no boolean type, you typically just used tinyint. They added aliases of bool and boolean that were just alias for tinyint. I think MS SQL doesn't have boolean, only bit. So, if you are really terrible and don't know what a BIT is, then there you go.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
I bet a lot of these other antipatterns can be traced to lovely LAMP devs.


Source: My junior dev days were as a LAMP dev. Now I'm a lovely .NET dev.

Shaggar
Apr 26, 2006
bit is displayed as true/false in sql management studio. idk why they didn't call it bool other than dumb consistency with other numeric types.

Shaggar
Apr 26, 2006

Finster Dexter posted:

I bet a lot of these other antipatterns can be traced to lovely LAMP devs.


Source: My junior dev days were as a LAMP dev. Now I'm a lovely .NET dev.

I would hazard a guess that most lamp devs never leave lamp or they go into even worse worlds like node and mongo and ruby.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Shaggar posted:

I would hazard a guess that most lamp devs never leave lamp or they go into even worse worlds like node and mongo and ruby.

I think you are very accurate on this. I was definitely headed down that dark path. I happened to get my first senior dev job and I knew enough about MVC (the design pattern) and enough C# to get through the technical interviews and they hired me for .NET stuff. I will never ever ever go back to LAMP poo poo.

I check in on old php co-workers and it's still the same old poo poo, PHP 5, MySQL, etc.

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
mysql is so bad at everything it does i dont know why anyone uses it anymore

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

CRIP EATIN BREAD posted:

mysql is so bad at everything it does i dont know why anyone uses it anymore

I'm using it because idiot devs 5 years ago didn't know better and now there's that many years of web forms built on top of it. fml

Thankfully some of our platform is on SQL Server, too.

I think anymore, people go to Postgres when they want a FOSS db.

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
postgres is the best foss db

im not really familiar with sql server enough to say one way or another

oracle is objectively the worst

dick traceroute
Feb 24, 2010

Open the pod bay doors, Hal.
Grimey Drawer
Oracle doesn't have a boolean type either (well ok, it does, but only in Pl sql, you can't query with it or store it)


We use char(1) with a t or f

And our ceo used -999999 for 'null number' forever ago and we're stuck with it

Shaggar
Apr 26, 2006

CRIP EATIN BREAD posted:

postgres is the best foss db

im not really familiar with sql server enough to say one way or another

oracle is objectively the worst

sql server is great because the db server is very good but you also get a lot of great add-ins under the license like SSIS which rules hardcore.

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

dick traceroute posted:

Oracle doesn't have a boolean type either (well ok, it does, but only in Pl sql, you can't query with it or store it)


We use char(1) with a t or f

And our ceo used -999999 for 'null number' forever ago and we're stuck with it

:eyepop:

Adbot
ADBOT LOVES YOU

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
only time i ever used sql server was i was brought in as a consultant to "speed up" a database and the devs at the company refused to show me their queries and claimed that i should be able to optimize it by just looking at the schema.

they kept fighting me and i had to keep going to management to tell him that i cant do anything unless i can see what the gently caress they were trying to query.

in the end i finally saw the code/queries and they were doing things like manually locking tables when they didnt need to and running recursive queries accidentally because they hosed up some for loops in code.

i fixed all their problems without changing the schema whatsoever (or adding any indexes) and some devs got in trouble (and probably got the axe)

not sql servers fault, but it left a bad taste in my mouth.

  • Locked thread