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
eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Zemyla posted:

You know, all this "dependency injection" stuff seems like an ad hoc way of doing something that Haskell has already solved.

If you want an interface to a library that does butt stuff, you'd write something like:

code:

class Monad m => MonadButt m where
    gasLevel :: m Int
    fart :: Int -> m FartStatus
    filterButt :: CarbonFilter -> m a -> m (a, CarbonFilter)

And any value that produces a value that's an instance of MonadButt will have no way of knowing if it's working with a fake or real butt.

code:

mainButt :: (MonadButt m) => m String
mainButt = do
  lvl <- gasLevel
  stat <- fart (lvl `div` 2)
  return (show (lvl, stat))

And then you can write FakeButt and RealButt types for testing and actual use respectively.

And the best part is that this solution wasn't designed for dependency injection, but simply so you can use monad transformers on them:

code:

instance MonadButt m => MonadButt (MaybeT m) where
  gasLevel = MaybeT $ fmap Just gasLevel

  fart n = MaybeT $ fmap Just (fart n)

  filterButt cf (MaybeT m) = MaybeT $ do
    v <- filterButt cf m
    case v of
      (Nothing, _) -> return Nothing
      (Just a, cf') -> return $ Just (a, cf')

so what you're saying is a monad is like a butt

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

HoboMan posted:

how about generating classes from stored procedures? which is what i want

e: this dataset is coming up on 100 columns so i am trying to avoid having to actually write it out

i don't think theres anything built into dapper but i bet someone has written something to generate a poco from a dataset. but


jony neuemonic posted:

i have concerns.

HoboMan
Nov 4, 2010

jony neuemonic posted:

i have concerns.

this software is so bad i've stopped caring

e: i could maybe break it up into multiple objects but all that data is nessecary so vOv

HoboMan fucked around with this message at 23:16 on Mar 6, 2017

jony neuemonic
Nov 13, 2009

HoboMan posted:

this software is so bad i've stopped caring

e: i could maybe break it up into multiple objects but all that data is nessecary so vOv

been there, nothing like inheriting a project where the solution to every problem was "well we can add another column".

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

HoboMan posted:

software is so bad i've stopped caring

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I realized itch.io lets you upload dosbox browser games now so I have an outlet for my dos junk

