• 40 Posts
  • 1.3K Comments
Joined 1 year ago
cake
Cake day: September 1st, 2023

help-circle


  • It’s about memory management.

    In programming terms: allocated memory has to have the data in it that you expect in order for your program to work. The unsafe languages do it by manually ensuring it’s good and doing so mostly at runtime, or just assume the data is valid and write code that looks valid and have somebody check it before the program runs, or do a mix thereof. In all cases, it require a lot of human intervention and because humans are fallible with different skill levels, this fail quite often.

    Safe languages are either built on top of unsafe languages that are battle tested and do lots of runtime checks behind the scenes (interpreted languages like python, ruby, javascript, etc.). Then there are languages that check actions at compile time like Rust. They tell you that the memory you’re trying to access can be modified by another part of the code, which might make unexpected changes and that in order to access it, certain conditions have to be met.

    In laymans terms: imagine you work at a storage facility (memory) and have to store and retrieve packages. To know where to store and retrieve them, you have a piece of paper with the aisle, shelf, and rack and position on the rack. That’s your pointer. To store something, you have to make space on a rack and put the item there, write down the name of the item (variable) and location on a piece of paper (memory address), and keep it on you.

    Imagine keeping all of that in order. You have to make sure you don’t write down the wrong location (off by one error), remove a piece of paper then it’s not valid anymore (dangling reference), remove a piece of paper without removing the item (memory leak), add a piece of paper pointing to something without actually checking what you expect to be there is there and then retrieve it later, and so many other things.
    Those are the things unsafe languages allow you to do.

    Safe languages either enforce that before doing certain things, you check stuff (runtime checks) or that before you even start doing anything, you plan how you would do, and that plan is checked.

    The crazy storage facilities are what most of our world runs on at the moment and there a whole lot of people who love it because it’s simple and they know it. “Just tell the intern to get that box there, I made sure it’ll be fine. Trust me, I’ve been doing it this way for years.” meanwhile somebody gets the wrong medicine because a piece of paper said another one was supposed to be on the shelf. There are a bunch of people who have thought about ways to improve it, implemented, tested it, and are using it to manage their storage facilities.

    Anti Commercial-AI license
















  • Thank you for typing all that out. PHP seems to have come a long way (or at least thanks to Laravel). Probably the reason I still encounter projects without Laravel are because there are many old and established PHP projects out there from before whenever it became popular. Probably switching to a new framework is too much work for them (quite understandable), but they have unfortunately majorly tainted my PHP experience.

    I’m glad you’re enjoying PHP and have given me another perspective on the subject.

    Anti Commercial-AI license





    • express the project in your language in max 5 words
    • merge them e.g big long table index --> blotin, blotidex, bilotadex, big ol tadex
    • search for “word for $expression” and peruse the results
    • translate the expression into other languages then do the same as above
    • find synonyms for the words in your expression
    • build an expression that is the opposite of your project and just prefix it with a negative then repeat above
    • find a pun from your expression
    • pick your favorite animal (or pick random one) tack it onto the expression and repeat above
    • take your own name and use initials then spell out the initial e.g John Wallace -> J.W -> Jay Dub
      • tack that onto the expression (or the expression it fits best) e.g Jay Dub Index, Jaydudex, Judex, Dubidex, Jadubin

    Or if you want to be completely unoriginal like, take a wordlist, pick a random word from it --> tada! You have a name. (what follows ia rant). The list can be an entire dictionary, anime names, movie names, name of mythical gods from wherever in the world, etc.
    Then come up with some bullshit explanation that sounds sophisticated for example you randomly picked.

    For example, I went to https://randomword.com/ and got “xylary”: “of, like or pertaining to xylem.” No bloody idea why “xylem” is? Yeah, me neither.

    noun Botany.

    a compound tissue in vascular plants that helps provide support and that conducts water and nutrients upward from the roots, consisting of tracheids, vessels, parenchyma cells, and woody fibers.

    Oho, great! It has nothing to do with a big long table index, but let’s make it so! “Xylary is a performant database index. Just like xylem are paramount to performance of plants, xylary is paramount to the performance of queries to your database.” Voilà. The meaning of xylary is botched, but who gives a fuck, it sounds COOL, starts with X, and probably unknown to the majority of the world. So now you can piss off people in the field by polluting searches with your project.

    But at least you have a project name bro 😎

    Anti Commercial-AI license