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
DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

gonadic io posted:

any advice for breaking out of the classic loop of: doing tech debt informally, so tickets take longer, and management won't dedicate time to tech debt due to tickets always already being behind


gonadic io posted:

I mean that's the successful strategy I have used for previous companies I'm trying to avoid it this time I like this company but it's got the classic startup-no-more growing pains

other than :sever: i guess try to convince management of the business value. maybe if you can prove it with their own metrics, e.g, "doing this chore first would have avoided these bugs/made these tickets take half as long/whatever"

if management is non-technical and business-driven, it'll probably be an uphill battle no matter what. if there are technical people involved in those decisions, it should be much easier, but if that was the case, you probably wouldn't be asking

good luck. at my current job, i've actually struggled to report chores related to tech debt, because so many shittier jobs forced me to handle them through the back door

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
thanks for the tips all, as usual the worst technical problems are not technical problems at all

Schadenboner
Aug 15, 2011

by Shine

gonadic io posted:

as usual the worst technical problems are caused by trying to use technology to solve nontechnical problems

:shrug:

gonadic io
Feb 16, 2011

>>=

what if I programmed an AI to diagnose tech deb--oh wait they already tried that https://thenextweb.com/artificial-intelligence/2018/09/14/facebook-ai-tool-fixes-bugs/

Xarn
Jun 26, 2015
If your management is not technical enough to know that paying down tech debt can be important*, they are not technical enough to notice that your estimates contain enough padding to apply the boy scout rule to your codebase :shrug:



* It can also be useless in certain cases, knowing which is which is really hard though.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

piratepilates posted:

redux is one of the react cases where it got super hyped up for some reason, and everyone thought it should be used everywhere always at all times for everything.

as a result you see people race to use it for everything for no good reason, like storing every piece of their application's component-local state in it, and never using `setState` or `useState`.

it's meant for one thing: global shared state across a react application. it does it pretty decently (but with admittedly really lovely boilerplate/syntax). if you don't need to share global state between two components that otherwise have nothing to do with each other (i.e. no close common parent), then it's not needed. even if you have a need for some global state, if you can satisfy that requirement with making separate api calls, that's probably a much better approach for as long as you can reasonably do it.

cool. sounds like redux solves an even narrower problem than i attributed to it. so far i haven't encountered many cases where component-level states and props didn't do the job, maybe with the help of a callback prop to handle an api call, or a dom event that propagated to a parent component

abraham linksys
Sep 6, 2010

:darksouls:

piratepilates posted:

redux is one of the react cases where it got super hyped up for some reason, and everyone thought it should be used everywhere always at all times for everything.

as a result you see people race to use it for everything for no good reason, like storing every piece of their application's component-local state in it, and never using `setState` or `useState`.

it's meant for one thing: global shared state across a react application. it does it pretty decently (but with admittedly really lovely boilerplate/syntax). if you don't need to share global state between two components that otherwise have nothing to do with each other (i.e. no close common parent), then it's not needed. even if you have a need for some global state, if you can satisfy that requirement with making separate api calls, that's probably a much better approach for as long as you can reasonably do it.

to be fair, local state and async behavior was difficult to unit test in react for a really long time. was hard to write a test like "click this button that will trigger a mocked async api call and check to make sure it updates to show a success state" or something, compared to testing "this async action creator will dispatch a success action, this reducer will set the didSucceed flag in redux state, this mapStateToProps() will pass didSucceed from the store to the wrapped component, and this component will show a success state when passed didSucceed=true."

newer, better test libraries and hooks might have fixed this to an extent? i just remember pre-redux react having to do a lotta setTimeout(fn, 0) hackery to get my tests to run in order with async behavior

