Giter Site home page Giter Site logo

new exercise: paasio about go HOT 7 CLOSED

exercism avatar exercism commented on August 15, 2024
new exercise: paasio

from go.

Comments (7)

bmatsuo avatar bmatsuo commented on August 15, 2024

This idea morphed from my initial, pretty boring idea of MultiWriter. My thoughts were basically that most reusable io.Writer implementations need to be (and in fact are) threadsafe. I didn't want to give newbie gophers the idea that things were inherently more dangerous than they are.

The ideal solution here would be to implement the following set of interfaces.

type ReadCounter interface {
    io.Reader
    // ReadCount returns the total number of bytes successfully read along
    // with the total number of calls to Read().
    ReadCount() (n int64, nops int)
}

type WriteCounter interface {
    io.Writer
    // WriteCount returns the total number of bytes successfully written along
    // with the total number of calls to Write().
    WriteCount() (n int64, nops int)
}

type ReadWriteCounter interface {
    ReadCounter
    WriteCounter
}

I've started on an example and tests. But would like to get some feedback before finishing.

from go.

sjakobi avatar sjakobi commented on August 15, 2024

Great idea!
But I'd find "paas-io" easier to parse as a name.

I guess it's a good idea to implement this in Go first and then write the generalized README (paas(-)io.md and paas(-)io.yml) for x-common.

If there's still room in the exercise one could calculate the cost for a given usage.

from go.

bmatsuo avatar bmatsuo commented on August 15, 2024

I noticed the name wasn't consistent with other exercises but left it "as is" to start the conversation. As a Go package "paasio" (or some variant) is the common practice. Underscores and and camelCase are not common in package names.

I was thinking about calculating costs as well. But when you look at pricing models for data transfer in PaaS systems you see a tiered model based on usage aggregated across all connections/files etc. So it's a little contrived to compute the cost of a single connection. Maybe an exercise in the future has you reading customer costs over a channel, aggregating them, and producing reports?

from go.

sjakobi avatar sjakobi commented on August 15, 2024

I noticed the name wasn't consistent with other exercises but left it "as is" to start the conversation. As a Go package "paasio" (or some variant) is the common practice. Underscores and and camelCase are not common in package names.

Right, packages/modules don't have to have the same name as the exercise.

from go.

bmatsuo avatar bmatsuo commented on August 15, 2024

Right, packages/modules don't have to have the same name as the exercise.

The directory the package is contained in has to have the same name as the exercise though. Right? That's what I'm getting at. A package named "paasio" in a directory named "paas-io" is not common either.

edit: typos

from go.

kytrinyx avatar kytrinyx commented on August 15, 2024

I think the name is fine. The existing names were chosen arbitrarily, and after a while I was sorry that I had chosen names with hyphens, but it seemed like it might be too late to change.

from go.

bmatsuo avatar bmatsuo commented on August 15, 2024

Closing this since the PR is merged.

from go.

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.