unfortunately I'm Chris Roberts and my dumb projects are so grand in scope that I don't have the technical knowledge to finish them (dos 3D space shooter? well it's really a model viewer atm)

I need to make something that I can actually finish in a reasonable timeframe

Aquarium of Lies
Feb 5, 2005

sad cutie
:justtrans:

she/her
Taco Defender

eschaton posted:

so what you're saying is a monad is like a butt

Maybe

NihilCredo
Jun 6, 2011

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

jony neuemonic posted:

been there, nothing like inheriting a project where the solution to every problem was "well we can add another column".

tbh having lots of columns isn't a particularly strong code smell. it often comes from a failure to normalize (do any of the columns have numbers in their name?), but it's hardly rare to have a domain object that legitimately needs a lot of unique properties while still remaining atomic in nature

imo the primary considerations are 1. how often you find yourself adding more properties and 2. how painful is the process to add the new columns to the production db(s). if the answers are "often" and "very" then yeah, you'll be better off janitoring an eav table even if it technically weakens your schema

but that isn't always the case. if you work on controlling bigass industrial machines with 145 knobs each, you may have the luxury of knowing that it will take years before they design and put into production a 146-knob model, and it will come with a major software upgrade anyways

NihilCredo fucked around with this message at 01:11 on Mar 7, 2017

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

Luigi Thirty posted:

I realized itch.io lets you upload dosbox browser games now so I have an outlet for my dos junk

unfortunately I'm Chris Roberts and my dumb projects are so grand in scope that I don't have the technical knowledge to finish them (dos 3D space shooter? well it's really a model viewer atm)

if ant of your stuff is """playable""" you should let us try it out anyway :q:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

sure if you want to play a Wavefront OBJ model viewer for IBM PC-compatibles with a VGA graphics adapter that I keep refactoring over and over

jony neuemonic
Nov 13, 2009

NihilCredo posted:

tbh having lots of columns isn't a particularly strong code smell.

oh yeah, there's nothing inherently wrong with it. it's just been my experience that teams that end up with gigantic horizontal tables are the same teams that can't make a sane data model or cleanly extend their software.

gonadic io
Feb 16, 2011

>>=

jony neuemonic posted:

oh yeah, there's nothing inherently wrong with it. it's just been my experience that teams that end up with gigantic horizontal tables are the same teams that can't make a sane data model or cleanly extend their software.

one of our legacy tables has two columns "iban" and "customer_iban". mostly null and unused.

a change comes along that we need the iban for customers who we hadn't previous been storing it for.

guess the outcome

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

sure if you want to play a Wavefront OBJ model viewer for IBM PC-compatibles with a VGA graphics adapter that I keep refactoring over and over

does it run on the NEC ProSpeed 386?

(also the expansion module thing is now down to $40+shipping on eBay)

redleader
Aug 18, 2005

Engage according to operational parameters
i don't believe that cleanly extensible software exists

VikingofRock
Aug 24, 2008




Is this thread's unread count messed up for anyone else? Mine keeps showing zero unread posts even though I definitely have some unread posts. I just realized I missed a bunch of posts today because of it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

eschaton posted:

does it run on the NEC ProSpeed 386?

(also the expansion module thing is now down to $40+shipping on eBay)

it sure does (386 or better, FPU preferred)

Count Thrashula
Jun 1, 2003

Death is nothing compared to vindication.
Buglord
I always thought ASP.Net and C#.Net were two completely separate things

looks like they're not??

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

COOL CORN posted:

I always thought ASP.Net and C#.Net were two completely separate things

looks like they're not??

C# is (one of) the language(s) you can write the logic for ASP pages in, and they both run on the .NET framework.

jesus WEP
Oct 17, 2004


at newjob they use codesmith generator where you define you're domain objects in xml files and it generates the c# files and sql files for you, works way better than janitoring each layer of the app yourself

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

VikingofRock posted:

Is this thread's unread count messed up for anyone else? Mine keeps showing zero unread posts even though I definitely have some unread posts. I just realized I missed a bunch of posts today because of it.

yeah, it's a known issue

jony neuemonic
Nov 13, 2009

it's visual studio 2017 day :toot:

Arcsech
Aug 5, 2008

COOL CORN posted:

I always thought ASP.Net and C#.Net were two completely separate things

looks like they're not??

ASP.net is a library/framework for .net languages (such as C#, VB.net, and F#)

here a ".net language" is analogous to a "JVM language" - .net langs all run on the same VM

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe

redleader posted:

i don't believe that cleanly extensible software exists

Yeah it's just different levels of pain, like most tasks

It's fun to think about the perspective of software over time

You still sometimes hear the old sentiment that it was great because it would make things cheaper and more dynamic; what might take hardware retooling and replacement could now be a simple software update

In reality what software strength has ended up being is the same as lots of industrialization: it allows for additional specialization

Hardware engineers can focus on speed and power efficiency and compatibility, software people focus on an ecosystem of end users desires

Software isn't really all that much cheaper to develop than hardware, it can become just difficult to change and update. IBM spent a lot on system 360 of which most of the cost and effort was building the compatible system software

It's like SOA, it's not that SOA is a great architecture for performance or overhead, it's that it's a great architecture for a large organization working on large complex systems with complex integration and delivery timelines. Microservices combine that with minmaxing your cloud resource utilization

Arcteryx Anarchist fucked around with this message at 17:49 on Mar 7, 2017

hifi
Jul 25, 2012

this is a question for old folks i guess, but did people used to be able to read a book and actually write code relatively syntax error free? in the days of punch cards there wasn't near the instant gratification of write->compile->run or even a repl, and i feel like i learn absolutely nothing staring at the syntax of a new language and i have to trainwreck through the first few programs i write until there's some muscle memory for stuff like basic conditionals and loops

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

hifi posted:

this is a question for old folks i guess, but did people used to be able to read a book and actually write code relatively syntax error free? in the days of punch cards there wasn't near the instant gratification of write->compile->run or even a repl, and i feel like i learn absolutely nothing staring at the syntax of a new language and i have to trainwreck through the first few programs i write until there's some muscle memory for stuff like basic conditionals and loops

Nope. In the days of punch cards, though, people would do a lot more of simulating their code by hand before submitting jobs to the computer. But there was still a serious learning curve.

http://www.columbia.edu/cu/computinghistory/fisk.pdf
http://softwareengineering.stackexchange.com/questions/151980/how-did-programming-work-when-programmers-used-punchcards

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

hifi posted:

this is a question for old folks i guess, but did people used to be able to read a book and actually write code relatively syntax error free? in the days of punch cards there wasn't near the instant gratification of write->compile->run or even a repl, and i feel like i learn absolutely nothing staring at the syntax of a new language and i have to trainwreck through the first few programs i write until there's some muscle memory for stuff like basic conditionals and loops

i think it just took significantly more effort

AggressivelyStupid
Jan 9, 2012

Also sometimes you didn't know you hosed up until the next day, if an old professor is to believed.

JawnV6
Jul 4, 2004

So hot ...

hifi posted:

this is a question for old folks i guess, but did people used to be able to read a book and actually write code relatively syntax error free?
for a while, "compiler" was a job title for some human who'd read your source and turn it into assembly. strict syntax wasn't a hard requirement, the person could often intuit what you meant

one of the MIT labs has a story about some military affiliated guy who would take hours on the system hunt-and-pecking his programs in, and would often skip semicolons that would take him even longer to debug. the hackers spent time making a syntax checker that would print a big flashing arrow on the offending line "RIGHT HERE DUDE"

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

here's a video from 1973 about a computer room: https://www.youtube.com/watch?v=HMYiktO0D64

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
jfc, our internal training class on how to code reviews is called "the art of war". that does not seem like a healthy attitude toward code review.

LordSaturn
Aug 12, 2007

sadly unfunny

cis autodrag posted:

jfc, our internal training class on how to code reviews is called "the art of war". that does not seem like a healthy attitude toward code review.

I don't recall ever hearing about a code review when I was developing there

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

LordSaturn posted:

I don't recall ever hearing about a code review when I was developing there

they call it "pqa" for "programmer qa" but it's the same concept and i try to avoid epic-isms itt if there's a similar general concept

VikingofRock
Aug 24, 2008




cis autodrag posted:

jfc, our internal training class on how to code reviews is called "the art of war". that does not seem like a healthy attitude toward code review.

I feel this same way when people talk about battling the compiler. The compiler is there to help you; it's not your enemy. Same with code review.

hifi
Jul 25, 2012

that pdf was good. i was more interested in the mental side of it which seems to get less attention than the "look how big those hard drives were back then" techno fetishism side of it.

i guess huge downtimes of waiting on your program to get processed into cards, then run on the mainframe, were just part of the game back then and an acceptable builtin downtime than say, browsing hackernews for fifteen minutes when there is theoretically unlimited work you can dive in to.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

VikingofRock posted:

I feel this same way when people talk about battling the compiler. The compiler is there to help you; it's not your enemy. Same with code review.

well, and if the compiler is genuinely loving up you should probably be finding out how to get that fixed rather than bitching about it :v:

but its almost never the compiler that is loving up.

Chalks
Sep 30, 2009

jony neuemonic posted:

it's visual studio 2017 day :toot:

Time to find it out if they've succeeded in releasing a version that's actually faster than the previous one like they said they would.

To be fair they've been working very hard on setting the bar as low as possible for many versions so I have faith.

GameCube
Nov 21, 2006

vs2015 owns owns owns

i'd be on 2017 already if xamarin hadn't hosed something up

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

carry on then posted:

here's a video from 1973 about a computer room: https://www.youtube.com/watch?v=HMYiktO0D64

lol at part 2: "can't be bothered to type your own punch cards? submit your code to the typing pool and let a woman do it for you"

NihilCredo
Jun 6, 2011

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

GameCube posted:

vs2015 owns owns owns

i'd be on 2017 already if xamarin hadn't hosed something up

we're doing xamarin on vs2017 for a few weeks and oh god i can't loving *blink* without something breaking in the build -> deploy -> debug toolchain. and the errors are always 'hope you find a stackoverflow answer 'cause you sure ain't figuring this one out on your own' level of useless

though tbf almost all the show-stoppers have come from the android sdk side of things rather than the .net one. also we started on vs2015 and things weren't much better

speaking of crappy tooling, pro tip for vs2017 f# folks: the visualf# tools in the rtm are still the old buggy ones from the release candidate, you can actually get the latest version here: https://github.com/Microsoft/visualfsharp/wiki/Using-CI-Builds which fixes a ton of stuff (inline rename most notably)

Adbot
ADBOT LOVES YOU

AWWNAW
Dec 30, 2008

haha that means you're running code I pushed to the F# compiler now

condolences

  • Locked thread