Ad
  • Custom User Avatar

    I'm personally not a fan of this solution, since you are not storing the first and last name seperately in the object. This might have a use later.
    The formatting into a string should happen in the get_full_name method.

  • Custom User Avatar

    I guess the comments make it clear. @Blind4Basics, when I first read your comment and then I read the comprehension it does make sense. So I guess I can say that it would be best practice to write such a thing when it has comments so everyone knows what's happening.

  • Custom User Avatar

    Alright, thanks for your answer!
    It really makes it much clearer to me why this way of programming would be used. It is very true that a programming language needs to evolve and create easier ways to programs certain things.

    I do however still stand by my point, and this is my own opinion, that this is too unclear and I would never write this code in a project with other members.

    When code is written this way, I really believe it should have some comments to explain what it does.

    PS: I never said this was wrong ;)

  • Custom User Avatar

    Al lot of people are calling this best practice, but I don't really get that. It's a very smart and clever solution, but it is not clear at all. That's a requirement for being best practice! Good code is readable to beginners, even when written by an expert.
    Correct me if you believe I'm wrong, I'd like to hear your opinions about this.