Hacker News new | past | comments | ask | show | jobs | submit login

As someone on more or less the maximum dose of adderall, here are the commandments as I have been able to divine (for myself):

  - Thou shalt use a language server.  Esp. goto-definition and find-refs, as they shall light your path through third party libs.

  - Thou shalt refactor like a crazy person.  No component should have less than 3 or more than 5 significant members.  A concise codebase makes for a calm mind.

  - Thou shalt use black formatting, and obey *all* recommendations from the linter.  Thus shall the structure of your code always explain it's function.

  - Thou shalt use mypy, as it is The Way.

  - Thou shalt follow the way of the Unix, creating isolated components that Do One Thing Well and define concrete APIs between them.  Thus shall you both tame the Spaghetti Monster and save bits of your work from the maw of the great destroyer This-Is-Too-Complex-So-Let's-Rewrite-The-Whole-Thing.



1: I'm using vscode and the microsoft tools for Python, so I have the LSP for Python installed and running. I've also got treesitter running. The MS Python tools are at https://marketplace.visualstudio.com/items?itemName=ms-pytho...

2: This I need to do. I wanted to use the Traitlets module for my config parameters/data so I need to refactor that part of the app.

I did wonder about something like a TerraformCloud class because so far I have a bunch of methods in there: search_workspaces, get_workspace_id, get_variable_id, is_workspace_used, get_unused_workspace, enable_workspace_module, set_workspace_as_used, set_variable, start_workspace_run, and probably more in future. Should I be breaking those up into TerraformCloud, TerraformWorkspace, and WorkspaceVariable? Sorry for the question, I am still learning, and the terrasnek module is helping a lot with all this Terraform stuff.

3: I do use the black formatter. The only thing I question is its line-length rule.

4: I didn't know about mypy, that's pretty great and I'm super grateful!

5: Yeah, I am probably failing hard at that one. I will try to return to The Holy Path Of Unix.

Thank you for all of these. I'm so very grateful for your help!


Given the mention of great destroyer This-Is-Too-Complex-So-Let's-Rewrite-The-Whole-Thing, you seem like you know what you're talking about, but I can't comprehend the actual lesson you're trying to impart.

Would you kindly ELI5?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: