Giter VIP home page Giter VIP logo

ini-reader's People

Contributors

squirlemaster42 avatar thatging3rkid avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

squirlemaster42

ini-reader's Issues

Make a wiki

ini-reader keeps getting more and more complicated, there needs to be a good tutorial on how to use it. I will write a wiki soon-ish.

Refactor readFile

So 200 lines of code is a bit excessive for a single method. We should at least create helper methods that make the code more readable. I was thinking we would pull the parsing out of the lines out of the method. That might require us to make rawConfigSection and/or rawConfigLine objects that hold unparsed versions or ConfigSection and/or ConfigLine objects.

We could also create new classes to specifically handle building up the ConfigSecion and ConfigLine Objects. Following the Builder Design Pattern should help implement it this way .

This is a low priority but I might make a new branch to try to clean it up and make it more manageable without killing it.

Code review

If you guys have the time, could you look through the new code, making sure that #5 and #6 were closed successfully and see if anything could be improved?

NotFoundException: checked vs unchecked

Currently, a ConfigFile contains ConfigSections, which in turn contain ConfigLines<>. This level of separation was designed in order to decrease the number of ini files needed on the robot itself, instead only one ConfigFile is used and multiple ConfigSections are used to contain data for separate parts of the robot or certain autonomous configurations. But, when getting a value from a ConfigSection, one of two functions can be used: .getSection(int a) and .getSection(String name). .getSection(int a) returns null if the given index is out of bounds (and the .size() method should be used to make sure this does not happen). But, the .getSection(String name) raises a NotFoundException if the given name does not exist in the ConfigFile or ConfigSection. How should this exception be handled, should it be checked (forced to be in a try/catch or declared in the method header) or should it be unchecked (crashes code)? Also, should the way that .getSection(int a) returns an error be changed?

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.