Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    js#6763
    @_discord_774066653708681226:t2bot.io
    [m]
    leaning towards OFUnichar, as it was not of_uni_char_t 😉
    js#6763
    @_discord_774066653708681226:t2bot.io
    [m]
    After 10k lines of diff I created, I am no longer sure renaming them all is a good idea…
    Letterus
    @letterus:synod.im
    [m]
    oops
    js#6763
    @_discord_774066653708681226:t2bot.io
    [m]
    maybe also because I was doing too many things at once :/
    or maybe_i_just_like_this_better
    Letterus
    @letterus:synod.im
    [m]
    😀
    js#6763
    @_discord_774066653708681226:t2bot.io
    [m]
    also, OF_STRING_ENCODING_ISO_8859_15 is readable. OFISO885915StringEncoding is not.
    Letterus
    @letterus:synod.im
    [m]
    hm. I think I'd be fine if a basic char datatype has its own naming (seems to be the same about Cocoa). About all consts, enums and so on I may want to reach using IDE autocompletion I consider it very important to follow the same naming convention. convention over readability even I think.
    Letterus
    @letterus:synod.im
    [m]
    js, hit me if I'm asking stupid questions: but if we create a objfw wrapper for Gtk and compile this by using clang - do we get ARC for GTK?
    js
    @js:nil.im
    [m]

    This message is replying to a Matrix event but we were unable to find associated bridged Gitter message to put it in the appropriate threaded conversation.

    Fixed

    js
    @js:nil.im
    [m]
    still arguing with myself what type of consistency is better:
    consistency with itself or consistency with Cocoa
    e.g. it's NSUTF8StringEncoding
    of enum NSStringEncoding
    per normal conventions it should be NSStringEncodingUTF8
    so, should I do OFUTF8StringEncoding or OFStringEncodingUTF8?
    2 replies
    OpenStep is a lot less consistent than CF even!
    e.g. it's NSMakeRect, instead of NSRectNew or something.
    It's NSRectEqualToRect
    but NSEqualPoints
    WTF was OpenStep smoking?
    clearly they haven't done an API review before release
    jn
    @jn:ccc.ac
    [m]
    i don't know about the points about consistency though
    js
    @js:nil.im
    [m]
    I'm starting to think I should just keep calling it OF_STRING_ENCODING_UTF8 and say "deal with it Cocoa boys, your favorite framework is inconsistent as heck, adapt to ObjFW's consistency"
    jn
    @jn:ccc.ac
    [m]
    having enum variants (OF_FOO_BAR) look different than classes (OFFooBar) seems fine to me
    js
    @js:nil.im
    [m]
    my main problem to solve is inconsistency between external names and internal
    maybe you have an idea jn 🙂
    so:
    thisIsAStaticLocalFunction()
    of_but_global_function_look_like_this
    the of prefix is really annoying here
    hence maybe OFGlobalFunctionLookLikeThis?
    which is what Cocoa does
    but at that point the questions becomes why should enums be all uppercase when that works poorly with swift
    ugh, I hate it
    jn
    @jn:ccc.ac
    [m]
    hm, i don't know about the Swift constraints
    js
    @js:nil.im
    [m]
    I'm leaning towards just changing the style and not giving anything about how Cocoa names stuff, given how inconsistent they are
    jn
    @jn:ccc.ac
    [m]
    maybe you could make a little overview page of the different constraints and influences?
    js
    @js:nil.im
    [m]
    but then again: OFStringEncodingISO885915?
    Cocoa would call it NSISOLatin9StringEncoding, if it had it at all.
    (GNUstep does call it that way)
    /**
     * @brief The encoding of a string.
     */
    typedef enum OFStringEncoding {
        /*
         * UTF-8 *has* to be 0, so that if the current @ref OFLocale is `nil`,
         * `[OFLocale encoding]` returns UTF-8.
         */
        /** UTF-8 */
        OFStringEncodingUTF8 = 0,
        /** ASCII */
        OFStringEncodingASCII,
        /** ISO 8859-1 */
        OFStringEncodingISO8859_1,
        /** ISO 8859-2 */
        OFStringEncodingISO8859_2,
        /** ISO 8859-3 */
        OFStringEncodingISO8859_3,
        /** ISO 8859-15 */
        OFStringEncodingISO8859_15,
        /** Windows-1251 */
        OFStringEncodingWindows1251,
        /** Windows-1252 */
        OFStringEncodingWindows1252,
        /** Codepage 437 */
        OFStringEncodingCodepage437,
        /** Codepage 850 */
        OFStringEncodingCodepage850,
        /** Codepage 858 */
        OFStringEncodingCodepage858,
        /** Mac OS Roman */
        OFStringEncodingMacRoman,
        /** KOI8-R */
        OFStringEncodingKOI8R,
        /** KOI8-U */
        OFStringEncodingKOI8U,
        /** Try to automatically detect the encoding */
        OFStringEncodingAutodetect = 0xFF
    } OFStringEncoding;
    Maybe this isn't all terrible?
    jn
    @jn:ccc.ac
    [m]
    it has the main points that i like to see in enums
    js
    @js:nil.im
    [m]
    values have the enum as prefix?
    jn
    @jn:ccc.ac
    [m]
    yes
    js
    @js:nil.im
    [m]
    you prefer that over enum Foo { FOO_BAR, FOO_BAZ }?
    jn
    @jn:ccc.ac
    [m]
    no, that fulfills my criteria too
    js
    @js:nil.im
    [m]
    ugh, API design is hard
    or, rather, naming consistency is hard
    maybe I should just say "public functions use a different convention to align with C style, deal with it"?