Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

09-17-2018 , 02:33 PM
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).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 02:36 PM
the curly braces hug my code, making it warm and safe
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 02:49 PM
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!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 02:51 PM
My code is like a millennial -- some of it is old enough to drive.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 02:55 PM
ABP
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 03:14 PM
Quote:
Originally Posted by suzzer99
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 03:21 PM
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;
  }
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 03:42 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 04:44 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-17-2018 , 05:50 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 06:31 AM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 11:44 AM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 06:16 PM
Quote:
Originally Posted by Wolfram
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 06:38 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 06:43 PM
Quote:
Originally Posted by goofyballer
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 06:45 PM
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?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 07:08 PM
Quote:
Originally Posted by suzzer99
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
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!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 07:43 PM
Quote:
Originally Posted by Wolfram
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?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 09:11 PM
Quote:
Originally Posted by suzzer99
Also what are they going to do - sue you?
Yes

Quote:
Originally Posted by :::grimReaper:::
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 09:55 PM
i think he's asking what the negative consequences are
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 11:25 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-18-2018 , 11:27 PM
Quote:
Originally Posted by goofyballer
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-19-2018 , 06:33 AM
Quote:
Originally Posted by suzzer99
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-19-2018 , 10:30 AM
I see it as a much less stressful and more chill time working. Seems nice.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-19-2018 , 10:55 AM
Quote:
Originally Posted by Wolfram
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.
Mostly I'm just messing with you. I'd do the same thing.

I guess you must be a quant or something. I just play with web apps so no one gives a **** where I go or when I go there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m