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
Brain Candy
May 18, 2006

Plorkyeran posted:

mutation testing is totally awesome, but something that only .1% of projects will have any use for. there's no point in using some fancy tool to find code which is insufficiently tested when you can just look at your code coverage report and see that 30% of your code is never run at all.

it is incrediby useful as an object lesson to people when they start writing tests (or write garbage tests) and chase 100% coverage

you get what you measure, and if you don't have a metric to fight a metric you'll get all sorts of weird brain justifications to make the numbers go up

Adbot
ADBOT LOVES YOU

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

Sapozhnik posted:

well with react you just get trees of "components" and they can be either bits of logic or bits of view! or hey why not both!

youtube video: sapozhnik reacts to reactjs: its poo poo

what framework is non-poo poo to you?

JewKiller 3000
Nov 28, 2006

by Lowtax
the good thing about stored procedures is that they run on the database server. the bad thing about stored procedures is that they run on the database server

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

fleshweasel posted:

i thought that "view" was your render template, "controller" contains the methods that get called when clients make requests, and "model" is literally everything else. I do very simple kinds of parsing of URL query parameters in controller methods and otherwise delegate poo poo out to another layer.


I don't know how you can write a program that operates on data whose shape you know jack poo poo about unless it's serialization or tree traversal or something else that really doesn't care how many attributes there are on a particular node or whatever, it just slurps them all up.

basically, if you can't represent the kind of program you're talking about in typescript without using `any`, something seriously hosed up is going on
.

Let me tell you about epics bespoke webforms based platform

cinci zoo sniper
Mar 15, 2013




Sapozhnik posted:

could try d3js i guess

no d3js or other web stuff, as i said

Luigi Thirty
Apr 30, 2006

Emergency confection port.

carry on then posted:

on swift 4, awful.app now stack overflows when entering the background due to core data and/or grmoustache

this is gonna be so fun to debug

someone in the apple programming thread said "I don't like to work on Core Data, it's always broken" and someone else was like "yeah I don't think Apple does either"

sounds accurate to me

Luigi Thirty
Apr 30, 2006

Emergency confection port.

also i installed openstep in vmware cause i was curious about it

wow, it's... literally OS X except 20 years ago

Potassium Problems
Sep 28, 2001

fleshweasel posted:

i thought that "view" was your render template, "controller" contains the methods that get called when clients make requests, and "model" is literally everything else. I do very simple kinds of parsing of URL query parameters in controller methods and otherwise delegate poo poo out to another layer.
some devs (rubyists especially) take model-view-controller too literally and end up advocating "fat {abstraction}, skinny {other abstraction}" and never realize "fat {anything}" is a sign something is doing more work than it should. like your models shouldn't be fat, but your model layer should be deep (data store/retrieval, superficial/domain validation, plain ol' objects, services)

cinci zoo sniper
Mar 15, 2013




coffee cup "musings"

