Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Why does this class not implement something like
public interest hoursSinceLastCoffee() {}
Send like that would make more sense to me, then you could do
if (this.hoursSinceLastCoffee() >= 5) {}
I mean, you know, if I were to implement something similar... -
What language requires so many references to "this"? I can only think of python, but clearly, this is very far from python
-
A-C-E57028y@YousifMansour yeah, I know, but to me it looks like you're code is assuming that the hours since last coffee is always going to increase linearly. What if daylight savings happens right as it hits 5 (or before?) then you actually have 6 hours since last coffee
while (this.isAwake()){
if (this.timeSinceLastCoffee.toString() == "5hr") {
this.cup.refill();
this.drinkCoffee();
}
}
undefined
getting a refill now