Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Language Design: Force unsigned Bitwise Operations And Precedence of Operations
#11
(02-03-2016, 07:16 PM)Someone else Wrote:  Well C++ does, but I would agree that integer to conversions are not a good idea. Pointers are usually fine in my experience.
C++ -from my pov- is not a modern language, and at this point it cannot be (for compatibility reasons). Yes, it's evolving and gathering many modern features but the language itself is not (and that you know it's originating from 80-90s).

(02-03-2016, 07:16 PM)Someone else Wrote:  The way GCC and Clang deals with the dreaded if(a = b) problem is warning if you don't put add an extra set of parentheses:
    C++-Code:
if(a = b){ /* ... */ }//warning
if((a = b)){ /* ... */ }//ok

So far I have not seen a case where that has not caught a bug where the programmer meant == instead of =.
But I don't think A-Man is going to implement warning system :D
Ultimately, my constant dissatisfaction with the way things are becomes the driving force behind everything I do.
[Image: sigline.png]
LF2 IDE - Advanced visual data changer featuring instant data loader
LF2 Sprite Sheet Generator - Template based sprite sheet generator based on Gad's method
[Image: sigline.png]
There is no perfect language, but C++ is the worst.
Reply
Thanks given by:
#12
I am implementing a warning system. But I think I will just be going with a boolean type and forbidding casting number type to boolean to prevent such tricky typos like the one you mentioned. Thanks!

I will refer you guys to this thread if you're going to start a C++ vs C#/Java argument now and here. Though I should say I'd go with C++ since, even though it may be tougher to get started with, it becomes very straight forward in the long run. The idea of header files is very nice too. If you want something that's modern and actually made things easy and short, then you go with Python.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)