Hacker Newsnew | past | comments | ask | show | jobs | submit | gemstones's commentslogin

C++ is proposing pre- and post- conditions to verify functions in C++26; notably, Bjarne Stroustrup (C++ creator) is opposed


It's about a specific type of debilitating fear. The DSM has a rule for criteria that, to be considered as having a condition, it must seriously affect your ability to live a normal life.

Most social anxiety is not debilitating, and would not meet the diagnosis. This is why therapists receive so much training - you must encounter enough people with a truly debilitating fear that you know when to diagnose it.


If you're already an American, move to St. Louis.

- North enough that climate change will not affect it as much

- Inland so not at risk of sea level change

- Next to a large fresh water source

- Food security - weather suitable for all kinds of crops, even as temps rise

- A large enough group of people in a rich country that it will still be able to get resources as things get worse

- Because of the city/county split, the city crime rate is arbitrarily high despite being a safer metro than most. Means that housing prices are low. Places like Chicago are more at risk of becoming unaffordable as refugees crises get worse

- The region is one of the few that has been continuously settled from pre-colonial days, indicating some Lindy effect in play


I'm not disagreeing with you that St. Louis is good, but sea level rises in our lifetime will be a drop in the ocean compared to climate changes (severe flooding due to excess rain, heat waves, etc.).

No one cares about 4 inches higher water (Except maybe a few Florida boat owners whose boats can no longer fit under bridges).


It's not just about our lifetimes. Some people have children who would prefer that if they are to inherit a house, they will inherit one that will not be submerged or subject to the hurricane swell lottery when they leave it to their children.

And four inches doesn't begin to capture the potential.


St Louis is also the most dangerous city in the country. Macro trends 50 years from now don't matter if I'm just going to be murdered anyway.


Don't take the clickbait "top X lists" too seriously. The metropolitan St. Louis area is not some killhouse, it's just that the city is geophgrahically smaller then other major cities. The bad crime parts of the metrpolitan area are overrpresented in the city, which again, is a small part of the greater metroplitan area.


You missed the part about why the stats are that way. Obviously you don’t live in St. Louis, you live in the other 90% of the metro area that’s merely “St. Louis”.


The Lindy effect really doesn't apply there. If we were still a pre-colonial society and you were trying to find the best place to build your mostly-agrarian city, fine, but the conditions for survival are unrecognizably different than they were then.


A lot of places fit those conditions just fine.

