24
KALALEX
2y

Who ever prefixes their table names like this should be sentenced to death.

tbltable_name or tbltablename

Is that some kind of sadistic fetish or something.

My eye can’t fucking pinpoint the first letter, thus I can’t easily find the table. I have seen it so many times!!! This trend has to STOOOP.

Prefix it tbl_table_name for all i care ffs.

Comments
  • 2
    I’m only prefixing the views with “v” like v_view_name. I don’t see the point to do that for tables.
  • 10
    wordpress bitches be like
    wp736_some_bullshit_table_56
  • 4
    Prefixing table names is like prefixing classes. In relational database design, the table is the main concept everything revolves around. Same for class-based OOP where the class is the main concept. It gets less controversial when it comes to indexes or interfaces though (although there is an argument for using the same naming scheme for classes and interfaces because whether it is one or the other is an implementation detail the user should not think about).
  • 0
    that reminds me of naming conventions for stuff in ABAP.
  • 1
    @C0D4 I hate the way they name tables. And deploying a site from localhost is such a PITA. Also why do they prefix the resources name with the absolute value of the site url. Ugh !
  • 0
    @PappyHans some ui “database inspectors” can group based on prefix which is sometimes helpful if you have a huge schema and have features like prefixes.

    But yeah I agree with you fuck that “tbl” prefix in the ass.
  • 1
    @soberGhost fucking satanists trying to summon kthulu of bad naming conventions and mass confusion.
  • 0
    This are the same people who name their variables after their type (in a statically typed language)
  • 2
    @happygimp0 not quite. What you are describing is Hungarian notation. It’s still crap today, but not as idiotic as using prefixes to describe what it is.

    There is a rule I read somewhere but I can’t find it anymore.

    The rule says: Don’t describe what it is. Describe what its purpose is.

    E.g. don’t include "table" in table names, "class" in class names, "object" in variable names, "file" in file names.

    Whenever there is an actual benefit in deviating from that rule, the tool or language that you are using has ultimately failed.

    Why? Because the ultimate purpose of a language is to effectively communicate information. If the language can’t do it on its own without the need for such idiotic conventions, it’s a crap language.

    Yes, SQL is a crap language.
  • 1
    I'm getting horrible flashbacks of Moodle and it's unmanageable, giant model of tables with the mdl_ prefix
  • 0
    It makes sense to prefix tables with tbl or table you just do not have use for it. When writing functions within database it is hard to read the code if data is from table or from view or from other functions
  • 2
    It just a shitty practice stemming from either putting unrelated tables with potential colliding names into the same database (e.g. if someone wanted to install multiple CMSs into the same database), or from the idea that and attacker attempting SQL injection might be able to guess table name `users`, but not `f3w45ft_users`. Both of those are generally just shitty practices, but many people still go through the trouble of implementing table prefixes rather than solving those problems the right way.

    It's kinda how people still insist that SSH-ing as root is a major security risk, but SSH-ing as another user and then running "sudo bash" to get the root shell somehow makes it safe.
  • 0
    @rim01 No it does not for tables it’s like an unwritten law. You only prefix other entities like v_ or postfix _v for views.

    Functions, procedures etc should have verb-like names.

    @Lensflare describes it perfectly.

    If you name your functions func_name… I feel sorry for who ever touches your code bases. ✌️
  • 0
    @hitko SQL injection is a thing for the past in my mind and should be handled by payload sanitation.

    It’s something that it is either blocked by WAF long before it reaches the backend or handled by middleware.

    As for ORMs most (if not all) modern ones have sanitation enabled by default and they escape what ever is your “attribute” content.
  • 0
    How about erratically prefixing table names with the word 'data' 😖😣 in camelCase....
Add Comment