(i don't write unit tests for personal projects, and at work we're still using class components + a nightmarish redux-saga layer, so i don't know specifics of testing with hooks and the like)

abraham linksys fucked around with this message at 18:05 on Sep 11, 2020

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

abraham linksys posted:

to be fair, local state and async behavior was difficult to unit test in react for a really long time. was hard to write a test like "click this button that will trigger a mocked async api call and check to make sure it updates to show a success state" or something, compared to testing "this async action creator will dispatch a success action, this reducer will set the didSucceed flag in redux state, this mapStateToProps() will pass didSucceed from the store to the wrapped component, and this component will show a success state when passed didSucceed=true."

newer, better test libraries and hooks might have fixed this to an extent? i just remember pre-redux react having to do a lotta setTimeout(fn, 0) hackery to get my tests to run in order with async behavior

i only started using it recently, but so far enzyme has been v needs suiting

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



abraham linksys posted:

to be fair, local state and async behavior was difficult to unit test in react for a really long time. was hard to write a test like "click this button that will trigger a mocked async api call and check to make sure it updates to show a success state" or something, compared to testing "this async action creator will dispatch a success action, this reducer will set the didSucceed flag in redux state, this mapStateToProps() will pass didSucceed from the store to the wrapped component, and this component will show a success state when passed didSucceed=true."

newer, better test libraries and hooks might have fixed this to an extent? i just remember pre-redux react having to do a lotta setTimeout(fn, 0) hackery to get my tests to run in order with async behavior

that's fair, and I've had a real blind spot to testing in react prior to about 3 years ago. along those lines I find hooks very useful in practice, but very hard to test.

an approach I've seen in the past to do test things like api calls in components (pre-hooks, might be different nowadays) is to split the component in to two: the presentation component (just for rendering props and local state) and the container component (for fetching state like api data, and passing it down to the presentation component). I really liked that approach for splitting up the concerns of the components and reducing the needs of testing them down to passing in props and asserting what's rendered.

edit:

abraham linksys posted:

(i don't write unit tests for personal projects, and at work we're still using class components + a nightmarish redux-saga layer, so i don't know specifics of testing with hooks and the like)

yeah I'm really not sure either. the last time I checked, it seemed like one of the "official-ish" approaches to take was to make a dummy component just for your tests, that calls the hooks and renders the results for you to test. hopefully it's gotten less....sketchy? since then

abraham linksys
Sep 6, 2010

:darksouls:

DaTroof posted:

i only started using it recently, but so far enzyme has been v needs suiting

we're moving off enzyme to react-testing-library soon, probably, though i couldn't really tell you exactly why

i did a couple minutes of googling and found this article that describes the problem with async testing that i've faced in the past, but also indicates that react-testing-library has a waitFor() util that solves this problem, neat: https://www.benmvp.com/blog/asynchronous-testing-with-enzyme-react-jest/

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

abraham linksys posted:

we're moving off enzyme to react-testing-library soon, probably, though i couldn't really tell you exactly why

i did a couple minutes of googling and found this article that describes the problem with async testing that i've faced in the past, but also indicates that react-testing-library has a waitFor() util that solves this problem, neat: https://www.benmvp.com/blog/asynchronous-testing-with-enzyme-react-jest/

ah, okay. you're probably dealing with a way more complex app than my typical project. i think my biggest has around 15 components, and the entire api for the data model can be expressed in 3 or 4 extremely simple functions (which are all mocked in the enzyme tests)

DaTroof fucked around with this message at 18:17 on Sep 11, 2020

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Xarn posted:

If your management is not technical enough to know that paying down tech debt can be important*, they are not technical enough to notice that your estimates contain enough padding to apply the boy scout rule to your codebase :shrug:



* It can also be useless in certain cases, knowing which is which is really hard though.

yeah this. either you're trusted to do your job or you're not, and part of that job is keeping things maintainable. if they don't care about the irrelevant (to them) details, even better

Sapozhnik
Jan 2, 2005

Nap Ghost
Do not use Redux. I've made ~10 posts ITT about why it is awful, I'm not going to make an eleventh.

Achmed Jones
Oct 16, 2004



gonadic io posted:

any advice for breaking out of the classic loop of: doing tech debt informally, so tickets take longer, and management won't dedicate time to tech debt due to tickets always already being behind

this is the right way to work on tech debt. you pay it off when it starts accruing interest, ie when something needs to change and the lovely code makes it hard/dangerous/etc. having sprints dedicated to polishing turds isn't the right way. you just need to estimate correctly such that fixing tech debt is part of the estimates so that tickets won't be "behind."

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
or estimate like normal because you'll be wrong anyway

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer

Beamed posted:

.net core providing one ootb so that you don't have to put up with nonsense was a real smart move

there was a pretty compelling if whiney blog post last year (?) that i can't find now about how that was the common ms pattern. reimplementing the successful third party libs to make corporate developers comfortable and killing any good will or motivation in the open sores community

autofac was fine, why not just make that the default in asp core?

Arcsech
Aug 5, 2008

Destroyenator posted:

there was a pretty compelling if whiney blog post last year (?) that i can't find now about how that was the common ms pattern. reimplementing the successful third party libs to make corporate developers comfortable and killing any good will or motivation in the open sores community

autofac was fine, why not just make that the default in asp core?

I’m 1000% ok with Microsoft doing that for core infrastructure poo poo. as long as the built in (di framework/HTTP server/client/json parser/whatever) work well and are maintained I’m good, and tbh I’m glad the community is discouraged from reimplementing all that poo poo a thousand times over with highly variable quality, because that’s a waste of time for both the people writing it and the people who gotta choose which one to use

Achmed Jones
Oct 16, 2004



pokeyman posted:

or estimate like normal because you'll be wrong anyway

:hmmyes:

Sapozhnik
Jan 2, 2005

Nap Ghost
most libraries are bad. the less-bad libraries survive, at least in theory

kitchen sink libraries are far more likely to be bad than something more minimal because they try to be more things for more people

the npm ecosystem is perhaps an example of going too far in the opposite direction but perfection in a standard library is achieved not when there is nothing left to add but when there is nothing left to take away.

Plorkyeran
Mar 22, 2007

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

gonadic io posted:

what if I programmed an AI to diagnose tech deb--oh wait they already tried that https://thenextweb.com/artificial-intelligence/2018/09/14/facebook-ai-tool-fixes-bugs/

write an ai that convinces your boss that you need to be working on whatever thing it is you want to work on. gpt-3 is pretty good at producing nice content-free medium thinkpieces and then you just have to attach a suitable title

FlapYoJacks
Feb 12, 2009

gonadic io posted:

any advice for breaking out of the classic loop of: doing tech debt informally, so tickets take longer, and management won't dedicate time to tech debt due to tickets always already being behind

Make a persistent "maintenance ticket" that is never closed. Then when you find tech-debt, just shove it under that ticket.

gonadic io
Feb 16, 2011

>>=

Plorkyeran posted:

write an ai that convinces your boss that you need to be working on whatever thing it is you want to work on. gpt-3 is pretty good at producing nice content-free medium thinkpieces and then you just have to attach a suitable title

please read my latest medium article: please leave me the gently caress alone

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

gonadic io posted:

please read my latest medium article: lkdsjflsdjlj sdljfl dsjf l;sdjk; flkas;'l d';pakf; lsdjk; fksa';d/ kas'kf,

redleader
Aug 18, 2005

Engage according to operational parameters
"tech debt" is nerd jargon for "code i don't like"

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
rename the ignore list "poster debt"

Soricidus
Oct 21, 2010
freedom-hating statist shill

Sapozhnik posted:

perfection in a standard library is achieved not when there is nothing left to add but when there is nothing left to take away.

mmmmaybe

the problem is that if you leave any obvious gaps, you might still end up with kitchen sink libraries but now there are several of them

see for example java, where despite a decently sized standard library, pretty much any non-trivial project is going to include guava, half of apache commons, and at least two logging frameworks.

and god only knows how many dozens of libraries there are now for immutable and/or primitive collections, and how many thousands of incompatible Pair implementations

xtal
Jan 9, 2011

by Fluffdaddy
This is basically the story of Scheme

brap
Aug 23, 2004

Grimey Drawer

Sapozhnik posted:

most libraries are bad. the less-bad libraries survive, at least in theory

kitchen sink libraries are far more likely to be bad than something more minimal because they try to be more things for more people

the npm ecosystem is perhaps an example of going too far in the opposite direction but perfection in a standard library is achieved not when there is nothing left to add but when there is nothing left to take away.

maybe, I guess? but the only evolution you can do on a standard library over time, with very rare exception, is to add things.

hell even with .net core where microsoft tried to ditch a bunch of crap from .net framework that they didn't want to keep maintaining, they had to keep bringing things back in so that people would migrate.

Achmed Jones
Oct 16, 2004



ruby broke a bunch of stuff out from stdlib to various core gems that are installed by default but not loaded. that seemed to work ok, but tbh I don't remember the details and it may have been a disaster and i just didn't hear about it

zokie
Feb 13, 2006

Out of many, Sweden

abraham linksys posted:

we're moving off enzyme to react-testing-library soon, probably, though i couldn't really tell you exactly why

i did a couple minutes of googling and found this article that describes the problem with async testing that i've faced in the past, but also indicates that react-testing-library has a waitFor() util that solves this problem, neat: https://www.benmvp.com/blog/asynchronous-testing-with-enzyme-react-jest/

Switching to testing library made targeting 90%+ coverage a fun goal that feel like something that directly improves the quality and maintainability of my code.

The way enzyme allows you to find elements by React components is shot, compared to forcing you to interact with the DOM “as a user would” like testing library does.

I don’t know if enzyme fixed itself so you can test asynchronous hook stuff, but in testing library it’s simple. My tests are riddled with waitFor(() => getByRole(“progressbar”).not.toBeInTheDOM()) and it works great!

Xarn
Jun 26, 2015

Sapozhnik posted:

most libraries are bad. the less-bad libraries survive, at least in theory

kitchen sink libraries are far more likely to be bad than something more minimal because they try to be more things for more people

the npm ecosystem is perhaps an example of going too far in the opposite direction but perfection in a standard library is achieved not when there is nothing left to add but when there is nothing left to take away.

Don't you permanently complain that C++ stdlib doesn't contain X? :confused:

Soricidus
Oct 21, 2010
freedom-hating statist shill
I guess c++ is particularly bad at library management and it’s easier to have a small stdlib when you have a standard dependency manager instead

Sapozhnik
Jan 2, 2005

Nap Ghost

Xarn posted:

Don't you permanently complain that C++ stdlib doesn't contain X? :confused:

Yes, where X equals "support for network communications".

Necessary standard library functionality should fit into one of two categories:

1. Functionality that everything needs: Dynamic allocation, strings, string formatting, dynamic arrays, associative arrays, basic operating system services like process manipulation and IO.
2. Protocols that everybody needs to agree on for meaningful interoperability to be possible: Deallocation, strings, comparison, iteration. Possibly hashing. Possibly logging, but that rabbit hole can get quite deep.

My main complaint about the C++ stdlib is the fact that it made an atrocious gently caress-up of something as fundamental as strings and string processing, but it is extremely badly designed in a number of ways. Never mind the inability of C++'s originators (I will not flatter them with the title of "designers") to decide what the language's actual objectives are or who its target users are, the stdlib's design is simply bad and incorrect for any use case.

distortion park
Apr 25, 2011


Destroyenator posted:

there was a pretty compelling if whiney blog post last year (?) that i can't find now about how that was the common ms pattern. reimplementing the successful third party libs to make corporate developers comfortable and killing any good will or motivation in the open sores community

autofac was fine, why not just make that the default in asp core?

the microsoft di lib only does the basic, sensible stuff and has one obvious and easy way to use it. there's still a place for autofac and co if you want to do dumb weird poo poo

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer

pointsofdata posted:

the microsoft di lib only does the basic, sensible stuff and has one obvious and easy way to use it. there's still a place for autofac and co if you want to do dumb weird poo poo

yeah but the standard 3rd party libs like autofac or ninject did that fine too. i've never needed them to do more than "singleton scope" or "per request scope" and they're fine

entity framework didn't offer anything compelling over nhibernate

same with the logging frameworks

at some point though ms spend money to make an "approved" library that covers the work that their (limited) open source contributors have built up around the platform and everyone who's spent time or effort on those libraries is disincentivised from even doing dotnet open source again. why could they not pick a winner in a space and spend the effort supporting documentation on best practices and maintenance?

this isn't my fight, it just seems like a corporate decision that actively harms the ecosystem

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?

Soricidus posted:

the problem is that if you leave any obvious gaps, you might still end up with kitchen sink libraries but now there are several of them

indeed, this

in the past I’ve heard some people use the rule that a two- or three-line convenience doesn’t need to be API

the problem is that then every project implements that convenience rather than the one library where it should be

I think of this as the -[NSArray firstObject] problem, since for a long time there was public API for -lastObject but none for -firstObject so every project wound up implementing the latter in their own extension

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?

Sapozhnik posted:

My main complaint about the C++ stdlib is the fact that it made an atrocious gently caress-up of something as fundamental as strings and string processing, but it is extremely badly designed in a number of ways. Never mind the inability of C++'s originators (I will not flatter them with the title of "designers") to decide what the language's actual objectives are or who its target users are, the stdlib's design is simply bad and incorrect for any use case.

yes indeed

and honestly this is why I’m not a fan of the C++ stdlib sucking in ever more functionality—it’ll be done in a sucky way that doesn’t actually match any platform/OS and then the C++ fans will insist on using the stdlib version “because it’s standard”

see the history of the C++ efforts to incorporate graphics and sound for examples: proposals that were outdated decades before they were written, with the explicit intent of undermining platform APIs, a one-two punch of suck

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?

Destroyenator posted:

entity framework didn't offer anything compelling over nhibernate

sure it did: Entity Framework was a clone of Core Data while Hibernate/NHibernate was a clone of the Enterprise Objects Framework (to which Core Data was the successor)

but really the important part is having one shared framework used by all applications rather than a different framework in every application; it means lower system footprint and incremental improvement via shared bug fixes, performance enhancements, and new features

like whenever I see people saying they want to use SQLite directly rather than Core Data, the odds are that they’re going to just reimplement parts of Core Data with more bugs and worse performance, making all the same mistakes everyone else makes in implementing database access

Sapozhnik
Jan 2, 2005

Nap Ghost
This was my one forlorn hope when the Terminal HTML5 Brain outbreak started

"Well, they'll probably standardize on a standard API for embedding each platform's built in HTML5 implementation, right? They surely won't keep taking up 300MB of memory per application with their own individually-compiled copies of Chrome? Right?"

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
entity framework is total garbage and is the one 1st party .net thing you should completely avoid

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