• 0 Posts
  • 14 Comments
Joined 2 years ago
cake
Cake day: June 4th, 2023

help-circle

  • This seems like common sense, no?

    Hindsight is 20/20. As seen in the post, there’s not that many APIs that don’t just blindly redirect HTTP to HTTPS since it’s sort of the default web server behaviour nowadays.

    Probably a non-issue in most cases since the URLs are usually set by developers but of course mistakes happen and it absolutely makes sense to not redirect HTTP for APIs and even invalidate any token used over HTTP.







  • If the project does not properly document how to get started with contributing either in the readme or the contribute file, either ask if you really want to help out or don’t bother.

    If contributions are wanted in larger projects they will have a very thorough documentation on how to setup your development environment.

    Always try to get the project running as is before trying to make any changes.

    Next up, start small. Like, very small. Many projects have issues that are marked as “good first issue”, they are usually small changes that can be done even by newcomers.

    As for syntactic issues, you have 2 options. Either take a closer look at the coding guidelines for the project and the language or use ChatGPT. Just tell it what language/libraries and ask it what the following sample code does. You can ask follow up questions if anything is still unclear.

    I use it primarily for C++ and C since I’m really bad at it and some C code look like it summons cthulu.


  • When I come across pieces of code I don’t understand just by reading them I like to run them through ChatGPT and ask it what it does.

    It does a really good job at explaining them and you can even ask follow up questions and it will go into more detail.

    It’s essentially StackOverflow but nobody calls you an idiot for asking stupid questions.





  • Much better to just have two columns, so e.g. you can see “enabled” and an 'enabled_date" that indicates when you last enabled/disabled the entity.

    That sounds good until you realize you now have two sources of truth, do you trust enabled or enabled_date? If you really want to go this route enabled should be a virtual field that checks enabled_date in the background so you can have the boolean semantics but still keep a single field.

    I also used booleans a lot previously but since using Laravel I have come to enjoy the updated_at, created_at and deleted_at fields that it automatically creates and I follow this format as well now if I need more.