23

Trying to explain functions to my coworker and why they should be used even if powershell scrips don't 'need' functions
I've explained it 5 different ways across multiple meetings when they've gotten stuck on something.

At this point I've decided 1. I don't have the patience or brains to be a teacher..., 2. I'm going to have to review every script they ever fucking write, 3. I'm never letting them work on anything critical or time sensitive for big clients. (Small clients ehhh) I'll fight my boss to avoid that headache lol

Comments
  • 3
    @bigmonsterlover badly
  • 1
    It seems reusing code is not something your co-worker likes. I admit, I have a folder full of small snippets in PS that I use without functions, but I definitely see the advantage of using them.
  • 1
    @CodingTripledad for small things yeah sure. I have a folder full of snippets and scripts too. But they're writing a large script doing a lot of things at once and I feel it needs the structure of functions and also make it readable for anyone else who may need to work on it
  • 3
    @jester5537 create a script that parses scripts. If the number of lines to function ratio is too high then flag the script for review.

    Can you detect functions in scripts easily? I don't do powershell so I don't know.
  • 1
    @Demolishun that's a cool idea. If I can think of a good way to do it I'll try. Thanks for the idea
  • 2
    @jester5537 I feel you, man. We had a system change lately that required functions (MSSQL server) to be used to return some code. We had people write the same function three times, but with different fixed values and I was like "Wtf guys, write a master function and then just call it with parameters, it's not hard. Otherwise a single change will have to be done three times.".
Add Comment