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 09-17-2018, 02:30 PM   #35276
well named
poorly undertitled
 
well named's Avatar
 
Join Date: Jun 2007
Location: esse est coesse
Posts: 75,725
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I wouldn't refer to my python and ruby experience as extensive, but it is ongoing. I'm not sure if ruby actually qualifies as "indentation-based" because it doesn't use it for scoping, but... it doesn't have curly braces and that's the distinction that matters to me :P

I'm fairly sure my aesthetic sensibilities are mostly just the result of familiarity, and eventually I won't mind as much. But I spend about 70% of my time right now writing typescript and 30% writing ruby, and I've yet to fully acclimatize to the ruby, although I'm getting better :P I feel like all the python I've written is pretty ugly too, but again I'm sure it's mostly just a lack of familiarity.
well named is offline   Reply With Quote
Old 09-17-2018, 02:33 PM   #35277
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Yeah for me just ditching the closing curly brace taking up its own line is good enough. Also the countless dev-hours I've spent in my life debugging brace/parens mismatches (which linting helps but still gets weird some times).
suzzer99 is offline   Reply With Quote
Old 09-17-2018, 02:36 PM   #35278
well named
poorly undertitled
 
well named's Avatar
 
Join Date: Jun 2007
Location: esse est coesse
Posts: 75,725
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

the curly braces hug my code, making it warm and safe
well named is offline   Reply With Quote
Old 09-17-2018, 02:49 PM   #35279
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Your code is like a millennial - when it finishes it needs a pat on the back for a job well done.

My code is alpha - it does what it wants and doesn't look back.

Last edited by suzzer99; 09-17-2018 at 02:50 PM. Reason: Er, my jade code anyway. My JS code still needs it's reassurance. But it wishes it didn't!
suzzer99 is offline   Reply With Quote
Old 09-17-2018, 02:51 PM   #35280
well named
poorly undertitled
 
well named's Avatar
 
Join Date: Jun 2007
Location: esse est coesse
Posts: 75,725
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

My code is like a millennial -- some of it is old enough to drive.
well named is offline   Reply With Quote
Old 09-17-2018, 02:55 PM   #35281
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 30,658
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

ABP
jmakin is offline   Reply With Quote
Old 09-17-2018, 03:14 PM   #35282
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 24,289
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Yeah for me just ditching the closing curly brace taking up its own line is good enough. Also the countless dev-hours I've spent in my life debugging brace/parens mismatches (which linting helps but still gets weird some times).
Debugging a mis-indented line is just as bad or worse. Besides nearly every editor will correctly indent based on curly braces so if you need indentation to debug scope then you can get it for free.

I have done about 5 years of 90% python development. I like indentation fine, but I prefer braces.

And frankly "taking up it's own line" is maybe a bit of a stretch. I really dislike it when people end an indented block and don't leave an empty line there. But with a close brace it's not usually needed because the line reads as mostly empty.
RustyBrooks is offline   Reply With Quote
Old 09-17-2018, 03:21 PM   #35283
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

A closing brace often needs another empty line after it imo. Otherwise the code just looks too bunched up to me.

I literally just added empty lines to this demo code to make it more readable. (See signUp function vs. the next two)

Code:
@Injectable()
export class AuthService {
  authIsLoading = new BehaviorSubject<boolean>(false);
  authDidFail = new BehaviorSubject<boolean>(false);
  authStatusChanged = new Subject<boolean>();
  registeredUser: CognitoUser;
  constructor(private router: Router) {}
  
