16
Awlex
8y

Our Professor gave us a predefined Datebase with access methods. The whole database is full of
value == 0 ? false : true

How can this guy teach programming languages when he can't apply a simple != operand

Comments
  • 1
    Because you don't learn a language.
    You learn the concept of transofrming your ideas to code, and later learn the language by yourself.
  • 1
    It all depends on the language used, some languages can not use an int as a bool.
  • 0
    @lukegv oh yeah, that's true... Didn't thought of that. Luckly I never use a ? : statment thingy...
  • 0
    @papierbouwer thought that the OP's rant was more on the evaluation of a 0 or not. In C and some other languages you could write it like: value? true: false; which basicly is a int to bool cast.
  • 0
    @papierbouwer When used wisely it can save some lines of code, but sometimes people fail to realize the simple answer infront of them
  • 0
    @Awlex Lines of code aren't everything. The real question I think that you should ask is: which one of the two is more effecient during runtime.
Add Comment