so, if i rewrite my python io thing into a generator (which it kinda is but it's my own hot take continuity, not something ive seen real people do elsewhere), i can then/before migrate everything to 3.5 or later, and use async/await/other asynchronous buzzwords to achieve multithreading, or make decent steps towards it?

cinci zoo sniper
Mar 15, 2013




i just saw "top machine learning libraries for javascript"

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?

Blinkz0rz posted:

i'm porting a piece of software we wrote in javascript to go as a proof of concept and it's not a great language to write in if you don't know the shape of your data until runtime

that led me to a question: beyond p-langs are there any languages where it's not stupidly annoying to deal with unknown data without a predefined shape?

languages that allow and whose standard libraries include heterogeneous maps (where keys can have different types of value) make dealing with this kind of stuff fairly straightforward

if a language has ADTs you can get an equivalent effect with a bit more verbosity

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

fleshweasel posted:

I don't know how you can write a program that operates on data whose shape you know jack poo poo about unless it's serialization or tree traversal or something else that really doesn't care how many attributes there are on a particular node or whatever, it just slurps them all up.

basically, if you can't represent the kind of program you're talking about in typescript without using `any`, something seriously hosed up is going on.

the software coordinates and layers properties from a bunch of different sources and serves an endpoint for archaius so we can tune our services on the fly.

nothing gets evaled so we basically just assemble a list of source properties then recursively mash them all together in the right order. the contents of the data are inconsequential as long as thet can be serialized to json, hence the reason we did this in javascript originally.

there are other internal bits that are simple to model as types but the data being served is almost entirely unknown. every attempt i've made to rewrite this in another language has started with modeling most of the rest of the system and then stuff falls apart when i have to wrestle the language into dealing with unknown and semi-unstructured data

fritz
Jul 26, 2003

cinci zoo sniper posted:

i just saw "top machine learning libraries for javascript"

sometimes you gotta work close to the metal

gonadic io
Feb 16, 2011

>>=

Blinkz0rz posted:

nothing gets evaled so we basically just assemble a list of source properties then recursively mash them all together in the right order. the contents of the data are inconsequential as long as thet can be serialized to json, hence the reason we did this in javascript originally.

List[A <: ToJson]

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

gonadic io posted:

List[A <: ToJson]

we have merging rules that at least require us to know whether the value of a given key is another map and a "feature" that allows us to nest a given source's map at an arbitrary key in the final map.

mystes
May 31, 2006

cinci zoo sniper posted:

coffee cup "musings"

so, if i rewrite my python io thing into a generator (which it kinda is but it's my own hot take continuity, not something ive seen real people do elsewhere), i can then/before migrate everything to 3.5 or later, and use async/await/other asynchronous buzzwords to achieve multithreading, or make decent steps towards it?
Not multithreading, no.

Shaggar
Apr 26, 2006

JewKiller 3000 posted:

the good thing about stored procedures is that they run on the database server. the bad thing about stored procedures is that they run on the database server

any sql runs on the db server which is good because the sql server is good at running sql.

Sapozhnik
Jan 2, 2005

Nap Ghost

Flat Daddy posted:

what framework is non-poo poo to you?

you almost certainly work with javascript way more than i do and yet your first reaction to me saying "$javascriptthing is poo poo" is to assume i'm comparing it to some totally extant not-poo poo javascript thing :v:

as for why there's logic in a web app in the first place, because web apis are not supposed to be rpcs for hooking up the back half of a specific application, they're supposed to be an organizational boundary for your data. this api serves multiple applications and they have very different data access patterns to each other.

Sapozhnik fucked around with this message at 14:56 on Jul 12, 2017

cinci zoo sniper
Mar 15, 2013




mystes posted:

Not multithreading, no.

can't i put each part in separate thread some way if i get the separation going? either way it would probably be slower than vectorised operations over array, since i would have to split into rows.

Shaggar
Apr 26, 2006

Sapozhnik posted:

you almost certainly work with javascript way more than i do and yet your first reaction to me saying "$javascriptthing is poo poo" is to assume i'm comparing it to some totally extant not-poo poo javascript thing :v:

as for why there's logic in a web app in the first place, because web apis are not supposed to be rpcs for hooking up the back half of a specific application, they're supposed to be an organizational boundary for your data. this api serves multiple applications and they have very different data access patterns to each other.

that's the theory but then you start doing client side web "development" and then you realize the theory is stupid.

Shaggar
Apr 26, 2006
the best way to do it is render serverside w/ the server talking to the api on behalf of the client. oauth makes that very easy

Arcsech
Aug 5, 2008

cinci zoo sniper posted:

can't i put each part in separate thread some way if i get the separation going? either way it would probably be slower than vectorised operations over array, since i would have to split into rows.

in Python you get a single thread forever. multithreading does not exist

also async/await is about concurrency, not parallelism

cinci zoo sniper
Mar 15, 2013




Arcsech posted:

in Python you get a single thread forever. multithreading does not exist

also async/await is about concurrency, not parallelism

i see your point about concurrency and i know that core python cant into cores, but i had assumed someone has figured out a cython style solution for that or something

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

Sapozhnik posted:

you almost certainly work with javascript way more than i do and yet your first reaction to me saying "$javascriptthing is poo poo" is to assume i'm comparing it to some totally extant not-poo poo javascript thing :v:

eh plenty of people do call react poo poo and have their own ideas about what is good.

react may not be the best but what I'm used to are inherited angularjs and/or jquery projects and I'd love it if my chief complaint was just that logic and presentation were colocated. rather than, say, the app Is an unfollowable mess of api calls and 3rd party library callbacks manipulating global variables and dom, with no clear source of truth for values (like premature caching all over the place and storage in like dom attributes and poo poo)

maybe vue or mobx or cyclejs etc would be slightly better to use but react is such a vast improvement over what I'm used to that I haven't cared to look


e: im talking about react with redux btw. an all-react codebase does sound lovely to me

Flat Daddy fucked around with this message at 15:55 on Jul 12, 2017

Chalks
Sep 30, 2009

Blinkz0rz posted:

the software coordinates and layers properties from a bunch of different sources and serves an endpoint for archaius so we can tune our services on the fly.

nothing gets evaled so we basically just assemble a list of source properties then recursively mash them all together in the right order. the contents of the data are inconsequential as long as thet can be serialized to json, hence the reason we did this in javascript originally.

there are other internal bits that are simple to model as types but the data being served is almost entirely unknown. every attempt i've made to rewrite this in another language has started with modeling most of the rest of the system and then stuff falls apart when i have to wrestle the language into dealing with unknown and semi-unstructured data

Typescript is pretty decent imo and if the data is basically just nested dictionaries of strings (?) you can use something like

code:
class NestedDictionary {
    [k: string]: NestedDictionary | string;
}
As a typed representation of your arbitrary data without resorting to generic objects.

ThePeavstenator
Dec 18, 2012

:burger::burger::burger::burger::burger:

Establish the Buns

:burger::burger::burger::burger::burger:
When I first learned React it mildly upset me when I realized that state wasn't actually immutable.

Sapozhnik
Jan 2, 2005

Nap Ghost

Flat Daddy posted:

eh plenty of people do call react poo poo and have their own ideas about what is good.

react may not be the best but what I'm used to are inherited angularjs and/or jquery projects and I'd love it if my chief complaint was just that logic and presentation were colocated. rather than, say, the app Is an unfollowable mess of api calls and 3rd party library callbacks manipulating global variables and dom, with no clear source of truth for values (like premature caching all over the place and storage in like dom attributes and poo poo)

maybe vue or mobx or cyclejs etc would be slightly better to use but react is such a vast improvement over what I'm used to that I haven't cared to look


e: im talking about react with redux btw. an all-react codebase does sound lovely to me

i mean i'm still going to use it, i just feel like, you know, if this is the good framework (the single source of truth thing is actually a really good point you bring up) then god help anybody who has to work with something worse than that.

what is your opinion of redux-saga btw i think it looks pretty rad

motedek
Oct 9, 2012

cinci zoo sniper posted:

question of the day: is there, in some language or framework, a genuinely good plotting library that is not a hosted solution of some sort?

not ready to say it's genuinely good but plotly will take ggplot calls and poo poo out interactive html/js. it suits need for scatter plot where you can mouse over and see the data value. they want you to use hosted but it works standalone.

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

Sapozhnik posted:

i mean i'm still going to use it, i just feel like, you know, if this is the good framework (the single source of truth thing is actually a really good point you bring up) then god help anybody who has to work with something worse than that.

what is your opinion of redux-saga btw i think it looks pretty rad

it truly does get so much worse. maybe one of the reasons react isn't compelling to outsiders of the js world is that the reasons for it can't be illustrated with just TodoMVC or something. you have to work on giant piece of poo poo proprietary codebases with people who don't know what they're doing to truly understand all the need for over engineering.

I use redux-saga pretty heavily and I love it. my best use case for it is wrapping this huge bloated 3rd party component I have to use. I use event channels to wrap its async initialization (it requires data from my server,which it uses in a call to a 3rd party api before it can be used) and to wrap the events that it fires while it's running.

so I have a generator function that handles the entire lifecycle of the component as a synchronous-looking generator function that (1) waits for the user to navigate to the page where this component will be displayed (2) dispatches an event for the loading indicator (3) creates the initialization event channel (4) responds to the success/failure of initialization (5) on success, dispatch the loading done action (6) create the runtime event channel (7) forks the saga into two loops: (a) one that waits for 3rd party events and dispatches them to redux and (b) one that does poo poo to the component after certain redux actions

its all pretty easy to read and follow, top to bottom. it manages to avoid both pyramid-looking callback hell as well as a need to jump around to more than one place in the codebase to understand the sequence. as far as the rest of the app is concerned its a nice black box where its just messages going in and out seemingly-synchronously.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Chalks posted:

Typescript is pretty decent imo and if the data is basically just nested dictionaries of strings (?) you can use something like

code:

class NestedDictionary {
    [k: string]: NestedDictionary | string;
}

As a typed representation of your arbitrary data without resorting to generic objects.

gently caress i totally forgot typescript has union types

mystes
May 31, 2006

cinci zoo sniper posted:

i see your point about concurrency and i know that core python cant into cores, but i had assumed someone has figured out a cython style solution for that or something
I think you can use the multiprocessing module to spawn multiple processes.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
gently caress yes, we are fully featured:

DONT THREAD ON ME fucked around with this message at 01:33 on Jul 13, 2017

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
wait a minute is that a serifed font? in the terminal??????

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
god what happened to you man

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
yeah the terminal on my personal laptop is all hosed up atm. that's not how I usually roll. i was just trying things out.

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

MALE SHOEGAZE posted:

gently caress yes, we are fully featured:

isn't it gob's program

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

fleshweasel posted:

i thought that "view" was your render template, "controller" contains the methods that get called when clients make requests, and "model" is literally everything else. I do very simple kinds of parsing of URL query parameters in controller methods and otherwise delegate poo poo out to another layer.

this is rails's thing that they called mvc for some reason despite it not being mvc at all, thus forever making it impossible to ever coherently talk about mvc

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?
you should switch to Cathode for all your terminal emulation needs

JewKiller 3000
Nov 28, 2006

by Lowtax
i haven't written any real java code in a while and i decided to use java 8 streams this time and boy are they cool and good

Adbot
ADBOT LOVES YOU

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

JewKiller 3000 posted:

i haven't written any real java code in a while and i decided to use java 8 streams this time and boy are they cool and good

so much nicer than little anonymous classes everywhere but most of what i do has to run on java 7.

someday.

  • Locked thread