this post was submitted on 28 Nov 2023
586 points (97.7% liked)
Programmer Humor
32461 readers
651 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It looks exactly like c++ and c# and java and probably others.
Java only has
instanceof
andgetClass
, not typeof.But neither c++ or Java have typeof
Standard C does not have typeof. That's just a compiler extension...
Also the equivalent of typeof is most likely decltype or auto.
Typescript! Though it's less useful, since the Typescript types aren't available at runtime, so you'll just get
object
for non-primitive values.Probably because Java and C# take much inspiration from C++. They aren't called "C-based" languages for nothing 😉