Giter VIP home page Giter VIP logo

Comments (4)

icraggs avatar icraggs commented on June 5, 2024

I also read this:

http://stackoverflow.com/questions/10243149/why-is-typedef-struct-foo-foo-considered-harmful

where there are pros and cons described both ways.

from paho.mqtt.c.

ralight avatar ralight commented on June 5, 2024

I've done some reading around this as well and fwiw my view is that if it's a public struct then I would avoid using a typedef but for opaque structs it makes sense.

Having said that, I'm also a big fan of not breaking backwards compatibility unless really necessary.

from paho.mqtt.c.

icraggs avatar icraggs commented on June 5, 2024

If you use C++, you don't have to use the struct keyword. I know that this isn't C++, but I was trying to get to a similar position, which would still probably be my preference. I don't want to break backward compatibility - we'd have to go to a 2.0 release for that.

We could have a #define which omitted the typedefs, for those who really want to. The default would be to operate as we do today.

from paho.mqtt.c.

icraggs avatar icraggs commented on June 5, 2024

I'll consider this for future client implementations, or new versions, but not for now. Thanks.

from paho.mqtt.c.

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.