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
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
jquery and react don’t really do the same thing? seems funny to compare them except as "popular JavaScript things"

also you can totally use react without a node toolchain, just plop in a script tag

Adbot
ADBOT LOVES YOU

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
Vue is better for that

React assumes you use jsx

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
everything is bad

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.
vue is nice enough for the simple ltittle poo poo I’ve built with it.

is google web toolkit (GWT) still a thing or did that die with Java 1.5 and generics?

Sapozhnik
Jan 2, 2005

Nap Ghost

animist posted:

typescript's type system is stupidly powerful. honestly i've never used another language with nicer unions:

code:
interface Banana {
   kind: "banana",
   color: string,
   peeled: boolean
};
interface Apple {
   kind: "apple",
   color: string,
   leaves: number
};
function examineFruit(fruit: Apple | Banana) {
   console.log(fruit.kind);
   console.log(fruit.color); // valid
   // console.log(fruit.peeled); // invalid; not all members of `Apple | Banana` have a `peeled` member
   if (fruit.kind == "banana") {
      console.log(fruit.peeled); // valid; fruit is now inferred to be `Banana`
   }
}
this works for unions of as many types as you want.

of course, it's still javascript, so it'll run slow and have weird edge cases. and also the type system is full of unsafe holes. but it works well enough for what it is

you are like a little baby, watch this



it's kind of hosed up how good typescript is

redleader
Aug 18, 2005

Engage according to operational parameters

akadajet posted:

you know. like a tesla

teslajs would make a great name for a new js framework

dick traceroute
Feb 24, 2010

Open the pod bay doors, Hal.
Grimey Drawer

redleader posted:

teslajs would make a great name for a new js framework

A really expensive one you can pretend is an environmental choice?

redleader
Aug 18, 2005

Engage according to operational parameters

dick traceroute posted:

A really expensive one you can pretend is an environmental choice?

plus it regularly explodes, kills bystanders, or drives into nearby firetrucks

metaphorically, of course

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

akadajet posted:

angular 7 works just fine
can confirm

of course its not on the fifth backwards-incompatible version of its router, like react, so i guess it makes people worry about their job security or some such

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
hot take: state management in react is in fact terrible and redux and hooks are quite literally golang levels of bad

gonadic io
Feb 16, 2011

>>=
https://mobile.twitter.com/babaisyou_/status/1110991655816122373

gonadic io
Feb 16, 2011

>>=

Sagacity posted:

hot take: state management in react is in fact terrible and redux and hooks are quite literally golang levels of bad

Oh yeah talking of, since work pivoted and my job search has not been successful yet I've been a full time golang developer for more than a month now.

Actually not too bad for small applications, as our sophistication is growing though we're really starting to feel the lovely tooling though. Eg the lack of a vendoring solution. Lots of copy pasting.

Go modules are 100% mandatory, now they exist I lead the charge on some -400k loc prs to remove vendored dependencies like lol whoever thought that was a good solution

Because we're not really trying for much code reuse I'm not feeling the lovely type system as bad as I thought I would. it'd be nice to have proper unions though for domain modeling

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Feisty-Cadaver posted:

vue is nice enough for the simple ltittle poo poo I’ve built with it.

is google web toolkit (GWT) still a thing or did that die with Java 1.5 and generics?

one app team actually moved to gwt within the last few years. I mean yeah they moved from some desktop VB gui garbage (that iirc had hard session binding so "we've run out of dB connections" was a regular occurence) but still, why not move to literally anything else?

DaTroof
Nov 16, 2000

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

pokeyman posted:

jquery and react don’t really do the same thing? seems funny to compare them except as "popular JavaScript things"

they do different things but i've never run into a case where i had to use them at the same time

quote:

also you can totally use react without a node toolchain, just plop in a script tag

it's been a while since i tried that, but iirc it ran like dog poo poo. idk though, the bottleneck might have been something else

Aramoro
Jun 1, 2012




A couple of months ago I did a full test applications in Angular 7, React with Redux and Vue.js for PoC for moving from a V1 frameworks. It all really depends on what you're trying to do in the end. For us Angular 7+ is the best fit because we're looking at a client application not a website, 30 developers, long development timescales and continuous work and rework on components. If you're making a 1 shot website or web app with a small team I would say React, ditch Redux. If you're doing something non-commercial then try Vue. The documentation for all of them is terrible.

Any competent developer will be able to bash together something in any of them relatively quickly. It's all about your use cases and ongoing maintenance plan.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
how much of an improvement is angular 7? it would have to be pretty goddamn significant to make me stop thinking angular is an unusable trash fire

Aramoro
Jun 1, 2012




DaTroof posted:

how much of an improvement is angular 7? it would have to be pretty goddamn significant to make me stop thinking angular is an unusable trash fire

No idea, I've not used any of the previous Angular2+ versions. One of my colleagues thinks it's a massive improvement over AngularJS. You just have to make some choices at the start to avoid it going out of control, like we'll use Directives this way, our Router config will be this, our Forms will be that etc. Our intention is to rewrite 200K+ lines of JS into a new Angular app and it looks like it'll work for that.

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Aramoro posted:

No idea, I've not used any of the previous Angular2+ versions. One of my colleagues thinks it's a massive improvement over AngularJS. You just have to make some choices at the start to avoid it going out of control, like we'll use Directives this way, our Router config will be this, our Forms will be that etc. Our intention is to rewrite 200K+ lines of JS into a new Angular app and it looks like it'll work for that.

