Click here to Skip to main content
15,881,204 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Favorite way to categorize programming languages? Pin
englebart12-Feb-22 17:09
professionalenglebart12-Feb-22 17:09 
GeneralRe: Favorite way to categorize programming languages? Pin
Memtha11-Feb-22 17:23
Memtha11-Feb-22 17:23 
GeneralRe: Favorite way to categorize programming languages? Pin
Chris Schaller14-Feb-22 11:06
professionalChris Schaller14-Feb-22 11:06 
GeneralRe: Favorite way to categorize programming languages? Pin
trønderen14-Feb-22 12:27
trønderen14-Feb-22 12:27 
GeneralRe: Favorite way to categorize programming languages? Pin
Memtha14-Feb-22 12:51
Memtha14-Feb-22 12:51 
GeneralRe: Favorite way to categorize programming languages? Pin
James Lonero17-Feb-22 7:46
James Lonero17-Feb-22 7:46 
GeneralRe: Favorite way to categorize programming languages? Pin
atali14-Feb-22 16:24
atali14-Feb-22 16:24 
RantRe: Favorite way to categorize programming languages? Pin
Memtha14-Feb-22 16:58
Memtha14-Feb-22 16:58 
Imo the difference in that respect between c++ and c# is part of the broader difference that C#'s runtime second-guesses your every instruction while c++ takes your word for it. In both cases, the cast makes it past the syntax check with the same meaning: "trust me, these are the same". The exception is when C#/java will fail validation if the known strong-type cannot possibly also be an instance of the casted type; but that is not applicable to c++ because of multiple-inheritance, an object could always exist that inherits from both of them.

C#'s second-guessing compares "the actual type" via reflection to the casted type, whereas most if not all c/c++ programs at runtime make no definition of type and no support for reflection; that's a runtime distinction, not part of the language for the same reason that compiled vs interpreted is not part of the language. As far as if the language itself is strongly typed goes, they are the same. A c++ compiler and runtime could be invented that does the same as C# without changes to the language itself, or vice versa. I believe such a c++ compiler could even be compliant, with enough effort.

The same applies to accessing an array with an invalid index, c# throws an error right away, because it first checked that the index you gave it matched what it knows to be valid, whereas c++ will trust you and perform the operation, likely resulting in a subsequent error (because the cpu second-guesses you at a more security-oriented level i.e., DEP).


modified 14-Feb-22 23:05pm.

GeneralRe: Favorite way to categorize programming languages? Pin
obermd14-Feb-22 6:20
obermd14-Feb-22 6:20 
GeneralRe: Favorite way to categorize programming languages? Pin
Mike Hankey11-Feb-22 10:37
mveMike Hankey11-Feb-22 10:37 
GeneralRe: Favorite way to categorize programming languages? Pin
trønderen11-Feb-22 15:08
trønderen11-Feb-22 15:08 
GeneralRe: Favorite way to categorize programming languages? Pin
Memtha11-Feb-22 17:35
Memtha11-Feb-22 17:35 
GeneralRe: Favorite way to categorize programming languages? Pin
trønderen12-Feb-22 4:09
trønderen12-Feb-22 4:09 
GeneralRe: Favorite way to categorize programming languages? Pin
Memtha12-Feb-22 9:07
Memtha12-Feb-22 9:07 
GeneralRe: Favorite way to categorize programming languages? Pin
englebart12-Feb-22 17:39
professionalenglebart12-Feb-22 17:39 
GeneralRe: Favorite way to categorize programming languages? Pin
trønderen13-Feb-22 6:11
trønderen13-Feb-22 6:11 
GeneralRe: Favorite way to categorize programming languages? Pin
Myron Dombrowski14-Feb-22 3:32
Myron Dombrowski14-Feb-22 3:32 
GeneralRe: Favorite way to categorize programming languages? Pin
Rick York11-Feb-22 11:34
mveRick York11-Feb-22 11:34 
GeneralRe: Favorite way to categorize programming languages? Pin
Marc Clifton11-Feb-22 14:10
mvaMarc Clifton11-Feb-22 14:10 
GeneralRe: Favorite way to categorize programming languages? Pin
Memtha11-Feb-22 17:39
Memtha11-Feb-22 17:39 
GeneralRe: Favorite way to categorize programming languages? Pin
honey the codewitch11-Feb-22 22:51
mvahoney the codewitch11-Feb-22 22:51 
GeneralRe: Favorite way to categorize programming languages? Pin
Sander Rossel12-Feb-22 0:00
professionalSander Rossel12-Feb-22 0:00 
GeneralRe: Favorite way to categorize programming languages? Pin
BernardIE531712-Feb-22 7:49
BernardIE531712-Feb-22 7:49 
GeneralRe: Favorite way to categorize programming languages? Pin
Memtha12-Feb-22 9:01
Memtha12-Feb-22 9:01 
GeneralRe: Favorite way to categorize programming languages? Pin
Member 916705713-Feb-22 21:21
Member 916705713-Feb-22 21:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.