Giter VIP home page Giter VIP logo

Comments (6)

petertseng avatar petertseng commented on July 17, 2024 2

Though it's true that neither #36 nor the current JSON at https://github.com/exercism/x-common/blob/master/exercises/gigasecond/canonical-data.json have birthday in the set of tests, there is acknowledgment of it in the comment. I think that's as good as it's going to get here, and letting individual tracks decide whether to have it.

The date-duration arithmetic discussion qualifies as a new exercise idea and that is the unresolved part of this issue, so I'll label it to suit.

from problem-specifications.

IanWhitney avatar IanWhitney commented on July 17, 2024

We were talking about Gigasecond at my Kata group today. None of us particularly liked it because the tests didn't ever show off any interesting behavior. It seemed like once you got one test passing, all of them would pass. Then, if your language supports it, you could add your birthday. But your birthday isn't a weird edge case, or anything special. It's just another date.

Instead we were wondering if the Gigasecond could be expanded into a more interesting look at API design. In Ruby, at least, we liked writing methods like 1.gigaseconds_since(Time.now), or (2.3).gigaseconds_before(Date.yesterday). Other languages probably also offer ways to write interesting methods for date manipulation.

from problem-specifications.

kytrinyx avatar kytrinyx commented on July 17, 2024

In Go there are some really nice lessons about the standard library, the difference between constants and variables (significant in some ways in Go), about time.Duration, type conversions, support for scientific notation, etc.

In languages where it doesn't add anything interesting in terms of ramping up in the language or in understanding some core programming concept it should either be transformed into something more interesting, or just deprecated/foregone.

I think the idea of exploring activesupport style monkeypatching/api design could be an interesting take on the problem.

from problem-specifications.

wobh avatar wobh commented on July 17, 2024

I think it's helpful for a new programmer or someone new to a language to figure out how dates are supported, or as a challenge to implement a simple date representation. I sense some untapped pedagogical potential though.

Gigasecond is a duration, a more advanced exercise, could be to exercise or implement date-duration arithmetic in the language:

date - date = duration
date +/- duration = date
duration +/- duration = duration

date + date = error
duration +/- date = error

from problem-specifications.

kytrinyx avatar kytrinyx commented on July 17, 2024

Duration arithmetic is a very interesting extension. I don't know if it would be as part of this exercise or a separate one. Go already has duration implemented as part of the standard library, so this exercise works as a discovery tool for how durations work. In languages where there is no such thing, it would probably turn this into a more advanced exercise.

Is it reasonable to mix the two and write a README that would leave both options open, or would it be better to separate them and then have each language track choose which of the two exercises (one or both) are appropriate to the language?

from problem-specifications.

ErikSchierboom avatar ErikSchierboom commented on July 17, 2024

As (very) we're short on date/time exercises, it would be great if we could create a new exercise to focus on these concepts.
Something like being passed to datetimes and having to return a description of the duration between them (e.g. "2 days ago", "3 weeks ago", etc.) could maybe work here.

from problem-specifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.