Coder Social home page Coder Social logo

mist_cpp-utility's Introduction

cpp-utility

The Cpp Utility is a personal project with the goals of personal education and useful utilities for the planned Mist Game Engine.

Sub-Projects

mist_cpp-utility's People

Contributors

alexsabourindev avatar erdnaxela01 avatar

Watchers

James Cloos avatar  avatar

mist_cpp-utility's Issues

Bit manipulations and other inlines may not work as intended

include/utility/BitManipulations.h

Using the inline keyword may not have your code working as intended, as it's only a hint to the compiler and the compiler is under no obligation to listen to it. If you really know you want your code to be inlined you may want to use the strongest terms possible, which is compiler dependent. In MSVC __forceinline is a stronger hint, for example.

My guess is that this code will always be inlined even without the keyword based on how few instructions you will be generating in each function. You might want to see for yourself what assembly is generated when it's used in big and small functions, in loops and not. It might help you inform that decision before deciding to give hints to the compiler.

Use consistent style throughout the library.

It has been pointed out that the library does not use a consistent style for things such as:

  • Types
  • Comments
  • Naming
  • Const correctness
    Run through the library and define a clear style and stick to it.

Remove Singleton Class.

Although an interesting exercise in development. A singleton class doesn't promote good programming practices and the library should attempt at defining good programming practices such as:

  • Maintainability
  • Readability
  • Avoided use of undefined behaviour

Fix benchmarking code in main.cpp.

The benchmarking code in main.cpp compares a single iteration of insertion sort against two iterations of quick sort and merge sort. Move the array version out of the profiling code in order to have a consistent benchmark.

hashing algorithm unclear, possibly not working as intended

include/utility/Hashing.h

I don't love the name of Hash64, as there are other 64 bit hashes (more on this in a moment). I'd suggest giving it an explicit name like Hash64_DJB2, and possibly using a macro or similar to have a simplified name for a good general purpose hash, even if it just points to Hash64_DJB2.

I would also change attribution from stack overflow to "Dan Bernstein" at http://www.cse.yorku.ca/~oz/hash.html

I haven't tried it, but the fact that your version returns a 64 bit integer and the source example returning a 32 bit integer seems very fishy to me for a hashing algorithm. Note that unsigned long long is not the same as unsigned long. Please do correct me if I'm wrong on this, but it looks like a mistake to me.

Remove Interface Class.

The interface class has been pointed out as being unnecessary and not to work with multiple inheritance.

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.