GithubHelp home page GithubHelp logo

Comments (5)

DennisOSRM avatar DennisOSRM commented on July 23, 2024
  • Leave things as they are. After all it works and there are no extra external dependencies.

Has the benefit of trading an external dependency for maintainability.

  • Switch to Boost Filesystem. Makes some code cleanups possible. Introduces external dependency. But C++ standard "File System TS" will be very similar to Boost Filesystem, so change later should be very easy.

Boost.Filesystem is very easy to work with. It is used all over the place in OSRM. Unfortunately, there is no light-weight header-only variant of it.

Wait for C++ "File System TS", which is in the works and will probably released sometime this year. It might take a while to get implemented everywhere though.

Sounds like option 1 with the later possibility of switching. ๐Ÿ˜€

Would it make sense to go with option 1 (or 3) and encapsulate the platform-dependent code into a separate header file?

from libosmium.

alex85k avatar alex85k commented on July 23, 2024

ะจI am not an expert. Boost filesystem is good and easy enough, but to encourage usage of Osmium it is better to have fewer dependencies that are small and easy to build/install. OSRM is a big-executable project for running mainly on server, so extra dependency and 500kb does not matter. Osmium-based utilities are smaller.

So I would separate the platform-dependent code and use ifdefs for now, and later switch to option 3.

I would even consider redistributing already needed part of boost together with libosmium :)

from libosmium.

DennisOSRM avatar DennisOSRM commented on July 23, 2024

Right, OSRM already uses boost in plenty of places. It didn't introduce another dependency.

from libosmium.

springmeyer avatar springmeyer commented on July 23, 2024

few ifdefs seem fine, but of any boost dependencies I found filesystem quite manageable. In Mapnik we've kept most of the usage hidden from headers in case we need to switch it out for some platform: https://github.com/mapnik/mapnik/blob/master/src/fs.cpp

from libosmium.

joto avatar joto commented on July 23, 2024

Thanks for all your comments. I'll keep things as they are for the time being. There aren't that many filesystem interactions and any attempt to factor out some code or use the boost filesystem library would probably make the code worse instead of better.

Looking at the Mapnik code that @springmeyer linked to, I have to ask myself why I want a library that is specifically made to hide operating system differences when every call to that library has to be wrapped with another function that is compiled differently depening on the OS.

from libosmium.

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.