Inland upstate NY, where I live, is one example. It ticks every one of those boxes (though the precise proximity to large clean water sources, of course, varies, there's ample clean water across this whole region).


(This is not China-bashing, as I assume lots of other nations do this for the same reasons.)

It's a lot harder to have unwanted intruders, and satellite surveillance is less likely. This lab will 100% have a military research purpose.


I don't think you need a mountain for that. A properly guarded surface complex with enclosed corridors between facilities would be far cheaper and enough to protect something from intruders or satellite surveillance. IIRC similar facilities (Cheyenne Complex, Zheleznogorsk MCC, Yamantaw) were built as nuclear strike resistant bunkers first. There are also nuclear waste storage facilities all over the world.


But a mountain would work, yes? And if you already need the mountain lab for physics, what is the extra cost to staff military personnel there?


Digging holes 2400 meters deep isn't exactly cheap, even for a country like China.


They didn't dig 2400m 'deep'. They dug into the sides of mountains which rise 2400m upwards from where they dug, as a side a effect from a construction site for water tunnels and their access-ways which would have been dug anyways for the adjacent dam and electricity generation site.

AFAIK nobody goes 'that deep' for science alone, it's always adjacent to mining, leftofer/unused/abandoned tunnels, and often closes down when the mining ceases, and the operation getting too expensive without the ongoing mining.

See https://en.wikipedia.org/wiki/SNOLAB , https://en.wikipedia.org/wiki/Canfranc_Underground_Laborator... , https://en.wikipedia.org/wiki/Sanford_Underground_Research_F... for some examples.


Just like Black Mesa!

That was a joke, haha, fat chance


Do you think that most businesses have the consistent cash flows needed to pay out wages every hour?

I’m not sure this is a technical problem, I guess. Maybe a financial engineering problem but is the demand there?


Most businesses have loans from banks and have some sort of line of credit (a business credit card, if not an actual line of credit at a bank) to draw from that could be used to pay employees from.


Aren’t most security vulnerabilities in C or C++ code? Seems a bit rich to point to C’s write-your-own approach as being a security benefit. I’d want to see some data on that before I arrive at that conclusion.


> Aren’t most security vulnerabilities in C or C++ code?

I haven't seen any data that supports that idea, but I'm thinking it would depend on how you define "most". Do you mean in absolute terms? Then sure, because most code in use is C or C++ code. In relative terms? I have no idea.

But it's become fashionable to shit all over C these days as if C itself is a security vulnerability. I reject that idea. C certainly makes it easy to write insecure code. It's the flip side of the strengths of the language. However, there's nothing about C that prevents writing secure code in it (with the caveat that no code, regardless of language, can be considered 100% secure). That's done all the time.


> However, there's nothing about C that prevents writing secure code in it

C doesn't prevent you from writing secure code, but it sure as hell makes it hard.

I believe it was Bryan Cantrill who made the problematic observation that the main issue is that C code doesn't compose.

I can write a perfectly correct library. You can write a perfectly correct library. When somebody else brings those two correct libraries together, though, the result can be terribly broken.

This is where the GC languages and Ada and Rust kick C and C++ asses.


There is this reasonably small C library used by literally the entire world that you may want to look into, the Linux kernel.

You may also note that in the general case even your beloved Rust and GC languages need to drop down to C the moment they want to interoperate with anything else.


> There is this reasonably small C library used by literally the entire world that you may want to look into, the Linux kernel.

WTF? The Linux kernel is gigantic. And is a prime example of non-composable fail.

Most functions fail in bizarre ways if you have re-entrancy. Out of memory is handled in myriad different ways--if it's handled at all. System calls can fail in a zillion ways with very little ability to recover correctly. I can go on and on.


It was sarcasm...

Also the reason something can fail for any reason whatsoever is because the linux kernel cannot just decide to shut down your computer if a cosmic ray flips a bit while the cpu is reading from ram.

The reason you can write your small library is because of the work done.

Also the reason for my comment in general was the linux kernel is, in my opinion, the most used library on the planet and was and still is predominantly built on C.

Sometimes pretty APIs are not what you need. You need APIs that have been and will continue to do what needs to be done for decades


> However, there's nothing about C that prevents writing secure code in it

But it makes it exceptionally hard! Personally, I always try to use C++ over C for that reason (and many others). I also understand why some people prefer Rust.


> But it makes it exceptionally hard!

I suppose that depends on what you mean by "hard". I don't think it makes it exceptionally hard at all, but it does mean you have to actually think about the design decisions you're making. I also consider that to be a good thing -- we should be carefully considering our design decisions.


> I suppose that depends on what you mean by "hard"

Compared to all other languages (except for assembly :)

> but it does mean you have to actually think about the design decisions you're making.

I don't believe that. How does thinking about passing the correct number of bytes to realloc() or memmove() help you think about design decisions? It rather takes away mental energy for no apparant gain.


One suggestion - it would be really cool to allow FFI. Something like

    <script type="text/javascript">
      const foo = (bar) => {
        document.getElementById('my-element');
        // More here!
      };
    </script>
That way you could really leverage the full power of HTML, the programming language!


The contents should be wrapped in a dangerouslySetInnerJS attr to prevent XSS


HTML, the programming language, is fully interoperable w/ JavaScript, the programming langauge (sic):

https://html-lang.org/#js

functions defined in HTML, the programming language, can be invoked by JavaScript, the programming language (sic) and vice versa.


Are you serious?


Yes. It’s so you can maintain a consistent style in your code base even if your dependencies use different styles. Nim has excellent C/C++ interop and it’s relatively common to interact with C or C++ symbols directly, and being able to do this without needing to adopt the dependency’s style or wrap everything is nice.

In python, for historical reasons the logging module uses camelCase while most other modules use snake_case, so it isn’t really possible to use the logging module and maintain a consistent style. This is a non-issue in Nim.


The downsides of this approach are unfortunately that it makes wrapping certain low-level libraries an absolute pain in the ass (especially anything to do with keyboards). But overall it's a non-issue, tooling recognizes both styles and you don't notice it.


Nim 2.0 changed the default to treating style mismatches as warnings.

E.g. it's something to check but not an error. You can easily set a config to make them an error or ignore them.


Cool, that definitely sounds like a welcome improvement.


The interesting stuff tends to be webapps, that people pay for and are often internal to a company.

If you just care about sites that are document based, of course you’d prefer the static content stuff! But he wouldn’t be working on a project you’d be visiting anyway, so who cares if you stop visiting?


You must be the guy that thinks people are excited to use an app


As in software, the best tool for avoiding errors is to not have the software in the first place.

If you must work with someone, or consider yourself to have an ethical obligation to follow this, this is good advice.

If you don't...

Just slowwwly remove your touchpoints with them. Freeze them out. Go through other channels. If you do this right, the person will feel like you have just gradually drifted apart, but won't be able to pinpoint a clear cause.

You don't have to try and get them fired, or anything (and that may backfire on you, so I don't recommend doing it.) But if enough people do this, then they will gradually be the most replaceable person on the team, and they may be let go regardless.


>Just slowwwly remove your touchpoints with them. Freeze them out. Go through other channels. If you do this right, the person will feel like you have just gradually drifted apart, but won't be able to pinpoint a clear cause.

Doesn't work if they're leading the project. This is also a very childish way of dealing with problems. Part of your job is to be an adult and learn how to work with people you don't like. Not how to avoid them. It's a critical skill to success in this industry.


Sometimes the most effective way to work with a person is to work around them.

Always resorting to that isn't mature or professional, but neither is not recognizing when that's the best option.


Oh it's not good advice for everyone! If they're a lead on a team you must interface with, they fall into my "you must work with them" bucket, and then the article is pretty good advice.

Eh, I disagree that it's childish advice! It works out pretty well for everyone except the person being frozen out - no matter if you're a child or an adult.


>Eh, I disagree that it's childish advice! It works out pretty well for everyone except the person being frozen out

then that person posts on hacker news why no one seems to want to "be an adult" , how they are blocked on tasks due to slow communication, and overall feel the workplace is hostile.

And the chain of apathy continues. And people wonder why work is so miserable. PAy can be a factor, but it usually isn't in tech.


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

Search: