6
shine
4y

why am I feeling so guilty about this? should I be feeling guilty about this?

PS : this is not a support request. I genuinely feel bad about writing that piece of code and sense something is wrong somewhere, but I cannot figure out what. I stared at the screen for quite a while before giving up.

maybe it might reveal itself to me when I continue staring at it tomorrow.

Comments
  • 1
    You can tell them I said it was ok and they can blame / fire me.
  • 1
    @N00bPancakes would that work with my 'programmer conscience' as well? It is my programmer conscience that is taking the hit for this. :/
  • 0
    @shine

    It works like this, not a lot of room for debate after that:

    https://youtube.com/watch/...
  • 1
    If you're dealing with Python dicts, you could probably skip those ifs and just write

    for rbt in rtbls.get('rtb', []):
  • 0
    @hitko you're right. why didn't I think of the 'default' value?! 🤦‍
  • 2
    I get it, I would feel guilty for using a terminal like that as well
  • 1
    @ScriptCoded terminal like what? What's wrong with my terminal? I love my terminal. I do everything on a terminal.

    If it wasn't obvious enough, it wasn't the terminal that I was guilty about. It was the nested if-for loops that I was guilty about.
  • 1
    @shine That ugly green stuff!
  • 1
    @ScriptCoded rEaLhAcKeRz use green on black ok!
  • 0
    I feel your pain. There’s no easy way to do this, and personally I think you’re doing great. Terraform is the cursed prodigal child. Regarding Terraform apps, If it works, and it’s easy to read.... ship it. Terraform code is different, and working with TFState is even worse. Terraform isn’t meant to be DRY, or elegant, or performant. It has one job, and whatever fucking code you have that makes it work, run with it.

    I completely understand what you’re doing and I have never seen your code before. I’d fully support that in my prod stack.
  • 0
    @C0D4 I don't know whether you meant that comment in sarcasm or not.

    I'm no hacker ( as in cracker ), but I really like my green on black terminal.

    @ScriptCoded
  • 1
    @devphobe I'm surprised you figured that the file was a terraform state parser.

    And based on your comment, I have a feeling that you been through the same pain before.

    That aside, I like Terraform as a tool. I don't think its a prodigal child or anything. Its neat. And like you said, it does one thing and does that well. I like that.

    But yes, I also agree that it isn't DRY or designed with NASA-grade efficiency or performance. Well, I guess that is the side-effect of designing a whole configuration language.
Add Comment