Better HN
topnewbestaskshowjobs
Log inSign up

hellofunk

9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions

John Bellick, Mexico City
Submissions

2851.

Closer to Perfection: Get to Know New C++11 Enum Types(blog.smartbear.com ↗)

1 points · by hellofunk · 10y ago · discuss

comment 10y ago · link · parent

The problem is that to get anything done on the Internet, you will need easy use of existing third-party libraries for a wide range of stuff, or you end up spending huge amounts of time implementing protobuf handling, websockets, ajax, webgl and the myriad of other important technologies that you may likely encounter in those areas. Excellent libraries for that stuff are out there, but Elm makes it hard to interop with them... for now. I really hope that changes.

comment 10y ago · link · parent

I strongly believe that for any language that compiles to JS to be successful, seamless integration with existing JS is absolutely required. This is the main selling point of Clojurescript which, while I enjoy Clojure a lot, is a dynamically typed language like JS itself, and I wish I could interact with JS in a stricter way. If Elm can improve on its interop, it has potential to be a strong force. But this is true of any new language. If you can't easily interop with the lowest common denominator language in the platform you build for, your language is too restricted for meaningful use. This is why Rust integrates well with C, because it has to, or it is irrelevant in many cases. This is why Clojure interops seamlessly with Java. Elm needs to get this point, or it will remain a niche hobby language avoided by professionals.

comment 10y ago · link · parent

Fair point. But a lot of people write their own C++ engines for their apps. This is certainly true in a lot of mobile games.

comment 10y ago · link · parent

>C/C++ is different, C++ is a superset of C. That makes things a lot easier.

This is entirely incorrect, but I'll give you a break since it is a common misconception. C and C++ are truly two different languages. C is not 100% compatible with C++.

comment 10y ago · link · parent

Consider how enormous the computer game industry is... and nearly no professional game developer will work in a GC environment because it is indeed a problem for the user experience in high performance games. Sometimes, focusing on the machine is nearly the whole point of the focus on the domain problem.

comment 10y ago · link · parent

Indeed, and the author of Go himself has said that he is glad Google no longer uses that term when referring to Go, as he also doesn't believe it is one.

comment 10y ago · link · parent

That does sound significant. I will be curious to hear more about that. Can you recommend a good go-to resource for all the latest news and discussions on Haskell?

comment 10y ago · link · parent

I have read many times that you need a solid understanding of the Haskell implementation as well as various extension to make the code as performant as it is elegant. True?

comment 10y ago · link · parent

You are talking about object methods, in which const has meaning limited to the object's data, and nothing else -- you can still do side-effects. I'm talking about also anonymous lambdas (modern c++ feature) and non-object functions. There is no way to say in C++ (or even a more functional language like Clojure) if a function has side-effects or not.

comment 10y ago · link · parent

Also, because laws are only a subset of the many ways a society handles, judges, and distinguishes detrimental actions. Laws can only do so much.

comment 10y ago · link · parent

There have already been studies showing that frequent visits to FB make a person more unhappy in their overall life. Now this. So, a major worldwide internet power -- that is, a single company -- that is trying to disrupt so much of global life (India, anyone?), with the interesting side effect that it makes people unhappy and less intelligent. If you had heard this "reality" 20 years ago, you wouldn't believe the future could be so dark.

comment 10y ago · link · parent

Clojure is a small "industry" with a few key players offering a lot of the guidance and advice. Nothing wrong with that, but often the community does in fact adopt the guidelines of just a few people, so that is probably why the author continues to contribute in this way. This author, for example, also wrote one of the tiny but widely-used functions used for unit testing in Clojure, for example. Almost everyone uses it at some point (the "is" macro).

comment 10y ago · link · parent

Blogs tend to be the way a lot of advice, guidelines etc are disseminated in the software world, so that's the main reason. I don't know of any major forums in the Clojure world, for example, that everyone is aware of and contributing knowledge to. It seems to blogs, irc, the mailing list, stackoverflow.

comment 10y ago · link · parent

I don't know Haskell, but assumed it would probably tackle this problem based on all the praise I've seen it get for things like this and its general type system.

comment 10y ago · link · parent

