Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 06-10-2020, 10:51 PM   #39701
Victor
Carpal \'Tunnel
 
Victor's Avatar
 
Join Date: Jul 2003
Posts: 63,916
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I know this is blasphemy but I dont think unit testing is worthwhile. better time spent elsewhere.

now, I love unit testing. I like to write code and I learn a lot writing tests bc I like to challenge myself and the frameworks and the code in general. but spending an entire day or more on just a couple tests surely isnt worth it. esp when most unit tests boil down to true=true. and the ones that take time are bc I am trying to prove something to myself about how the code works.

and depending on the work you do, damn near all devs are gonna test their actual code on locally or on a dev server regardless of the tests they write so whats the point?
Victor is offline   Reply With Quote
Old 06-10-2020, 11:03 PM   #39702
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: givin' 'em the business
Posts: 96,761
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

The point is when you have to go back to some code 6 months later and you don't remember anything about how it all works - good unit tests will save you from a day of wrestling with it to understand it again.

Our Facebook login stopped working Tuesday. For some reason Facebook and Google integrated with AWS cognito had always returned nothing for email_verified (the field didn't exist). Whereas cognito would return true or false for users who signed directly. So I had a check for email_verified === false, which worked fine.

But then all of a sudden Google starts showing up as email_verified = true for all users and Facebook as email_verified = false for all users. Fun stuff. Because of my unit tests I was able to quickly find all the spots where I needed to change the logic, and be confident I could push a hotfix w/o worrying about breaking something else.

As a one man show on a lot of my stuff with no testing team to speak of, good unit tests (and integration and e2e tests) allow me to wrangle a large code base with an order of magnitude less effort than if I didn't have them - even taking into account the effort up front to write the tests.
suzzer99 is offline   Reply With Quote
Old 06-11-2020, 04:42 AM   #39703
OmgGlutten!
Pooh-Bah
 
OmgGlutten!'s Avatar
 
Join Date: Aug 2016
Posts: 5,239
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Tests make a big difference as the framework changes and u have to go rewrite stuff. Maybe less relevant on the front end where stuff is usually more isolated by default.
OmgGlutten! is offline   Reply With Quote
Old 06-20-2020, 03:52 AM   #39704
DontGoft
newbie
 
Join Date: Sep 2019
Posts: 45
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Biggle10 View Post
The part I'm struggling with mentally is the time to do it. I've read plenty where people say once you're used to it it doesn't add that much more time to your DEV process and saves time in the long run. But for example, management/product owner says how long will it take to do feature x. I say a week as I am including some time to write tests, etc. Management says is there anyway to make that faster as customer really needs that feature right now and a week seems too long. Since I'm new to unit testing stuff, I could do it faster if I ignored it but I'm not sure how to answer that question then to management.

As an aside, that particular manager is no longer here and the way we do estimation is different now, but I'm reflecting back on how I could've/should've done things differently.
Probably the type of management you are describing doesn't care about unit testing.

I've been there, and it is tough, but how you address that, it depends.

You just say your time, don't say it takes my five days, but without test, it takes me two.

First, you decide if you do test or not. Ideally, you should always do unit testing, but there are some factors that maybe you shouldn't do it.
Maybe it is a legacy product, and if you do unit tests, it will take you forever.

Unit testing is a trade-off between cost now and benefits later.

But the thing is you need to deliver a quality product, and if you feel your product is going to decline in quality if you don't do unit testing (probably bugs), then you need to do unit test no matter how long it is going to take.
DontGoft is offline   Reply With Quote
Old 06-28-2020, 01:51 AM   #39705
Aceium
Carpal \'Tunnel
 
Aceium's Avatar
 
Join Date: Jan 2007
Location: Kansas City
Posts: 7,333
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

If anyone in here has played Hearthstone, I have a question for you.

How would you describe the lag in the transition that occurs when you find a Worthy Opponent while searching for a game? - In terms of computation?
Aceium is offline   Reply With Quote
Old 06-28-2020, 02:35 PM   #39706
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 13,080
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Aceium View Post
If anyone in here has played Hearthstone, I have a question for you.

How would you describe the lag in the transition that occurs when you find a Worthy Opponent while searching for a game? - In terms of computation?
Matchmaking time, if that's what you're asking
_dave_ is offline   Reply With Quote
Old 06-28-2020, 04:13 PM   #39707
Aceium
Carpal \'Tunnel
 
Aceium's Avatar
 
Join Date: Jan 2007
Location: Kansas City
Posts: 7,333
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I assumed that the matchmaking was happening while the spinner was spinning. Before you enter the match, the spinner seems to stall and hang for a couple seconds before it shows "Worthy Opponent". I'm wondering what would cause this type of lag before almost every game. It seems very un-Blizzard from a polish perspective.
Aceium is offline   Reply With Quote
Old 06-29-2020, 11:19 AM   #39708
jmakin
DoorDash Balla
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 29,103
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Shitty app. It also sometimes forgets its screen orientation so you need to flip your phone over and back again to fix it.

When theyíve had these bugs for years and donít fix them you can assume itís just bad design, IMO
jmakin is offline   Reply With Quote
Old 06-29-2020, 01:51 PM   #39709
Aceium
Carpal \'Tunnel
 
Aceium's Avatar
 
Join Date: Jan 2007
Location: Kansas City
Posts: 7,333
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

That's kind of why I brought it up. It seems unlike Blizzard to have that sort of an "eyesore" in their game for a long time, unless it's exceedingly hard to fix. I would love to hear one of their systems guys talk about the challenges of keeping the Unity experience smooth.

Something like, "Yeah that's an annoying hiccup, but in order to fix it we would have to totally redesign the whole process of playing a game, and we don't want to break more stuff by trying to smooth out that transition. The transition might be smoother but there's a possibility we would go back to the days of minions spontaneously moving around on the board, which is worse than the matchmaking lag."
Aceium is offline   Reply With Quote
Old 07-01-2020, 01:03 PM   #39710
Biggle10
veteran
 
Biggle10's Avatar
 
Join Date: Jul 2005
Location: St. Louis/ Ultimate Frisbee pitch
Posts: 2,926
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Aceium View Post
I assumed that the matchmaking was happening while the spinner was spinning. Before you enter the match, the spinner seems to stall and hang for a couple seconds before it shows "Worthy Opponent". I'm wondering what would cause this type of lag before almost every game. It seems very un-Blizzard from a polish perspective.
I've noticed that too. When I first started playing I thought the app was freezing, now i don't even notice it really as its just part of the start game process.
Biggle10 is offline   Reply With Quote
Old 07-03-2020, 04:01 AM   #39711
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: La La Land
Posts: 23,586
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Anyone here familiar with server side rendering? It's VueJS.
daveT is offline   Reply With Quote
Old 07-03-2020, 04:54 AM   #39712
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: givin' 'em the business
Posts: 96,761
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I'm familiar with Angular Universal and NextJS and I can confirm they're both a half-baked PITA.
suzzer99 is offline   Reply With Quote
Old 07-03-2020, 05:04 AM   #39713
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: La La Land
Posts: 23,586
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I'm not surprised... I heard Angular and React are both significantly worse than VueJS. If that's the case, I feel for front-end devs.

VueJS has something called NuxtJS, which writes routes for you because that's a good thing, I guess? I tried out something called Quasar, which at least somewhat looks like normal VueJS, but it's totally confusing.

The big issue is this, copied from the official SSR docs:

Code:
// Server-side only
  // This will be called by the server renderer automatically
  serverPrefetch () {
    // return the Promise from the action
    // so that the component waits before rendering
    return this.fetchItem()
  },

  // Client-side only
  mounted () {
    // If we didn't already do it on the server
    // we fetch the item (will first show the loading text)
    if (!this.item) {
      this.fetchItem()
    }
  },
Except mounted doesn't actually work for anything. Ask around, I'm told "you don't know anything about SSR, SSR isn't front-end, RTMFD!"

I just want item A to be rendered client-side and item B rendered server side.

Last edited by daveT; 07-03-2020 at 05:16 AM.
daveT is offline   Reply With Quote
Old 07-03-2020, 05:15 AM   #39714
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: givin' 'em the business
Posts: 96,761
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Vue is supposed to combine the best of each and be much simpler. I have no real experience with it.

I'm not 100% sure but I'm going to guess NuxtJs and NextJs are cousins?

There are cases where you'd like to SSR say the top 4 boxes which show when a user hits the home page, but lazy-load (CSR) the rest if they scroll down. Or optional things that don't happen often but you need to load something when the user takes action - like say opening a drawer or something.

I'm guessing mounted() is for that.

But I can definitely say that the official docs for angular universal are shite and it was clearly half-baked and never really went anywhere. NextJs seems to have a lot more support. But we're using an offshoot of that which I have no faith in. But again, I don't know how that relates to NuxtJs.
suzzer99 is offline   Reply With Quote
Old 07-03-2020, 05:30 AM   #39715
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: La La Land
Posts: 23,586
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I don't know anything about Nuxt, but I'd guess with a name so close, it must have taken some inspiration. I started up trying to go all vanilla SSR VueJS. Sure learned a lot, but went with Quasar instead.

In client-side only, mounted() is basically an init() for the component. It mutates the initialized data and updates the corresponding values so they display in the html before rendering.

The server-side init() is serverPrefetch(), which stages the data to be used in a `computed` property that initializes the data / function for the html.

For what you are describing, you would probably need a `watch` property, but not sure, really.

As I understand the point of mounted() in the context of SSR:

You have a "store" that contains all the data for the page (basically a massive JSON file). It makes no sense to call the data again if it is already in the store, so mounted() would fire instead of serverPrefetch().
daveT is offline   Reply With Quote
Old 07-03-2020, 10:54 AM   #39716
slenderhusband
journeyman
 
slenderhusband's Avatar
 
Join Date: Jan 2013
Posts: 233
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

For those who are doing JS-based web-development, how much do you actually write vanilla JS day-to-day compared to using frameworks (i.e. React, Express) to abstract away complexity and repeated code? Since I went to a pretty theory-heavy CS program and didn't take any software development electives I basically didn't learn JS at school, but been taking it up lately to become more well-rounded. The language itself is pretty easy since it's C-based, but the actual web-development process seems to get annoying really fast as project size increases. Manually dealing with DOM elements seems incredibly error-prone should there be changes in the structure of the page, writing REST APIs requires to do the same stuff over-and-over again, so on.
So what I'm basically asking is how much does vanilla JS actually get used in the industry and how would you rate the difficulty of your job as it is right now vs. if you had to do everything in just JS without frameworks. I'm asking this because I'm wondering if I should actually become expert in vanilla (should I ever want to try my hand in web-development) or it should be taken more as a base foundation that is nice to know, but the real meat lies in being well-versed in frameworks.
slenderhusband is offline   Reply With Quote
Old 07-03-2020, 11:05 AM   #39717
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: givin' 'em the business
Posts: 96,761
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I think it's totally worth it to learn the basics of JS. You can always pick up frameworks any time once you have that.
suzzer99 is offline   Reply With Quote
Old 07-03-2020, 11:30 AM   #39718
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: https://unstuckpolitics.com
Posts: 5,663
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

No one manually manipulates the dom in 2020. Vanilla javascript is not the dom, if you want to learn JS learn the ins and outs of its core methods and properties (arrays, mostly, map filter reduce), not "document.getElementById('foo').classList += ' bar'" and crap like that, react etc will do all that for you.
Grue is offline   Reply With Quote
Old 07-03-2020, 11:40 AM   #39719
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: givin' 'em the business
Posts: 96,761
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I beg your pardon sir. I am having to hack this form-process framework-thing called alfresco, which has its own super complicated front-end framework (ADF) based on angular 2. To get it to do what we want, rather than including jquery and adding even more overhead, I'm dom-manipulating all up in that ****. I'm getting elements by class name, setting classes, listening to click events. It's all kinds of fun. The only thing I haven't to pull out yet is document.write().

But yeah - learn the JS language stuff and nuances - especially scope, closures, hoisting and the other advanced features of JS. Very valuable. It's very rare you have to do the stuff I'm doing.

Last edited by suzzer99; 07-03-2020 at 11:48 AM.
suzzer99 is offline   Reply With Quote
Old 07-03-2020, 02:00 PM   #39720
PJo336
THRILLHOUSE!
 
PJo336's Avatar
 
Join Date: Mar 2007
Posts: 22,040
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

JavaScript ended up being suitably enjoyable once es6 came around and I discovered it was more than the dom manipulation grue describes. Manual dom stuff is for the birds
PJo336 is offline   Reply With Quote
Old 07-03-2020, 02:02 PM   #39721
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: givin' 'em the business
Posts: 96,761
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I'm actually enjoying it in a retro kind of way.

But I do not plan to write my own jQuery.
suzzer99 is offline   Reply With Quote
Old 07-03-2020, 03:56 PM   #39722
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: La La Land
Posts: 23,586
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Frameworks are great for layouts, DOM, and reactivity, which I appreciate, but out of that scope, you're in a world of hurt if you aren't willing to write vanilla JavaScript.
daveT is offline   Reply With Quote
Old 07-03-2020, 05:19 PM   #39723
slenderhusband
journeyman
 
slenderhusband's Avatar
 
Join Date: Jan 2013
Posts: 233
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Thanks for the replies. All of the concepts mentioned here I'm already familiar with but it's mainly DOM/reactivity that gives me headaches when trying to work with this stuff on front-end. Will probably pick up a framework at some point to make my own life easier, but I still feel like got plenty of learning to do about the intricacies of the language first.
slenderhusband is offline   Reply With Quote
Old 07-03-2020, 07:11 PM   #39724
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: https://unstuckpolitics.com
Posts: 5,663
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

What are you actually trying to do? If its "make a great interactive web UI for an application" you should probably just use react, now.
Grue is offline   Reply With Quote
Old 07-03-2020, 07:31 PM   #39725
PJo336
THRILLHOUSE!
 
PJo336's Avatar
 
Join Date: Mar 2007
Posts: 22,040
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

or Vue
PJo336 is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 07:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online