> When you're designing a function, you may be tempted to add a flag. Don't do this. Here, let me show you an example: Suppose you have a messaging system and you have a function that returns all the messages to an user, called getUserMessages. But there is a case where you need to return a summary of each message (say, the first paragraph) or the full message. So you add a flag/Boolean parameter called retrieveFullMessage. Again, don't do that.'Cause anyone reading your code will see getUserMessage(userId, true) and wonder what the heck that true means.
What about in languages with named parameters? I think keyword arguments solve this issue pretty well.
> You’d be surprised by the number of candidates who say they are “senior software engineer” or “10 years experience as a lead developer” who still can’t do FizzBuzz. Or the ones who can do it but takes them 100 lines of code.
I see comments similar to this one all the time. Are folks literally referring to the 'FizzBuzz' problem, or is that just an alias for a problem they subjectively find easy?
First of all, zzzeek, thanks for your great software. While working on SQLAlchemy, have you ever run into situations where you really missed static typing? Do you ever see yourself wanting to introduce Python's static typing behavior into that project, and why or why not?
The most common issue I run into is with datetime objects, but there are well documented workarounds. For more complex objects such as ORM objects, I think a lot of people use Marshmallow. That being said, I don't have a lot of experience, so I could be missing something obvious. What issues have you had with Python JSON serialization?
> If web developers don't already all know this then what knowledge do they have nowadays?
Read the article's title. This article is clearly aimed at people who are starting to learn web development. It is not aimed at experienced web developers.
> ...these were all skills I had mastered before even attempting to define what type of development I wanted to do
Many people learn how to program by working on projects they want to work on, and a lot of people want to build web applications.
I absolutely relate to this. But hey, knowing that there are other engineers out there feeling the same thing when they read HN makes me feel better. So, thanks.
What about in languages with named parameters? I think keyword arguments solve this issue pretty well.