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
Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

MononcQc posted:

I wanted to comment on this one thing here.

huh I should've known that pure is a well defined technical term on this context. but hey I learned a thing now. :banjo:

I guess I wanted a way to differentiate the casual fp in python from the real hardcore fp of these languages

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

coffeetable posted:

crossquotin' because of this thread's hardon about ORMs

oh thanks i thought about posting it here too but it is for an istp

MononcQc
May 29, 2007

coffeetable posted:

theoryspergin': only true on balanced trees. trees in general it can be O(n) b/c their height can be O(n)

True. Most key/value data structures in functional programming are based on trees of different branching factors (because that's often pretty much the best you can do in many cases without breaking immutability) and will use balanced trees because otherwise the performance will turn to poo poo. I tend to forget that non-balanced trees are still a thing that is useful sometimes :toot:

We butthurt functional programmers will have different ways to think about things so we think we're super efficient though, so we get excited about amortized performances in pure data structures instead.

weird
Jun 4, 2012

by zen death robot

Symbolic Butt posted:

I guess I wanted a way to differentiate the casual fp in python from the real hardcore fp of these languages

most lisps aren't hardcore functional, it's pretty much just scheme and (I think, I've never used it) clojure.

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies
make this the new programming thread, banish arguments about serialization and p/j-langs to the old thread

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
we dont even fight about typing any more

uG
Apr 23, 2003

by Ralp
i dont really understand wtf you are talking about with strongly typed results from your ORM. your ORM should be using a schema to define types, and your database is already typed. what additional typing are you asking about?

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
at work we use untyped ado.net datasets. more than once this situation has bitten me:

C# code:
int itemID = Convert.ToInt32(row["ItemID"]);
// o poo poo! InvalidCastException! ItemID is actually a decimal(28,0) in the db
so i assume he's asking for a way to avoid that situation. strong typing would be making object classes which actually reflect the DB column types instead of shoving everything inside a string or object and farting around with conversions

Pollyanna
Mar 5, 2005

Milk's on them.


why the hell is creating a copy of an object in Objective-C so goddamn complicated

Pollyanna
Mar 5, 2005

Milk's on them.


in fact objc kinda scares the poo poo out of me because it's so verbose and like. weird. it uses a totally different way of defining an object than i'm used to

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

Pollyanna posted:

in fact objc kinda scares the poo poo out of me because it's so verbose and like. weird. it uses a totally different way of defining an object than i'm used to

java:

blah blah blahbedy fuckin blah (int Blah)



objc:

bloogety fuckin blorfblargh bleep (int Blah)

subtle diffs

uG
Apr 23, 2003

by Ralp

i barely GNU her! posted:

at work we use untyped ado.net datasets. more than once this situation has bitten me:

C# code:
int itemID = Convert.ToInt32(row["ItemID"]);
// o poo poo! InvalidCastException! ItemID is actually a decimal(28,0) in the db
so i assume he's asking for a way to avoid that situation. strong typing would be making object classes which actually reflect the DB column types instead of shoving everything inside a string or object and farting around with conversions

so the orm you use has a schema but doesn't let you type your objects? yORMpos

uG
Apr 23, 2003

by Ralp
i mean i use typing in perl orms and thats a plang without an object model so...

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
that's not an orm, that's a result set from the server. and each field in that result object does have a type (kinda - it's stored with the column definition but internally i think it's stored as an object), but you have to know in advance what the type of each field is supposed to be so you can access it right. well-written c# demands strong typing w/ real classes and farting around with converting between unknown formats is poor practice at best and unstable at worst

Bloody
Mar 3, 2013

uG posted:

i dont really understand wtf you are talking about with strongly typed results from your ORM. your ORM should be using a schema to define types, and your database is already typed. what additional typing are you asking about?

like i fuckin know

once upon a time i used an orm and i could ask it for players matching some condition and i would get back an array of players or whatever

i dont want anything to do with loving around with varchars and all that bullshit i just want my objects

Bloody
Mar 3, 2013

maybe the fundamental issue here is how the gently caress do i use a database in a way that doesnt suck dick for me or my program currently orms fulfill requirement #1 but not #2 if shitposters are to be believed

Nomnom Cookie
Aug 30, 2009



Jonny 290 posted:

java:

blah blah blahbedy fuckin blah (int Blah)



objc:

bloogety fuckin blorfblargh bleep (int Blah)

subtle diffs

java classes are objc interfaces. java interfaces are objc protocols. objc static means a million things because of its C heritage, and none of those meanings are the same as java's static. java will complain if you do stuff with null (nil). objc is more laid back and just lets the nil propagate to somewhere a user can see it.

Bloody posted:

maybe the fundamental issue here is how the gently caress do i use a database in a way that doesnt suck dick for me or my program currently orms fulfill requirement #1 but not #2 if shitposters are to be believed

Use Spring Data JPA. It's like Mybatis but has more dependencies so you know it's doing something cool with them.

Shaggar
Apr 26, 2006
if your data is important, don't use an orm.
if your data is sort of important, ok use an orm I guess and then spend 1000x the time you "saved" by using an orm on your reporting.
if you data isn't important it doesn't matter what you use.

Bloody
Mar 3, 2013

Shaggar posted:

if your data is important, don't use an orm.
if your data is sort of important, ok use an orm I guess and then spend 1000x the time you "saved" by using an orm on your reporting.
if you data isn't important it doesn't matter what you use.

shagster im using c# and aspmvc4whatever what should i do

i dont know what sort of data qualifies as "important"

Shaggar
Apr 26, 2006
I use mybatis.net but u could use entity framework if you wanted. I didn't like it myself. tbh I don't know that much about other db frameworks. you can also make ur own on top of ado.net if you hate yourself.

Nomnom Cookie
Aug 30, 2009



Shaggar posted:

if your data is important, don't use an orm.
if your data is sort of important, ok use an orm I guess and then spend 1000x the time you "saved" by using an orm on your reporting.
if you data isn't important it doesn't matter what you use.

Pfft just shove everything in Hadoop and M/R the reports.

Morkai
May 2, 2004

aaag babbys

Bloody posted:

shagster im using c# and aspmvc4whatever what should i do

i dont know what sort of data qualifies as "important"

oh ffs. in this case use ef 5, implement a generic repository using rest verbs, get a unit if work to sync your repositories and loving go nuts. go code first or at least use the POCO reverse generator if you already have a data schema and live in harmony with your orm that can still be reported from because you were smart enough to model your entities into bcnf.

enjoy

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

Nomnom Cookie posted:

java will complain if you do stuff with null (nil). objc is more laid back and just lets the nil propagate to somewhere a user can see it.

whaaaa

Pollyanna
Mar 5, 2005

Milk's on them.



yup, i just went through a tutorial that specifically pointed this out

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Bloody posted:

shagster im using c# and aspmvc4whatever what should i do

i dont know what sort of data qualifies as "important"

just use ef and enjoy life

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

VanillaKid posted:

most lisps aren't hardcore functional, it's pretty much just scheme and (I think, I've never used it) clojure.

my lisp experience is just racket and it felt very hardcore to me even if all the mutation and oop stuff was right at my side for me to use. it's like "oh yeah, we got all of these for you... just in case... but you really don't want these riiight?"

weird
Jun 4, 2012

by zen death robot
ya thats scheme

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Pollyanna posted:

yup, i just went through a tutorial that specifically pointed this out

have fun learning what NSObject *objct = [[NSObject alloc] initWithButtsAsses: butts asses: asses] means

double sulk
Jul 2, 2010

objc method calls own and so does xcode completion except when u want nslog and you get nslolletshaveachatoveracupoftea

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
just code in sublime text and have a snippet for NSLog

Bloody
Mar 3, 2013

~Coxy posted:

just use ef and enjoy life

yup workin on it doing some code first thing idk it feels like im using an orm but people here told me to use it so w/e

Plastic Snake
Mar 2, 2005
For Halloween or scaring people.
the best thing to do is use EF like a statement mapper cause you don't have to deal with too much DB schema poo poo in ur code but you still get strongly typed result sets. it owns

Morkai
May 2, 2004

aaag babbys

Bloody posted:

yup workin on it doing some code first thing idk it feels like im using an orm but people here told me to use it so w/e

it's an orm

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
favorite thing i learnt today: how to initialize arrays of arbitrary size in constant time

(encountered it via this paper, which while it improves the auxiliary space bound, doesn't explain it as clearly)

MrMoo
Sep 14, 2000

It's just COW but for reading first time?

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

MrMoo posted:

It's just COW but for reading first time?

also looks like it murders your cache locality without getting you space savings

I guess constant time look up is useful too.

I wonder how it compares to a hash table in space-time complexity for large n

e: the paper's pretty slick

Malcolm XML fucked around with this message at 04:18 on Sep 28, 2013

Posting Principle
Dec 10, 2011

by Ralp
i got spring jpa set up. IDEA wrote most of the code for me, i basically just told the ide that there was a postrgess db at localhost:5432 and it took it from there. then i started looking at some of the spring aop stuff for transactions and logging and oh my god this rabbit hole is terrifying there is xml and annotations everywhere

Shaggar
Apr 26, 2006
tread carefully, padawan.

Nomnom Cookie
Aug 30, 2009



Yeah you can get crazy with Spring and it will help you every step of the way. It's the ultimate yak shaving platform

Adbot
ADBOT LOVES YOU

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

USSMICHELLEBACHMAN posted:

have fun learning what NSObject *objct = [[NSObject alloc] initWithButtsAsses: butts asses: asses] means

what it means is someone doesn't know how to write method names in objc because that should be NSObject *objct = [[NSObject alloc] initWithButts: butts andAsses: asses]

  • Locked thread