Specifically, printf is an oddball function because it uses the varargs mechanism, and the whole format strings mechanism is inherently risky because it effectively bypasses the type system and says "trust me." Back when I was learning C, on a Mac with THINK C, misusing printf was a sure-fire way to crash the computer very quickly, especially since misaligned accesses of 16-bit or 32-bit words caused crashes. Compilers now go to a great deal of trouble to try to do additional safety and consistency checks.
Don't get my wrong, I grew up using printf, and it is massively useful. But it was designed when computers were much smaller and simpler, and design tradeoffs were made back then that probably wouldn't be chosen today. So printf, along with a whole family of related functions, has been a seething mess of a security and safety hole longer than most programmers have been alive.
The popular C compilers have a feature where they will do some additional type checking on the arguments passed to "format" functions. You can mark your own functions with this attribute.
printf is not an oddball function. Also, typechecking format strings in general does not have to be that complicated. They are still used in golang.
Of all the security pitfalls of C, the format string design of printf is way down the list. As others have noted, printf is not what makes the C type system weak.
Sure, but that's varargs being the special cased but, not printf (I've written printf implementations for some ebedded systems, it's always just regular C code).
How do you start the radio? If you start it from a song of the genre you want to listen to now, or a playlist containing mostly that genre, it won't mix in random stuff you've liked before. I get very nice mood/genre radios just by starting them from some song I liked currently.
Usually from a song or playlist, and no matter where I've started it it will start mixing stuff in that isn't remotely similar. Unless it's trance or house.
I hate it when things like this get names that everyone's supposed to know and it's considered a mark against you if you've never heard it before, but I do think the name Elvis Operator is hilarious. :D
Also, a lot of other languages (Python, Ruby, JS, etc.) can do the same thing with their OR operator:
b = list.next.to_s || "Reached end of list."
If list.next.to_s is non-nil, then the OR statement is short-circuited and list.next.to_s will be assigned to b. If b is nil and "Reached end of list." is non-nil, then OR statement will return the string literal to be assigned to b instead. Thus,
a = b || c || 0
would be the equivalent for those languages.
edit: One BIG downside to this I forgot to mention at first: If nil and a false value are both possible for a variable, then this construction can betray you and break your heart.
Personally, I like the ternary operator, and I also like the nil-coalescing operator, but I'm quite aware that they can produce difficult-to-maintain code, so I'm careful with them. I have gone and done some silly stuff with both, but then, I realized that I was leaving unmaintainable code.
If you use godbolt.org, you can actually see what code is produced by the source.
For me, using pure git is fine when working on solo projects. The benefits of such services is when there are many developers in the same project. Gives a good overview of issue reports, what commits are linked to what issues, easy "pull request" overviews/quick reviews without checking out branches etc. It's more about the social and less about the source control for me
Personally I think you should skip the /r/ or /i/ part of the paths. Always bothered me that reddit has it - communities are central to these sites so IMO they should be the first part of the path
Why would informing people about the importance of testing make you look like an asshole? You could do it in a polite and helpful way, instead of being an asshole about it.
> the article in question called it an asshole thing to do [publicly calling out and blaming others]
It's all about how it's done. In the case described above, an explanation of what happened, why it happened, how to avoid it in the future, and perhaps a little humor would be positively received by everyone involved.
On the other hand, someone could very well have the exact same situation and make it into a-hole incident by shaming the interns and making them reconsider even being there.
Automation takes this and a whole class of problems out of the interpersonal domain. Failed tests make the build fail. Who ever breaks the build buy donuts for the team. Easy, solved and no personal issues. Include a linter in the build, incorrect formatting fails the build. The team decided on the standard format (tabs vs spaces, 4/2 spaces, brace same line or next line etc). More donuts. No arguments because linting rules were decided by the team. New members adapt.