Share your repls and programming experiences

← Back to all posts
C++ is WEAK!
h
DynamicSquid

C++ is weak. This means you can easily convert types. For example, it's no problem to go from a char to an int in C++.

This image sums it up pretty well.

And to show you just how easy it is, let's convert a string into a boolean (bool array to be more specific, bool array representing binary values to be even more specific).

Run the code to see a string be turned into a bool!

Voters
Firestorm8
DynamicSquid
Comments
hotnewtop
MocaCDeveloper

Hehe. This is a bit funny.
Let me explain. See, characters have x amount of bits. The letter A has 65, or 0x41 in hex.
C++ is a LOW LEVEL language, meaning you can check the BITS of a string(list of characters), or a character vs another character.
For example, a is less than b because a = 65(or 0x41) and b = 66(or 0x42).

C++ is not AT ALL weak, it is, in fact, very powerful due to it's low level and ability to work with the BITS of ideals within an application, such as no other programming language other than C can do.

So yeah, C++ is not weak, and like I said, at a low level, you can basically assign a type "char" to a type "int", logically speaking, because since the language is low level, at runtime it'll recognize the bits of the number(which will ofc be the same bits as the character), and reference the CHARACTER of the INTEGER(in bits) instead of printing type int!
And that chart is extremely wrong, C is the life to most modern programming languages. Just read source code and you'll see

EDIT:
Also, by turning a character into a bool, you're basically just writing a program that turns the string into bits(0 and 1's), which the bool operator supports(0's-True(on), 1's-False(Off));
If you would just understand the low levelness and how bits work you would understand that this actually makes a language very very powerful!
What even is a weak language?

DynamicSquid

@targetfanttthat weakly-typed, in the sense that you can easily convert between types using casts and punning

MocaCDeveloper

@DynamicSquid That's just how low level languages are.
It is not converting between types, you simply can't say "This set of zeroes and ones are going to be a type int". It is, what you say, "weakly-typed" due to the low level ability to work with the bits of each "type" ideal.
So, logically speaking, it is not weakly-typed, it is just a matter of how you want to use the types and if you want to work with bits or not.

DynamicSquid

@targetfanttthat really confused, but sure I guess

MocaCDeveloper

@DynamicSquid Confused about?

awesome10

why are all the variables [a letter]_squid

DynamicSquid

@awesome10 i_squid --> integer_squid :)

awesome10