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

Adbot
ADBOT LOVES YOU

DaTroof
Nov 16, 2000

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

Shinku ABOOKEN posted:

what is so extreme about systemd? every service that systemd provides you have to do anyways so you might as well integrate it in your service manager and get it over with. the argument about it being single point of failure is something I don't buy since for such a critical component you better have a single point of failure and focus your attention there instead of a billion points of failure.

yeah, kinda true


MrMoo posted:

Usually with Systemd cruft doesn’t stay around too long.

lol

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
dependency injection as a concept is cool and good

dependency injection frameworks are frequently terrible

DaTroof
Nov 16, 2000

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

Beamed posted:

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

yeah but ooth every java di framework is ridiculous nonsense

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:

the only js framework i know of that has embraced DI as a concept was angular and, well, that didn't go super well on a number of fronts

with react/redux a lot of the time the patterns actually lend themselves pretty well to not needing mocking since there's usually some layer of indirection you can test instead (testing that an action is dispatched instead of mocking out a method on an object). a lot of times stuff that would be provided by a DI container can live in some top level component and get accessed through context, for things like api clients and whatnot, which... i dunno that's basically DI, if you're coming from the perspective of "DI is basically just passing dependencies as arguments to things"

yeah, that's more or less my perspective. you don't need a framework to follow the pattern, and sometimes a framework introduces complexities that just make poo poo worse

DaTroof
Nov 16, 2000

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

Arcsech posted:

and drat near impossible to get rid of if you fall into the trap of relying on them too hard

the codebase at work has been trying to rip out guice for literal years after realizing how bad it is. 90% of our use has been replaced by explicitly constructing things, which works a lot better.

guice is one of the specific examples i was thinking of. also whatever eclipse rcp calls its di framework. jesus. just jesus

side note: angular still loving sucks

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:

at work for testing react components that are connected to the redux store, I've just been exporting the unconnected component to be tested with, and exporting the connected components as the default export to be used in the app.

limit the scope of the props you're passing down from the global store, and add them to proptypes, and testing redux-connected components hasn't been bad for us, we just pass in the props that would be passed down from the `mapStateToProps` function and don't worry about simulating the global state.


I haven't used angular since the initial version (before they changed the name from AngularJS to Angular, and rewrote the whole codebase) but christ what a shitshow of complexity and unnecessary new terms that was.

then react came out and it was so much simpler and straightforward :shrug: (but also powerful enough to run one of the most trafficked front-page heavy websites in the world)

yeah, i've had much more success (and a much more pleasant experience) using react. i've worked less with redux, but only because most of my react apps are relatively small, and passing a data interface to the top-level component is frequently good enough

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

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

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

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

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,

DaTroof
Nov 16, 2000

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

code:
touch(butt) if butts.add?(butt)
i coulda sworn there was a similar alternative in python but apparently not

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
i typically expect the commit message to tell me what changed since the last commit, so idgaf what the first commit message is. might as well be blank

DaTroof
Nov 16, 2000

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

Soricidus posted:

you must be disappointed a lot

well...yeah

also

Symbolic Butt posted:

"initial commit" is fine because the README of your project at that point serves as a detailed "commit message" describing what's going on


Soricidus posted:

you must be disappointed a lot

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
idgaf if the development process uses merge, squash, or headbutts as long as the deployment process shuts you down for being stupid

the earlier it happens in the process the better, but please have safeties at the deployment level

DaTroof
Nov 16, 2000

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

Illusive gently caress Man posted:

my recent pet peeve is when a function starts out clean. like it has one or two input parameters and returns a value. nice

later, someone adds another parameter like like "bool do_slightly_different_thing" or "also_do_other_thing." mayyybe this is reasonable.

repeat 1-3 more times. now the function is 10x harder to understand and annoying to refactor because it's called in multiple places for only tangentially related purposes.

is there a pithy phrase for this problem?

an over-generalized abstraction?

e: premature generalization?

DaTroof fucked around with this message at 17:24 on Oct 27, 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

Boiled Water posted:

i tried but it ruined my ubuntu install

yeah, booting into ubuntu always ruins a perfectly good post

DaTroof
Nov 16, 2000

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

CRIP EATIN BREAD posted:

that domain is hilarious and don't you deny it

DaTroof
Nov 16, 2000

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

jesus WEP posted:

reader mode is such a good instakill for anti-adblock bullshit

holy poo poo, i never tried that. it works pretty consistently

DaTroof
Nov 16, 2000

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

Powerful Two-Hander posted:

"this code was generated by a tool" lol you got that right visual studio

DaTroof
Nov 16, 2000

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

Powerful Two-Hander posted:

this one is funny because it goes through loads and loads of problems caused by chasing an architecture based on it being hip rather than practical, but instead of providing and alternative s or solutions just goes 'guess we better just keep trying lol!:

the statement of "if you use a single database you introduce problems like accidentally dropping an index or being unable to determine what is touching a table" is not some incredible problem you can't solve, it's a problem you created yourself by being an idiot and doing a classic webdev "a database is a mysterious filing cabinet key value store we have no ability to influence".

so of course the solution is some bullshit involving various aws services

reminds me of a coworker who constantly pushed for nosql in new projects (usually parse server) because he was completely incapable of imagining how to use an rdbms without implementing an eav anti-pattern

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
my current job just had a devops guy who was promoted by attrition ask the engineering team "does this database really need to be relational" and welp now i have to decide between being the voice of reason and going down with the ship

nb: i'm not going down with this dumbass fuckin ship

Adbot
ADBOT LOVES YOU

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
sisyphus because it will inevitably get stuck in an infinite loop

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