New around here? Register your SA Forums Account here!

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
simble
May 11, 2004

Carthag Tuek posted:

open a new question on stack overflow & upload the image there, then copy the imgur url without posting the question

lol

this is for all intents and purposes the approved way to do this on github. open an issue, upload an image, grab the URL and use it on a github page or whatever.

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

simply embed images in posts as base64

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?
just render every page to minified JavaScript that constructs the required DOM

mystes
May 31, 2006

If only the forum software would allow us to upload webassembly modules that would render content to a canvas.

Ocean of Milk
Jun 25, 2018

oh yeah
I think I may have found an actual good post on reddit:

/r/pcj posted:

quote:

It amazes me that this industry accomplishes anything at all
/uj We are all riding on the exponential growth curve that is processing power, it’s almost impossible to gently caress it up so long as you are present. It’s like if your land is increasing exponentially in value, even if you’re a loving moron who burns down their $10billion house during a gender reveal party (webshits), so long as you hang around the land value will outgrow the house price so much it’ll make the entire episode practically irrelevant.

You would never see such an orgy of inflated ego, misplaced expectations, and mental laziness if compute was growing linearly, all those people would be broke. But here, well, rising tide lifts all boats and all that.

This but it's normal capitalism insanity instead of computy boi go fast

Soricidus
Oct 20, 2010
freedom-hating statist shill
ctps: trying very gently to convey to a very junior colleague that it is often possible to solve problems by reading the documentation or searching stack overflow before asking me how to concatenate two lists or w/e

mystes
May 31, 2006

Soricidus posted:

ctps: trying very gently to convey to a very junior colleague that it is often possible to solve problems by reading the documentation or searching stack overflow before asking me how to concatenate two lists or w/e
Teach a person to fish, only with copy and pasting from stack overflow.

ChickenWing
Jul 22, 2010

:v:

mystes posted:

Teach a person to fish, only with copy and pasting from stack overflow.

give a jr a SO link, they work for a day


teach a jr to ask SO questions, they get Flagged: Duplicate for the rest of their life

Plank Walker
Aug 11, 2005

ChickenWing posted:

give a jr a SO link, they work for a day


teach a jr to ask SO questions, they get Flagged: Duplicate for the rest of their life

ask SO questions, get SO answers

distortion park
Apr 25, 2011


Why do js devs hate DI and do weird mocking stuff which breaks constantly

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.

pointsofdata posted:

Why do js devs hate DI and do weird mocking stuff which breaks constantly

They've got a little bit of the Go disease: afraid of doing anything the same as common Java solutions, even if it was a good thing

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
js devs are used to being mocked, so they turn around and mock others. maybe if people were nicer to js devs?

piratepilates
Mar 28, 2004

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



pointsofdata posted:

Why do js devs hate DI and do weird mocking stuff which breaks constantly

because its very easy to do it in javascript, and seems like a fun thing to write on your own

disclaimer: no I don’t do it and I think all forms of mocks that aren’t just an object passed in to a constructor that has the same interface are bad and a different code smell

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

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


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

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

Share Bear
Apr 27, 2004

i have still yet to really understand the usefulness of it, because the code still breaks and people still push updates that even with mocks and loose coupling just loving crash all over the place, and despite complaining in this thread multiple times about it already

i generally can't understand oop and probably won't start now

abraham linksys
Sep 6, 2010

:darksouls:
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"

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


didnt the last oop discussion in this thread land on oop being so successful you just happened to no longer conflate oop concepts and ideas with oop anymore? sorry if that was another poster

Shaggar
Apr 26, 2006

pointsofdata posted:

Why do js devs hate DI and do weird mocking stuff which breaks constantly

cause everything in js is global so why do you need to inject it?

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Shaggar posted:

cause everything in js is global so why do you need to inject it?

and/or everything is already injected so why mention it

Share Bear
Apr 27, 2004

Beamed posted:

didnt the last oop discussion in this thread land on oop being so successful you just happened to no longer conflate oop concepts and ideas with oop anymore? sorry if that was another poster

yes this is correct, and what i only recall of 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

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

Arcsech
Aug 5, 2008

DaTroof posted:

yeah but ooth every java di framework is ridiculous nonsense

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.

Sapozhnik
Jan 2, 2005

Nap Ghost
Guice literally just calls constructors for you, how is it difficult to just ... call them yourself somewhere instead.

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"

Redux makes your components into a function of the state of the entire universe so when I think of a system that lends itself well to unit testing Redux is not the first thing that comes to mind.

raminasi
Jan 25, 2005

a last drink with no ice
i've only used two di frameworks before and in both cases, 90% of the time, they were cool and good. lifetime management (a complicated thing) was handled in discrete, well-defined spots in the application, rather than being strung out all over the application, and my dependencies just appeared out of the aether when i needed them.

the other 10% of the time the dependencies from the aether were wrong and i had no idea how to fix them because the code to actually instantiate things was buried four layers deep in a third-party library

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

Progressive JPEG
Feb 19, 2003

the di frameworks i've used were only useful for creating runtime failures for things that otherwise would have been build errors

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
that is the best description of a dependency injection framework i have ever seen

Sapozhnik
Jan 2, 2005

Nap Ghost
Depends on the di framework. Dagger makes a point of moving those failures back to compile time, for instance.

distortion park
Apr 25, 2011


Beamed posted:

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

yeah it's great. does just the things it should do with minimal amount of magic, all in normal code.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
java DI is ok if you don't do classpath scanning.

everything should be explicitly created.

piratepilates
Mar 28, 2004

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



Sapozhnik posted:

Guice literally just calls constructors for you, how is it difficult to just ... call them yourself somewhere instead.


Redux makes your components into a function of the state of the entire universe so when I think of a system that lends itself well to unit testing Redux is not the first thing that comes to mind.

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.


DaTroof posted:


side note: angular still loving sucks

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)

piratepilates fucked around with this message at 15:12 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

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

gonadic io
Feb 16, 2011

>>=
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

Schadenboner
Aug 15, 2011

by Shine

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

:sever:?

:shrug:

gonadic io
Feb 16, 2011

>>=

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

Schadenboner
Aug 15, 2011

by Shine

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

Either paying-down tech debt is a priority for management or it's not. If it's a priority then they need to devote time to solving the problem (and if they won't then it's not actually a priority).

If they do consider it a priority then they need to be made to see that it has to have resources devoted to it (which, perforce, cannot be used to plink tickets while so devoted) and if they can't be made to understand this we could be looking at a more fundamental problem (management not understanding the fish/cut-bait nature of either solving new business or solving old business) which suggests they don't value their worker's time sufficiently?

:shrug:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

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

is there any downside to continuing as you are?

feel free to tell management you're gonna keep paying down tech debt as you go, regardless of whether that's formally accounted for, because you know what you're doing. but feel free not to

Adbot
ADBOT LOVES YOU

piratepilates
Mar 28, 2004

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



DaTroof posted:

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

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.

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