GithubHelp home page GithubHelp logo

bencoding's People

Contributors

ivartj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bencoding's Issues

code review

github crashed on me last time I wrote this so here goes, oliverthered from wrongplanet
in no perticular order.
1: Type constants are base 2 is there an external requirement for this or could they be an enum
2: get rid of the gotos and user break properly etc...
3: define your constants as named constants #DEFINES these are manily strings used for formating in sprintf or comparison operations or other constants, this will not only self document your code but it will make them easy to change if need be and have them all defined in one place for clarity and easy reading.
4: instead of doing switch(type) for functionality instead have a struct of functionpointers and a lookup table such that (something like) functions[type]->function_name(parameters) can be used for the individual functionality for each type instead of having the code either inline or a switch case statement. most large c projects do this as a form of object orientation, it will
a: make sure the code is encapsulated for each operation for each type
b: make your code extensible
c: make you code self documenting
5: consider using memcpy instead of sprintf for constants as that's what your really doing and it's much more efficient
6: I haven't looked that well into the code but you may want some kind of stream system for buffer memory management, IDK.

apart from that not bad. ;-)

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.