Comments (8)
@abvg9 Try to reference code with GitHub references in base of a certain commit. For example, the line you are referencing is this one
from catan-heroes.
@abvg9 Mhmm I think maybe the code should allow that.
In the actual scenario there are no chances to get an structure with no owner since TerrainType.NONE
is banned, but what if we implement a terrain with no owner, such an obstacle? we shouldn't code in base of the current scenario, we should code keeping in mind the desired behavior we want to implement. And the desired behavior is a calculus of the structures with owner.
What do you think about this?
from catan-heroes.
So why did we have an if that checked that? If it was an unnecessary case then of course it would not be necessary to develop the exception, however, if the revision did make sense, it is recommended to treat it as an exception. Perhaps with a RuntimeException since it allows to avoid the treatment with a try catch.
from catan-heroes.
So why did we have an if that checked that? If it was an unnecessary case then of course it would not be necessary to develop the exception, however, if the revision did make sense, it is recommended to treat it as an exception. Perhaps with a RuntimeException since it allows to avoid the treatment with a try catch.
As I said previously:
-
what if we implement a terrain with no owner, such an obstacle?
-
we shouldn't code in base of the current scenario, we should code keeping in mind the desired behavior
Those are the reason to place the if block. It's not an unnecessary case, but an exception does not make sense because it's a valid case.
from catan-heroes.
So ... how do you know what happened if the function exits for that return? Is it a function that if you call it, it has no effect?
from catan-heroes.
how do you know what happened if the function exits for that return?
Who is "you" in that context? Probably that "you" has nothing to take care about that. Having said that, that "you" probably could realize that no production increment was performed.
Is it a function that if you call it, it has no effect?
Sometimes yes as you can figure looking at the code
from catan-heroes.
That you refer to those who review the code at runtime to analyze what has happened. In the event that a behavior occurs and one does not know how to differentiate between what has occurred, it generates uncertainty and causes the traceability of the code to be lost. In general, it is malpractice.
from catan-heroes.
That you refer to those who review the code at runtime to analyze what has happened. In the event that a behavior occurs and one does not know how to differentiate between what has occurred, it generates uncertainty and causes the traceability of the code to be lost. In general, it is malpractice.
It would be a bad practice if that was an unexpected behavior, if you say that components should not fail silently, I agree with you. But this is not a sillent error, its the desired behavior.
it generates uncertainty and causes the traceability of the code to be lost. In general, it is malpractice.
As said previously:
Having said that, that "you" probably could realize that no production increment was performed.
from catan-heroes.
Related Issues (20)
- Make commands serializable HOT 1
- Make requests serializable HOT 1
- Make game cloneable
- Send commands as an after success action
- Add a way to get Player requests without deleting them
- Add a command sender.
- Catan game engine must not process a batch of requests.
- Consider banning non trade request if a trade is pending
- Move main package
- Resolve compiler warning
- Improve Readme HOT 2
- Fix production at foundation phase
- Simplify CatanGame
- Add turn data to any command.
- Add send command calls to game engine handlers.
- Refactor test to implement nested test classes
- Implement a player agent
- Create a Catan game builder
- Move CatanGame test to Request handler tests
- Fix POM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catan-heroes.