132

!rant

My girlfriend just got those for her laptop

Comments
  • 39
    So after refilling your coffee you just leave It there, not drinking it?
    That's an barbaric act.
  • 7
    @SmirkingBandit This also occurs once apparently
  • 15
    I really feel it should be coffee.isEmpty()
  • 10
    Also: every time the code gets executed, the coffee instance gets recreated and if there is no random mechanism choosing whether or not the coffee is filled in the constructor, it will always be refilled and never get consumed 😂
  • 3
    @itsdaniel0 depends. If it's C# it should be as a Property, like above. I know the Java guys like to wrap it in functions,so your case might be true too
  • 1
    A property _is_ a function - never forget that!

    Its so easy to think that .Empty would be "cheaper" than .IsEmpty() - its just kinda like a "field" right? Well, you dont know what code lies behind that simple property, it could be a thousand lines...
  • 2
    Drink should be outside else
  • 7
    Where did she get this 😍
  • 2
    @linuxxx

    I think it's from Redbubble
  • 10
    Did you try the new function Covfefe()
  • 4
    The whole thing should be wrapped in a while(true) loop. At the moment you just wasting your coffee.
  • 0
    @babeman But this is devRant. It is not supposed to rant here?
  • 1
    Ok i Want this too.
  • 0
    @JohanO As far as I know getter and setter in C# are managed by creating an additional variable that begins with an underscore and then the name of your property.

    The code that goes behind it's what you write in the getter/setter.

    So, yeah, it might be 1k LoC, but it might as well be 1!
  • 0
    @7Raiden I'm not sure there's a cache involved. If you made something equal DateTime.Now, it would return the date and time when it was called. Effectively calling the function each time
  • 0
    @JohanO
    Uhm.. it could only be a thousand lines if it were a function. If I select a field then I am guaranteed to only access this field.
    Or am I wrong here?
  • 0
    @stimulate I'm not sure about other languages, but in .NET a getter (and setter for that matter) could certainly be 1000 lines. It could even call on an API service somewhere
  • 0
    @itsdaniel0
    That is what I am saying. A function could contain anything. A field is guaranteed to be a variable of type x.
  • 0
    @stimulate It would still be accessed as a field though...
    E.G.

    public class User {
    public string Username
    {
    get {
    var result = api.getUsername(userId);

    return result;
    }
    }
    }

    That would be accessed as a field like so...

    var usr = new User();
    usr.Username;
  • 1
    @itsdaniel0
    Ok that's pretty different to C, which is what I am used to. This seems to encapsulate a function call into the access of a variable.
    In that case, of course it is hard to tell what actually happens when "api.getUsername(userID);" is called to get the string variable Username.
Add Comment