this is pretty sound advice for any software project isn't it?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Boiled Water posted:

this is pretty sound advice for any software project isn't it?

yes, but a good framework will guide you towards the correct decisions by default (pit of success etc.) while a bad framework will have seventeen ways to do the same thing and leave you with no documentation to help you figure out which one won’t be deprecated in a year

Aramoro
Jun 1, 2012




Boiled Water posted:

this is pretty sound advice for any software project isn't it?

It is, but for some reason people seem to have less design discipline when doing web apps in my experience. Probably because JS is garbage so doing anything that works is fine.

SAVE-LISP-AND-DIE
Nov 4, 2010
Js frameworks that force my colleagues to stop using lovely hoisted vars as globals are a good thing. Now we import a singleton Vue instance to every file instead

Xarn
Jun 26, 2015
ctps: My job position was just renamed from "Software engineer" to "Researcher"

Guess I was just too terrible? :v:

Soricidus
Oct 21, 2010
freedom-hating statist shill
angular 7 is 6 better than angular 1. that’s quite a lot better!

HoboMan
Nov 4, 2010

q: does redux actually do anything???
like im trying to test it out and i can't even figure out what im supposed to do with it

e: posting on POS page

akadajet
Sep 14, 2003

HoboMan posted:

q: does redux actually do anything???
like im trying to test it out and i can't even figure out what im supposed to do with it

e: posting on POS page

yeah. it does state management and pumps up your slocs

pseudorandom
Jun 16, 2010



Yam Slacker
I like Vue, at least for the little bit I've used it. Seems relatively straight forward and a little more light-weight compared to the other big frameworks. Plus I get to sit around being :smug: while everyone argues about Angular vs React.


Of course, if you want to skip javascript you could just compile Rust to wasm. :getin:


Sapozhnik posted:

Also make sure you use TypeScript and Parcel in your project as well.

animist
Aug 28, 2018

Sapozhnik posted:

you are like a little baby, watch this



it's kind of hosed up how good typescript is

:hai:

HoboMan
Nov 4, 2010

pseudorandom posted:

Of course, if you want to skip javascript you could just compile Rust to wasm. :getin:

my former coworker was making a framework for this.
also a javasript to rust converter.
bless his heart.

animist
Aug 28, 2018

HoboMan posted:

also a javasript to rust converter.
bless his heart.

what??

CPColin
Sep 9, 2003

Big ol' smile.

Sapozhnik posted:

it's kind of hosed up how good typescript is, compared to JavaScript, and average, compared to other, decent languages

fixed

animist
Aug 28, 2018

typescript has a better tooling/typesystem quality combo than any other language, change my mind

The Fool
Oct 16, 2003


Considering typescript is just Microsoft trying to make javascript be more like C#..

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
typescript's type system is significantly above and beyond c#. it's basically Anders Hejlsberg's playground for wacky ideas

animist posted:

typescript has a better tooling/typesystem quality combo than any other language, change my mind

https://twitter.com/garybernhardt/status/1007690864909529088?s=21

bernhardt is good at explaining things, but he's also that most tedious form of "optimize your life" nerd

Sapozhnik
Jan 2, 2005

Nap Ghost

Sagacity posted:

hot take: state management in react is in fact terrible and redux and hooks are quite literally golang levels of bad

correct, don't use either of those things

Sapozhnik
Jan 2, 2005

Nap Ghost

this is such a bullshit comparison

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Sapozhnik posted:

this is such a bullshit comparison

don't worry about it too much, he's got some weird hangups to say the least

HoboMan
Nov 4, 2010

but also: apps are slow and i hate it.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
yeah gently caress redux, at first it feels like needless complexity for its own sake, but the react architecture is so loving terrible it really does need something like redux or it ends up being less maintainable than without redux.. but I can't shake the feeling that a well organized hierarchy of js files could get you to the same place without all the extra bullshit.

I am a really terrible js programmer, though, so please correct me if I'm wrong (I'm prob very wrong)

Doom Mathematic
Sep 2, 2008
I have not yet come to a solid conclusion about whether Redux is a good or bad thing overall. I think I haven't used it properly yet.

It's good because it means in theory nearly all the state for your entire application can be kept in a single data structure operated on by a strictly defined collection of possible actions. This is amazingly easy to unit test. Meanwhile, because they have no internal state, your components become incredibly simple (in a lot of cases, functional) which likewise is insanely easy to test. This feels like an improvement over the state of the application being distributed across every component instance in the application, and it means that if a thing happening in one component needs to affect something in another component, it's very easy to make that happen.

It's bad because the connector component which links the React component to Redux is relatively complex and annoying to test. The song-and-dance around defining all of your actions up front and then carefully instantiating and dispatching them feels very boilerplatey and, as mentioned, increases the codebase size. It also makes it harder to produce a reusable component which can be consumed by third parties - do they have to rig up an identical state object in order to use it? Or do they have to reproduce the whole interface between the component and the state store themselves? There might be workarounds for these. There might be other bad things I haven't run into yet or which I'm forgetting.

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

yeah i am also a v terrible javascript programmer, but i got the sense that adding redux wasn't really doing anything except adding a bunch of boilerplate that makes my code hard to read

in exchange i get... a state machine i mostly had to make myself?

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