Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 07 Feb 2009
Offline Last Active Oct 12 2016 08:02 AM

Posts I've Made

In Topic: Deprecation warning for application-registered entities

15 June 2016 - 12:49 PM

My first idea would be to check the reference count of such objects and print a warning if they exceed 1 (I'm assuming that one reference is reserved for the engine).

In Topic: Go-inspired features in Angelscript

13 June 2016 - 04:50 PM


One bug that I can immediately imagine, is that the user mistypes the variable name when assigning a value. With the short variable declarations this would declare a new variable and thus not produce any compiler error.

Not quite true in case of Go, which features different syntax for short variable declaration and assignment.


a := 0 // declares a variable 'a' and sets it's value to 0, same as 'auto a = 0'

a = 0 // sets value of variable 'a' to 0

b = 0 // produces compiler error because assignment only works for variables that have already been declared in this scope

In Topic: Go-inspired features in Angelscript

07 June 2016 - 03:00 AM

It makes it much harder to tell the type of a variable, its moment of declaration, and initial value.

The same kind of argument applies to 'auto', which found its way into AngelScript nonetheless.



Furthermore there are not too many cases where it is nessary and normally its just easier to put the data in a struct (or class) and send it back that way.

I believe you are wrong here. I find it that polluting the code with structs and classes that do not serve any purpose other than storing the return values for non-trivial functions is very much an anti-pattern. You can't have too many of them without making a mess.



This is more organized and leads to less bugs down the line (like having to remember what return index belongs to what.

Again, this is debatable. I would think that the same kind of argument applies to structs or classes (having to remember which class member corresponds to what).



Overall, it seems to me that neither of you have ever tried go lang, which I recommend you should do. I know you love your C++ but c'mon, there are other languages and technologies out there.

In Topic: Go-inspired features in Angelscript

06 June 2016 - 03:09 AM

Thanks for the suggestions.


multiple return values is something that I find myself thinking about every once in a while. It is something I find very useful when I do some work with perl scripts, and may try to include something like this for AngelScript too. It's way too soon to think about when or how though.


I'm not too sure about short variable declarations though. It would probably not be too difficult to implement, but it looks like something that could be a cause for lots of bugs when used by non-experienced programmers. I'll keep it in mind though.

Could you please elaborate on what kind of bugs you think are possible with such approach to variable declaration?

In Topic: Windows XP Compatibility

19 February 2014 - 04:27 PM

It's pretty much the same with CreateSemaphoreEx: