42
b2plane
353d

It's my birthday

🦁🙏🎂🍰🎉🎈

Comments
  • 3
    Happy cake day boie 🎂
  • 8
    This could have been prevented...
  • 4
    age ++

    (tradition guys/girls:)
  • 3
    late 2 d party but HBD? did I miss the strippers already?
  • 1
    Thanks guys ❤️
  • 3
    @illuminaughty age.append("year")
  • 1
  • 2
  • 1
    @retoor oh. thought it was java :0
  • 4
    @joewilliams007 no, I'm straight
  • 2
    @retoor i bet java is better oriantated than you are in terms of objects 😄.
  • 3
  • 2
    package main

    import "time"

    const birthdayBoy = "b2plane"

    type Age time.Time

    func (a Age) Add(d time.Duration) Age {
    return time.Time(a).Add(d)
    }

    type Store interface {
    GetAge(username string) (Age, error)
    SetAge(username string, age Age) error
    }

    // Fixme handle errors
    func main () {
    store := NewStore()
    b2old, _ := store. GetAge(birthdayBoy)
    b2old = b2old.Add(1 * time.Year)
    store.SetAge(birthdayBoy, b2old)
    }
  • 2
    Before I get a lot of crap. This was just having some fun and wonder if people recognize the language. It has the quality of a recruitment cringe "code" message. Anyone sane would not mix age and date/time in the same unit (just store the birthday and calculate age is the way) but python pseudocode above got me inspired. Also it doesn't compile. There is no Year constant for example 🤣🤣🤣.

    Hope you had a happy cake day @b2plane!
Add Comment