Hacker News new | past | comments | ask | show | jobs | submit | lzsiga's comments login

The proper way is not exporting implementation details at all, instead define opaque types in your header files like this: `typedef struct ssl_st SSL;`. This comes from OpenSSL, it means users can use `SSL *` pointers, but they don't know what those pointers point to.

Of course you can also have internal header-files within your own project, which you don't share with the end-users of your product.


It is perfectly valid to use more than one header files: some of them can be public (meant to be seen by users of your library), others can be private or internal (only used by your own sources).


Also, usually it's pretty rare to have things internal to one C file that need explicit prototypes. It's easier to just put things in the right order so the funtion definition etc is before its use.


Afaik, SOAP is a subset of all webservices; the rest is REST (i.e. XML without SOAP and non-XML).


Off: floating point numbers can be used to store integer values, so equality comparison might be perfectly valid in some cases. For example, if the embedded Sql doesn't support 'int64_t' (only int32_t), itt might still support 'double' which can store 52-bit integers exactly.


Yes, also there are deep magic gamedev tricks exploiting that (see quake sqrt :) ). There should be a way to do them. Something like bit_compare(x, y). I'd just prefer if rarely useful operations shouldn't use the most commonly used API. Too easy to make a mistake.

BTW I'd also love to have a built in float type that fails when you assign 0 to it.

Anyway, I guess in Java operator == is a lost cause anyway. My favorite example:

    // true
    System.out.println(BigDecimal.valueOf(10) == BigDecimal.valueOf(10));
    // false
    System.out.println(BigDecimal.valueOf(11) == BigDecimal.valueOf(11));
    // true
    System.out.println(BigDecimal.valueOf(11).equals(BigDecimal.valueOf(11)));


> Off: floating point numbers can be used to store integer values, so equality comparison might be perfectly valid in some cases.

Yeah, but then you're having to learn all the special cases for when it silently gives wrong answers, and hope to hell that you didn't miss any.

Much better to have consistency and behave the same way all the time, than to optimise for 3 keystrokes and introduce all sorts of special exceptions that the programmer must memorise.


I think if you want to perform binary operations on floats you should have to cast them to a binary type.


Something like that happened with `leftpad` in 2016.


Off: Also there is the HTML Hell Page, which is older than many of the current web-developers but still contains the most relevant informations about web-design.


I seem to have missed something:

Apple claims Location Services cannot be disabled because it is needed for Ultrawide Band (UWB) compliance.

And what about UWB? It cannot be disabled either? Do you have a say if someone wants to send you a file 'simply by pointing at your iPhone'?


Airdrop is not a new feature. You can whitelist people that can use it on you.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: