530 karma · joined March 15, 2013
Go missing generics except for built-in containers; and then not having anything but the bare minimum for those built-ins is a critical defect of the language. The fact that you can work around that defect doesn't make it any less of a defect.
For practical issues you have things like compile time, extra tool dependencies and up front setup time to enable a given type.
It makes c++ templates look down right elegant in comparison.
This still leaves some holes that the runtime provides, but all of which are easy to provide -- namely things like 'new' and 'delete'.
$100 dollars is nothing compared to dev costs. It should have been just counted as startup costs and the demo should have been up since day 1.
This isn't some psyops nonsense. Net neutrality isn't some George Soros conspiracy meant to cripple capitalism while making him rich.
Unless, you know, you care about the purpose or authorship of the library.
I don't think pinning dependencies at package levels is a bad idea - ubuntu does this for a lot of packages but this relies on properly followed semantic versioning to work.
No, I'm claiming he has no more legal right to make threats than any other person. There is a large difference there. Largely speaking a persons right to make threats is protected under the first amendment.
There are very narrow instances where verbal or written threats become assault (or terrorism, or attempts to incite a riot, etc); and since one of the criteria there is ability to carry out threat, someone in a position of power has somewhat more liability here, not less.
Which is all besides the point -- twitter isn't a government entity; your first amendment protections don't apply to their ban hammer. Their rules and regulations are more restrictive in all cases than what is allowed by law.
> You mean as in the case that we're discussing?
I mean, yes? My point is that a) Trump is in technical violation of the TOS and b) The TOS constrains the behaviors of the users, not Twitter so they have no real obligation to enforce it.
For instance -- I have the right to say 'Nazis should be punched in the face' in most circumstances. It would violate Twitter TOS to tweet that however and they'd be well within their right to take that message down or ban the account.
The 'spirit' of the TOS is civility in most part, not legality. Donald Trumps twitter account isn't civil.
And if you disagree about that, or about the spirit of the TOS so be it -- that is why things like terms of service are held to the more objective letter, and not the highly subjective spirit.
No one has the 'right' to make violent threats on twitter. It is a private service with a ToS.
There are no principled reasons to treat the president as a special case here. The practical reason is simply that it is often and free advertising for them and the terms of service dictate what they can do when breached; not what they must do.
There must have been some other leaking going on. He was using a largish library when he saw the leak and eventual crash so maybe it was due to improper pooling or C api calls? I'll have to ask him more about it.
Defer gives no guarantees about when that thing is going to run -- just that it is after the function returns. Because of this, you can get erratic behavior if you open and defer closing a lot; essentially openFile just stops working at some point.
This can happen with any limited resource and isn't theoretical; I had a friend who ran into this in long running process with a lot of IO.
Typically though there are custom delete/free API calls you need to make, and to use them with unique_ptr you have to pass that function pointer in as the second argument to the unique_ptr constructor.
At the very least you should have a C++ function that gives you the unique_ptr back that does the right thing; but at that point you almost might as well just make a class and give it member functions to map the C calls.
Otherwise it seems a lot like you can just make the call at the end of scope yourself for the same line count and _much_ more readable code.
I guess if you have multiple return paths it's more tenable to use scoped dtors for this but it all really seems questionable to me -- I can't think of a single use-case where it'd be preferable to use something like this rather than a dedicated class.
In C++ the destructor handles this as part of the lifespan of the object. Making users of the object encapsulating the resource handle resource cleanup is an antipattern, which is why the standard library does this for you.
They don't try to address the check for null problem at all; that isn't their intent. All they mean to do is eliminate several classes of common, easy to make mistakes such as not zero initializing or not freeing the resource.
But it really doesn't fit the argument as framed. All smart pointer implementations are some valuable niceties wrapped around a naked pointer. It has nothing to do with preferring references to pointers; at the end of the day you just have a pointer -- just one that gets default initialized to 0, and deletes itself when you are done with it.
Frankly, the type of C++ developer that spends any serious amount of time trying to come to terms with a smart pointer API; even one they haven't seen before is the type of developer I wouldn't really want manipulating naked pointers.
If the empty state thing was in reference to smart pointers, it'd be a remarkable misunderstanding of how they work and how they should be used.
Obviously references are better in most circumstances but only because you don't have to check for an empty or invalid state. They offer no performance or optimization on their own.
I just don't get the appeal. Go seems a lot like what you'd get if you just removed every language feature that anyone has ever complained about; for good reason or not.
Address sanitizer was "ported" to the kernel a while ago; not sure if UBSAN is or will be in the future.