Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 2
Are there demerits of type casting ?
2 Respostas
+ 14
Typecasting turns off your complierās ability to check for type mismatches and therefore creates a hole in your defensive -programming armor. A program that requires many type casts probably has some architectural gaps that need to be revisited. Redesign if thatās possible; otherwise, try to avoid type casts as much as you can.
(Source: Code complete 2)
+ 4
Typecasting can not only get the program to overlook type errors, but can also result in loss of data and significant figures. Hence, it's best to avoid it if possible. Hope this helps! :)