  signUp(username: string, email: string, password: string): void {
    this.authIsLoading.next(true);
    const user: User = {
      username: username,
      email: email,
      password: password
    };
    
    const attributeList: CognitoUserAttribute[] = [];
    const emailAttribute = {
      Name: 'email',
      Value: user.email
    };
    attributeList.push(new CognitoUserAttribute(emailAttribute));
    
    userPool.signUp(user.username, user.password, attributeList, null, (err, result) =>{
      if (err) {
        this.authDidFail.next(true);
        this.authIsLoading.next(false);
        return;
      }
      this.authDidFail.next(false);
      this.authIsLoading.next(false);
      this.registeredUser = result.user;
    });
    
    return;
  }
  confirmUser(username: string, code: string) {
    this.authIsLoading.next(true);
    const userData = {
      Username: username,
      Pool: userPool
    };
    const cognitoUser = new CognitoUser(userData);
    cognitoUser.confirmRegistration(code, true, (err, result) => {
      if (err) {
        this.authDidFail.next(true);
        this.authIsLoading.next(false);
        return;
      }
      this.authDidFail.next(false);
      this.authIsLoading.next(false);
      this.router.navigate(['/']);
    });
  }
  signIn(username: string, password: string): void {
    this.authIsLoading.next(true);
    const authData = {
      Username: username,
      Password: password
    };
    const authDetails = new AuthenticationDetails(authData);
    const userData = {
      Username: username,
      Pool: userPool
    }
    const cognitoUser = new CognitoUser(userData);
    const that = this;
    cognitoUser.authenticateUser(authDetails, {
      onSuccess(result: CognitoUserSession) {
        that.authStatusChanged.next(false);
        that.authDidFail.next(false);
        console.log(result); 
      },
      onFailure(err) {
        that.authStatusChanged.next(true);
        that.authDidFail.next(false);
        console.log(err); 
      }
    });
    this.authStatusChanged.next(true);
    return;
  }
suzzer99 is offline   Reply With Quote
Old 09-17-2018, 03:42 PM   #35284
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: It is pitch black.
Posts: 5,630
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I like jade (pug) a lot and use it to this day. But it has its warts - using js variables/"escaping" out of it is just not pretty. For a pure parent/sibling/child tree structure sure **** curly braces. For things that require scoping and expressions and all that bring them on for sure. Especially with "the best thing made in the past 3 years" prettierjs. Maybe python is usable with "black" idk.
Grue is offline   Reply With Quote
Old 09-17-2018, 04:44 PM   #35285
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I prefer curly braces cause I'm used to them. I've done some python, and it's fine as well. It used to be a plus that white-space-significant programming languages forced more rigor in indentation which was good to teach good habits to new programmers, but with modern editors/autoformatters/linters I don't see that as a feature anymore.

And I don't agree that its in any way ugly to have a single closing line followed by a single white space. It makes the code more readable imo than the single white space delimiter does in python/ruby. But that's pretty subjective I guess.

Last edited by Wolfram; 09-17-2018 at 04:49 PM.
Wolfram is offline   Reply With Quote
Old 09-17-2018, 05:50 PM   #35286
Craggoo
culled
 
Craggoo's Avatar
 
Join Date: Sep 2006
Location: R.I.P. ItzPenzoo 12-09-11
Posts: 12,533
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Jade is pretty sweet. All that means is I definitely did not get to use it at my job. God forbid they actually do something I suggest.
Craggoo is offline   Reply With Quote
Old 09-18-2018, 06:31 AM   #35287
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Jesus,

They didn't let me leave early for my new job, so I had to work out the 3 month severance period. I'd heard from other people before that your motivation goes down the drain, but dang... I had no idea how hard it hits you.

What's especially tough is that I had just recently moved teams and am working in a pretty unfamiliar code base and tech stack, so every task requires a ton of energy to get up to speed on, and in the back of my mind there is this gnawing realization that what I'm learning will be useless to me in a couple of weeks.
Wolfram is offline   Reply With Quote
Old 09-18-2018, 11:44 AM   #35288
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,540
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

That seems crazy to me. I totally don't understand the attitude of forcing someone to do a job they no longer want to do. I can't imagine your productivity is particularly good.
jjshabado is offline   Reply With Quote
Old 09-18-2018, 06:16 PM   #35289
goofyballer
Carpal \'Tunnel
 
goofyballer's Avatar
 
Join Date: Jun 2005
Posts: 66,841
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Wolfram View Post
They didn't let me leave early for my new job, so I had to work out the 3 month severance period.
Explain? In the US (certainly in California, employment law might differ state to state) when you want to leave, you just quit, usually with two weeks notice for professional courtesy but legally you can just quit anytime.
goofyballer is offline   Reply With Quote
Old 09-18-2018, 06:38 PM   #35290
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Not if you want a severance package.

My company did a cheesy thing where you could either take the severance and quit almost immediately, or milk the final 3 months then get severance. But the catch was you had to actively look for other jobs within the company and someone offered you a job and you didn't take it, you lost your severance. They basically tried to scare you into leaving early. I don't think too many people bit.

My coworker and I figured - holidays coming, everyone's budget is cashed - the last thing hiring managers are going to do is go trolling for internal employees who either volunteered to get laid off, or were marginal enough that they got a forced lay off.

The internal chat room for the layoff was really sad. Lots of employees with 30+ years of service who had no idea where to start to even look for an outside job. They were all linked-in connecting because someone told them you need at least 400 connections.

I knew I wanted to go on my trip and I definitely needed the extra 2.5 months salary. I did **** all for those 3 months of course, but then again I had about 2 years of **** all before that.

Last edited by suzzer99; 09-18-2018 at 06:44 PM.
suzzer99 is offline   Reply With Quote
Old 09-18-2018, 06:43 PM   #35291
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by goofyballer View Post
Explain? In the US (certainly in California, employment law might differ state to state) when you want to leave, you just quit, usually with two weeks notice for professional courtesy but legally you can just quit anytime.
I signed an employment contract that has 3 months severance. It's pretty standard here. If they fire me they have to pay me for 3 months. If I want to leave, I have to give 3 months notice. It's quid pro quo, and gives you as an employee insurance against suddenly being jobless without warning, and the company insurance that they won't suddenly lose an employee during a critical time, and can onboard a replacement.

It's quite common however that if you resign your company lets you off the hook early because they realize that you won't be productive. My boss didn't want to because he said they needed all the help they could get to deliver our product. I definitely see his point, but man does it suck to wait out the final weeks.
Wolfram is offline   Reply With Quote
Old 09-18-2018, 06:45 PM   #35292
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

So - stop bathing, come to work in your pajamas, and run around bothering everyone until they fire you?

Also what are they going to do - sue you?
suzzer99 is offline   Reply With Quote
Old 09-18-2018, 07:08 PM   #35293
goofyballer
Carpal \'Tunnel
 
goofyballer's Avatar
 
Join Date: Jun 2005
Posts: 66,841
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Not if you want a severance package.
I thought that's for if you get fired, not leaving voluntarily? Wolfram's explanation makes sense for where he's at, but we don't sign contracts like that here so I've never heard of getting severance for sticking around longer when quitting.

Quote:
Originally Posted by suzzer99 View Post
But the catch was you had to actively look for other jobs within the company and someone offered you a job and you didn't take it, you lost your severance.
Why would anyone take this insane offer? If you're leaving, then presumably it's because you don't want to work at that company any more!
goofyballer is offline   Reply With Quote
Old 09-18-2018, 07:43 PM   #35294
:::grimReaper:::
veteran
 
:::grimReaper:::'s Avatar
 
Join Date: Jul 2010
Posts: 2,578
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Wolfram View Post
I signed an employment contract that has 3 months severance. It's pretty standard here. If they fire me they have to pay me for 3 months. If I want to leave, I have to give 3 months notice.
What if you don't get give 3 month notice?
:::grimReaper::: is offline   Reply With Quote
Old 09-18-2018, 09:11 PM   #35295
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Also what are they going to do - sue you?
Yes

Quote:
Originally Posted by :::grimReaper::: View Post
What if you don't get give 3 month notice?
As soon as you give notice the 3 months start ticking from the end of that month.

I'm really confused. Don't you guys know what a contract is? They are legally binding. Breaking them has negative consequences.
Wolfram is offline   Reply With Quote
Old 09-18-2018, 09:55 PM   #35296
this_passing
소녀시대 애교 대박
 
this_passing's Avatar
 
Join Date: Apr 2009
Location: leaving a legacy
Posts: 6,383
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

i think he's asking what the negative consequences are
this_passing is offline   Reply With Quote
Old 09-18-2018, 11:25 PM   #35297
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

But do you really think they’re going to take you to court over a few months of getting paid for doing nothing?

And again - have you considered trying to get fired? Maybe sexually harass your boss.
suzzer99 is offline   Reply With Quote
Old 09-18-2018, 11:27 PM   #35298
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by goofyballer View Post
Why would anyone take this insane offer? If you're leaving, then presumably it's because you don't want to work at that company any more!
It was a layoff. Most people didn’t volunteer. I did but I still needed the money.

Generally the term severance refers to money you get when laid off. Which is why I got confused with Wolfeams post at first.
suzzer99 is offline   Reply With Quote
Old 09-19-2018, 06:33 AM   #35299
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
But do you really think they’re going to take you to court over a few months of getting paid for doing nothing?
No, if I show up and do nothing all day then they can't do anything to me. That wouldn't solve anything though and be worse than actually trying to be productive. But if I don't show up and start working at another company then there would be consequences.

Number one it would be extremely unprofessional and reflect badly on me. This is a small market and word would definitely get out. My new employer wouldn't be happy about it either and might even fire me. I would essentially be breaking both my old contract and my new one, since the both contracts specify that I can not be employed at other places while working there.

Besides all that, I have a great relationship with my coworkers and boss and wouldn't have it in me to do any of these things.

And I don't see why they couldn't sue me for small claims. I would still be on the payroll and in breach of contract so they could show damages. But I am not a lawyer so I don't really know. If the situation was reversed, I showed up and did the work and they didn't pay me, then I could definitely sue them.

Mostly though I'm not a huge ******* (imo) so I would never do this.

Last edited by Wolfram; 09-19-2018 at 06:42 AM.
Wolfram is offline   Reply With Quote
Old 09-19-2018, 10:30 AM   #35300
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,697
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I see it as a much less stressful and more chill time working. Seems nice.
Larry Legend 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 05:46 AM.


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