Naming Things in Code

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 16

  • @Nosceres
    @Nosceres Рік тому +2

    OK. This is criminal: why doesn't this video have more views? It's well made, clear, and well presented. C'mon people! These are rookie numbers for profession work. Let's get those numbers up, people! Up, up, up!

  • @tehyonglip9203
    @tehyonglip9203 Рік тому

    for those who think your code is only gonna be written once, a good naming is still very beneficial, it forces the user to know exactly what data is he storing, thus, it makes error less likely and easier to debug if there's an error.

  • @onhazrat
    @onhazrat Рік тому +1

    🎯 Key Takeaways for quick navigation:
    00:00 🧐 Naming in code is crucial because the reader often has less context than the writer, making code readability a priority.
    02:07 📚 Good naming speeds up code comprehension and reduces the chance of misunderstandings.
    03:02 📝 Best practices for naming include using descriptive nouns for data and verbs for functionality.
    05:07 ✅ Longer, descriptive names are often better for clarity and understanding.
    07:11 📜 Stick to naming conventions in your programming language or style guide.
    08:08 🚫 Avoid using very short or one-character names and including types in variable names.
    09:46 🚫 Avoid vague words like "util," "lib," "service," or "data" in names.
    11:55 🎩 Don't use "magic numbers"; give them meaningful names for clarity.
    Made with HARPA AI

  • @akuoko_konadu
    @akuoko_konadu Рік тому +2

    Wow, i learnt a lot, especially combining two nouns to name a data

  • @homomorphic
    @homomorphic 5 місяців тому

    What you're neglecting is that a reader is almost certainly reading for the purpose of being able to write. That means that convenience of the writer is of nearly equal priority.
    Not disputing any of the recommendations just that the motivation is definitely for support of writer as well as reader.

  • @ShadeSlayer1467
    @ShadeSlayer1467 4 місяці тому

    I have recently gotten into the habit of being more verbose in my C# projects and I find that when designing I write my high level code in almost plain English including variable/function/class names. And Then I go back up to the top and hit Alt+Enter then Enter on each line to "generate whatever code" and the implement that code. It forces you to write the whole project before testing, but it only codes what you need, rather than designing each part one at a time and doing full unit tests all the way up. (This is just the first pass, i usually go back and refactor a ton)

  • @sonluuh
    @sonluuh Рік тому +2

    straight forwad. A reflection from me, I often use the alphabet order to naming files, modules. For example, I would like to put the name like
    `date_start.py` & `date_end.py` instead of `start_date.py` & `end_date.py` to quickly lookup them at the same time in the folder tree.

  • @tmbarral664
    @tmbarral664 Рік тому +2

    9:24 - you may name the parameter n "times" ;)

  • @matthimuller
    @matthimuller Рік тому +1

    Nice content, thank you!

  • @ShadeSlayer1467
    @ShadeSlayer1467 4 місяці тому

    Naming Things
    -Objects are Nouns
    -Functions are Verbs
    -Less is More
    -Description is more

  • @FLUTTER_HUB
    @FLUTTER_HUB Рік тому

    awesome

  • @ferroalloys594
    @ferroalloys594 4 місяці тому

    The very use of the term "code" as a synonym for the more accurate term "source description" sadly suggests a fundamental limitation in what follows.... There is no intentional or unintentional attempt to ENCRYPT or even subsequently decrypt anything whatsoever in any correct conventional sense of the term code!!!

  • @baxsm
    @baxsm Рік тому +1

    good video, solid examples!