The U.S. is full of all kinds of behavior that is uniquely American. I was amazed how different the U.S. actually is when I left it several years ago to live and work in other nations. the U.S. has a lot it could learn from other places. I definitely think Americans are on average unhappier than the citizens of other Western nations, for a wide range of reasons.

comment 10y ago · link · parent

>From what I can tell most people would rather make more money than have more leisure

Totally false in most places in the world. Totally true in the U.S.

comment 10y ago · link · parent

Meanwhile, the Netherlands has a new law in effect on January 1 that requires employers to allow for shorter working days unless there is a strong reason to prevent them. And since the Netherlands is one of several European companies on the list of world's "most prosperous" [0], a list which does not include the U.S. in the top 10, perhaps this is validation of Keynes afterall.

[0] http://www.prosperity.com/#!/

comment 10y ago · link · parent

I think one issue that pops up in many languages is the distinction between functions that have side effects and those that don't. In C++ you see standard library higher-order-functions that accept lambdas or other functions, but the documentation says "the function passed should not produce side-effects." You also see this in Clojure functions, and functions you might write might also expect only side-effect-free functions. The problem is that the functions you pass may not be functions you wrote, they might come from another library and then to be most confident, you must go and look up the source or docs to feel sure. I don't think a naming convention is enough, since many may not use the convention. For languages where this is important, I wish there was a compiler or runtime check for these things so the user didn't have to take responsibility. Almost as if functions were split into two "function types", those with and those without side effects. Maybe starting at the lowest level of the core language library, some functions would be noted as causing side-effects, and then any function built that called those functions would automatically be categorized as such, and on up to the top, so that side-effects-beget-side-effects and function parameters that require non-side-effect-functions wouldn't allow those to pass.

Anyway, it is a problem that is not solved by a naming convention.

comment 10y ago · link · parent

This is rather interesting. I took a course many years ago at NYU on the history of the city, and my parent comment was taught to us in the class by none other than the Dean of the actual school. Fascinating.

comment 10y ago · link · parent

I don't know what the underlying geography of SF is like, but in case you have ever wondered why Manhattan is only vertically developed in two areas of the island where there are tall skylines (with a lot of low-lying areas in between, i.e. the Village, Chelsea, Chinatown, Little Italy, etc), it is because those are the only two areas on the island where the bedrock can support that type of development. I don't know if this factors into SF development options, but just an FYI.

comment 10y ago · link · parent

>I must warn that it unfortunately doesn’t build on Max OS X as of yet so I recommend to virtualize Ubuntu 14.04 to install it.

Important info for some folks (i.e. myself).

comment 10y ago · link · parent

ASIO header-only implementation is also available without Boost, fyi, as a standalone library; the same one that's in boost, but used without boost.

comment 10y ago · link · parent

I agree. I got websocket server and client apps running in modern c++ in just a few days of tinkering in my free time. It took no longer than when setting up servers in Clojure, which is quite a productive language as well.

comment 10y ago · link · parent

I'm curious what you mean when you say "not to mention exception safety" ... What is the general argument against exceptions in C++?

comment 10y ago · link · parent

I wonder also if that possibility of unsafety just doesn't matter much to a lot of people. After all, lisps have been around forever and even today JS and Clojure are popular when the possibility of doing unsafe things is extremely easy in a language where there are no type checks. So perhaps many developers just don't worry so much about compiler checks and instead enjoy the flexibility of "weak" or "no" typing, at the possible expense of safety. And maybe all of that is gradually changing. I really really love Clojure, but find static typing very useful; but also, it's great to throw it away when you feel confident enough to do so, and perhaps a lot of developers just like this, shall I call it "cowboy", style?

2877.

Ask HN: What is the difference between a program that is “correct” vs. “safe”?

2 points · by hellofunk · 10y ago · 5 comments

comment 10y ago · link · parent

I think the era of focus on static analysis tools has begun. I think all languages are moving in this direction. We have the new C++ Core Guidelines which will eventually be compiler-enforced, there is Rust with its program-proving compiler, and there are these neat tools for C, and no doubt more will flourish in coming years. It is going to be interesting to see where it all goes.

comment 10y ago · link · parent

This is wrong. Your eye muscles can tire over the long term if not given a chance to focus on other distances. It's like standing up all day without ever sitting down. The eyes are fundamentally muscles.

comment 10y ago · link · parent

But Qt is all c++, no?
1
959697
110