by khazhoux · 3y ago · 0 comments
std::cout << "You have " << itemCount << " items of type " << itemType << "." << std::endl;
When I could do this: printf("You have %d items of type %s.\n", itemCount, itemType.c_str()); printf("You have %d items of type %s.\n", itemCount, itemType.c_str());
When I could do this: std::println("You have {} items of type {}.", itemCount, itemType);
https://en.cppreference.com/w/cpp/io/printEdit: Oh, it's in C++23 standard. Only took them 38 years! ;-)
We do students a disservice teaching them how to “code” first. And not instead how to solve problems with code
But a real fucked up mental model to bake into an entire industry’s worth of developers
I also don't know any school, college or university that starts their programming courses in a webbrowser. Typical languages in Germany for a first semester algorithms/data structures class are either Java or C++.
puts "You have #{itemCount} items of type #{itemType}."
print(f"You have {itemCount} items of type {itemType}.")
console.log(`You have ${itemCount} items of type ${itemType}.`)