• 1 Post
  • 79 Comments
Joined 7 months ago
cake
Cake day: November 24th, 2023

help-circle


  • Sadly it doesn’t fix the bad documentation problem. I often don’t care that a field is special and either give a string or number. This is fine.

    What is not fine, and which should sentence you to eternal punishment, is to not clearly document it.

    Don’t you love when you publish a crate, have tested it on thousands of returned objects, only for the first issue be “field is sometimes null/other type?”. You really start questioning everything about the API, and sometimes you’d rather parse it as serde::Value and call it a day.










  • RustyNova@lemmy.worldtoProgrammer Humor@programming.devUniversity Students
    link
    fedilink
    arrow-up
    3
    arrow-down
    3
    ·
    edit-2
    21 days ago

    It’s not that bad. It definitely helps in long functions.

    I’m an advocate for code commenting itself, but sometimes it’s just better to comment on what you’re doing, and in those cases it helps to over commentate.

    Instead of letting the reader interweave code reading and comment reading, I think it’s better to do either. Either you go full self describing code, letting the reader parse it as code,m, or you abstract everything, making it more of an explanation of your reasoning, and abstract lines that may look too complicated.

    Not every comment needs to be useful, but I still write them to not have this switch between reasoning and thinking in code. It can also double as rubber duck debugging too!





  • I don’t know and that’s the problem :(

    I keep asking myself what to choose, only for changing it a day after cursing myself to choose a stupid name.

    Big endiant is great for intellisense to quickly browse possibilities, since it groups it all in the same place. But that’s also a detriment when you know what you want. You can start typing without the prefix but you’ll have to go through the better suggestions of intellisense first.

    Little endiant is the same thing, but in reverse. Great when needed, but bad for browsing.

    Although I do have some fix I’m starting to use. But it’s not applicable everywhere, and not in every language.

    What I do is use module as prefix. Instead of dialogue_file_open, I create a file_open in the dialogue module, allowing either directly calling file_open, or dialogue::file_open. Using intellisense on the module allow for easy browsing too!

    Although in OP’s post I’d rather have file_open_dialogue as it convey the more significant meaning, being to open a file, first. Then “dialogue” is just the flavour on top