You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One feature I'd love to see here (well, I'd really love to see it in the compiler but I don't think that's going to happen) is the ability to flag instance variables that are defined in a local scope but haven't been declared at a in the body of the class (or initialize).
What I'd really like to do in the bar method is update the @enabled instance variable to true. However, I've accidentally misspelled the variable, creating an entirely new instance variable that is not used anywhere else.
In my opinion, newly-created instance variable outside of the scope of the class body or the initialize method are usually mistakes, especially if they're never referenced anywhere else. I'd love to have a tool like ameba alert me of issues like this.
P.S.
Proper unit testing would probably be a solution to problems like this, so maybe it isn't entirely necessary. However, in my experience working on CryBoy, my approach to testing has transitioned away from unit tests and towards test roms to run through the emulator. I run into problems as demonstrated above more often than I'd like to share... 😬
The text was updated successfully, but these errors were encountered:
Awesome, thank you!! At least having this be a configurable option would be awesome :)
And I agree that there are definitely valid use-cases. In the example you've provided, I'd personally still write it more like this since I'm a fan of declaring instance variable ahead of time. But not everyone shares my preferences :)
Hey all!
One feature I'd love to see here (well, I'd really love to see it in the compiler but I don't think that's going to happen) is the ability to flag instance variables that are defined in a local scope but haven't been declared at a in the body of the class (or
initialize
).As an example of what I mean, take the following
What I'd really like to do in the
bar
method is update the@enabled
instance variable totrue
. However, I've accidentally misspelled the variable, creating an entirely new instance variable that is not used anywhere else.In my opinion, newly-created instance variable outside of the scope of the class body or the
initialize
method are usually mistakes, especially if they're never referenced anywhere else. I'd love to have a tool like ameba alert me of issues like this.P.S.
Proper unit testing would probably be a solution to problems like this, so maybe it isn't entirely necessary. However, in my experience working on CryBoy, my approach to testing has transitioned away from unit tests and towards test roms to run through the emulator. I run into problems as demonstrated above more often than I'd like to share... 😬
The text was updated successfully, but these errors were encountered: