Giter Club home page Giter Club logo

Comments (5)

mmarx avatar mmarx commented on May 27, 2024 1

That's now getting a bit more into design specifics: a VectorColumn, e.g., will also panic if you have only five elements and call get(23). We might consider changing the Column trait to have a get(usize) -> Option<T> and a get_unchecked(usize) -> T to handle that, as std::vec::Vec does.

from nemo.

mmarx avatar mmarx commented on May 27, 2024 1

Having a CONTRIBUTING.md is surely a good idea, and also a good place to put down such decisions.

from nemo.

mmarx avatar mmarx commented on May 27, 2024

My views on this are as follows:

  • any error that potentially traverses the crate boundary (i.e., anything that does not get handled by the crate itself, or that panic!s) is a crate::error::error,
  • an error that is handled by the same module can be a simple struct, or an enum if there are multiple variants,
  • errors exposed to the rest of the crate have a corresponding variant in crate::error::error, which can be #[from] a module-level error enum,
  • errors from the standard library have a #[error(transparent)] variant in crate::error::error,
  • panic! (and expect(), assert!, etc.) is fine for situations that should not occur, e.g., if there is some invariant that makes the situation impossible, or where graceful recovery is impossible, but not otherwise, and
  • unwrap() should (almost?) always be expect() instead

from nemo.

ellmau avatar ellmau commented on May 27, 2024

My views on this are as follows:

  • any error that potentially traverses the crate boundary (i.e., anything that does not get handled by the crate itself, or that panic!s) is a crate::error::error,
  • an error that is handled by the same module can be a simple struct, or an enum if there are multiple variants,
  • errors exposed to the rest of the crate have a corresponding variant in crate::error::error, which can be #[from] a module-level error enum,
  • errors from the standard library have a #error(transparent) variant in crate::error::error,
  • panic! (and expect(), assert!, etc.) is fine for situations that should not occur, e.g., if there is some invariant that makes the situation impossible, or where graceful recovery is impossible, but not otherwise, and
  • unwrap() should (almost?) always be expect() instead

My point of view is quite the same. Though I don't think that we have cases where we shall outright panic. Just wrapping the issue into an error and let it traverse to the top level sounds much more recoverable. (Lets say in the rle case - an error could allow to just use another column which works, while panic makes it outright impossible to react)

Note 'sanity' checks, like the one in rle are fine though.

from nemo.

ellmau avatar ellmau commented on May 27, 2024

Another thing we still need to decide is to where we are listing all these design decisions.

I think a CONTRIBUTING.md would be the natural way of collecting all conventions and strategies for implementing things in this project.

How are your positions on this?

from nemo.

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.