D deserves more recognition. It's a cool language under the radar for too long. I wish a major corporation backed it. I had a great time learning D. Also I admire Walter Bright If I could achieve even a fraction of his productivity, that would be awesome.
Sincere question, not meant to be a shallow dismissal: Where is D a better choice than C++? In what aspects is it enough of an improvement over C++ to justify using a niche language?
Programming in D after C++ is like the opposite of death by 1000 cuts - its just a constant stream of finding nice little things that simplify your life or avoid footguns. You become accustomed to all the niceties very fast and its hard to justify going back haha.
D is by no means perfect (and over the years it has accumulated lots of warts) but if you know what you are doing it enables amazing productivity and almost never gets in your way. If you have an idea about solving a problem in a particular way there's almost always a path available to do just that without running into "computer says no" situations (stares at Go).
D is technically better than C++ in most features. (It has always lead C++. For example, among about 100 new feauters that C++11 brought, only 2 were not already in D. No C++ designer will ever admit this fact.)
D is safer and more productive. It's a joy to write in D because most of the time it feels like whatever you think, you code. This is unlike C++ where you fight the language all the time. C++ is not a productive programming language. I say this with experience: I coded in C++ as an "expert" for many many years, including these last couple of years. It's not fun to write in C++, which translates to another kind of loss of productivity.
C++ is a burden and liability for companies but no CTO will be blamed for chosing it because it's popular. I can list so many popular things and persons that worth nothing but I will refrain from getting political.
Yes, on paper, there are way more C++ programmers out there than D programmers. But I interview these C++ programmers occasionally. Most of them don't even have an inkling that they don't know C++ at all.
How about engineering with C++? That is such a difficult task. I went over header file hygiene with a colleague a couple of months ago. The number of points that you should pay attention to is mind boggling: Don't #include unnecessarily, do forward declare as much as possible (but what can be forward declared is hard to understand even for experienced programmers), #include your own API header first to prove that it's complete (and good luck!), don't forget header guards, don't reuse header guards, etc. etc. This is just efficient header file usage! We haven't started coding yet!
My friends, the emperor doesn't have clothes. C++ simply is not a tool that is designed well. People who choose it do so because they have to or they are masochists. (True story: I asked a relatively young Google meetup presenter once why he was using C++ instead of a modern language and he said "because it is hard".) C++ separates the elite from the masses; I used to strive to be a C++ elite; I am not interested a bit anymore; I want to write useful programs with D; and I do.
D is niche only because humans are populists. We are not encouraged to use tools (or products) that are designed better. We follow popular leaders. It takes one some time to find his or her own voice to reject bad products and use only good ones. I am extremely lucky to work for a company that allows me to use D to write useful products.
I still take the same joy from programming that I did when I first learned it.
Then there is the human aspect of it: I want to be associated with real people isntead of snobby elites. (Remember how C++ was marketed at around 2000? "Yes, C++ is hard but it was never meant to be for normal programmers anyway." Ha ha ha! I am old enough now to reject that mentality. Bad design is bad design my friends; you can't defend it by blaming the user for not being elite.)
I can go on and on...
Now it's my turn to ask: Why would anyone choose C++ for their projects despite the production costs that it brings? None of your programmers really know it; they introduce hidden liabilities in the projects, their source code become non-refactorable monsters. Why waste that money on C++ when you can produce products easily. Products that just work...
> Why would anyone choose C++ for their projects despite the production costs that it brings?
Familiarity, and all the libraries and tools available for C++. I see that D has a section on C++ interop,[0] but it looks about as painful as FFI usually is, and even more painful given how template-heavy C++ code tends to be.
(Completely unrelated: I can't mention FFI without also mentioning how amazing LuaJIT's C FFI is. The developer(s) really nailed it.)
I actually don’t think C++98 was that bad or complex. Yes nobody knew how to use it and wrote Java instead, but I think the hate comes from having code spanning so many different features and idioms that also require a compiler expert to understand.
Because that product was an embedded system running on a very small SoC. It only had 1MB of flash and 192k of SRAM. It's theoretically possible to run CL on a system that small -- Coral Common Lisp ran on a Mac Plus with 1MB of RAM back in the 1980s -- but nothing off-the-shelf will do that today.
(I did, however, put a little Scheme interpreter on it as an easter egg :-)
I do have some CL code that supports the crypto project. The back-end for this:
is written in CL (though all the actual encryption is done client-side in Javascript). I also have some prototype crypto code that I don't really use for anything, including this double-ratchet implementation:
I believe that the point is that those things are relative. It would be more like, if you stop eating everthing you love now (sweets, fast foods etc) you might learn to love the alternative (fruits and vegetables).
As many people pointed out it depends what "working" means. If this is focus mode/deep work, than it's quite a lot. If it means 3 to 4 hours of light work (e-mails, waiting on conferences, chatting with co-workers etc) and the rest is social media and things totally not related to the job then it's a different story.
I would like to use emacs and org mode to organise my life. But I think without it being useful on mobile phone, for me is a no go. I will keep using Google calendar for now.
You can install Termux on Android devices and use Emacs there. I use it on more or less read only on the smartphone and actively on a tablet. Both rsync with my desktop from inside Termux.
I was very much in the same boat. I’m on iOS, and found beorg, and it is simply splendid. Very active development, powerful customization available, etc.
yes for iOS, I suggest you take a look at beorg, it is quite nice for quick editing and note taking. Of course the real magic truely happens when org is paired with Emacs but the app is quite useful for basic tasks.
I used to think that our body know better. But I realise it doesn't do what is better but rather what it is used to do.
I felt I had to eat sweets frequently, drink coca-coca everyday and 3 meals a day etc. My body felt terrible when I didn't. I stopped listed to what my body wanted and consciously stop those things. First week it was really painful. Second week I got used to. Third week I completely changed. Now I have to force myself do eat sweets, drink soda or having so many meals a day.
I still listen my body about drink water and not sure if I should really listen it when it comes to sleep.
Personally, I think processed food is literally poison. This is based on my experience living across the street from a 7/11 eating primarily processed prepackaged foods, whatever hot garbage wrapped in plastic they had under the heat lamp multiple times a day for a month.
Now I mostly eat spinach, lentils, organic granola, yams, brown rice, occasional fish. Cognition is better, sleep is better, energy is higher. I don't personally believe the body can get used to processed foods, I think it's much more likely that one might simply forget what it felt like to eat a normal diet and feel regular all the time.
We've eaten processed food for generations, though - and lots and lots of very questionable food that could literally be poison.
Sausages are processed foods, but they kept us alive over the winter. Salt pork anyone? Dried fish? Weevil-filled grains that hopefully stay dry during the winter and foods in root cellars.
I'll add that plenty of processed food is an absolute miracle. Frozen vegetables, for example. You weren't simply eating processed food. You were eating low-quality food that wasn't exactly healthy.
I would add Pickles, Kimchi, Sauerkraut, Soy Sauce, Worcestershire, pretty much any preserved or fermented food is going to be processed food and was the norm before refrigeration. Some of it is really good for you some of it is not so good.
As well there is a lot of misinformation and pseudoscience miracle cure babble in nutrition. For a long time now, we have been sold that preserved/processed foods = bad. But we where also sold that butter was bad and to eat margarine. Come to find out, trans fats where worse and butter and olive oil are actually pretty healthy for us. We were sold that all fat are bad and to eat more grains and carbs, then we got an explosion in diabetes, heart disease and various other related ailments.
These, examples don't even get into the pseudo science "cure cancer with body ph diets" type snake oil being sold, as well as the other multitudes of quackery that exist to sell a book. The fat, sugar dynamics was considered settled science and was pushed hard by the American Heart Association, and the Cancer Foundation for decades. In my opinion, nutritional science and the big tobacco science debacle that was raging at the same time, did more to damage "sciences" credibility with the uniformed public than anything else.
The reality is there are processed and preserved foods that are really good for us, there are processed and preserved foods that are really bad for us. Just as there are fresh foods that are really not so good for such as Asparagus for women.
Honestly short of a a few really bad things, such as slim-jims, modern processed candy and candy bars, soft-drinks and processed juices, the real trick is balance and moderation. Food variety, calorie restriction and fasting will do more to preserve health than eliminating a certain type of food, because it has been deemed "unhealthy" by the current regime of nutritional pseudoscience.
Processed food is made in giant boiler vats, with chemicals which we have not had in our environment for more than 50-80 years. Chemicals which were approved as "generally recognized as safe" several years before the same agency even admitted that tobacco was harmful to health. Which are proven carcinogens, mutagens, and irritants. If you compare this to salted sausage or sauerkraut, you're a fool.
Sausage is a highly processed food and definitely not good for you. Same for bacon. You can have highly processed food without chemicals: You can make processed cheese at home without the vats [1]. Not all "chemicals" are unnatural things that we didn't eat before, and some of the "chemicals" are preservatives, basically making them preserved foods.
We didn't really have frozen foods before refrigeration became common.
Bread in the 1800's wasn't very pure if you were buying the cheap stuff [2]. We weren't really eating "pure and natural" stuff before, and have been experimenting with different chemicals and things for eons. Some were fine (I'm guessing lutefisk isn't really bad for you despite the lye, same with pretzels), others weren't (lead whiteners, for example).
Just because one agency sees things as generally safe and has messed up doesn't mean all agencies have done this nor does it mean they are always wrong. Just like the fact that coke will clean battery terminals doesn't mean it is bad to have occasionally. Heck, eating lemons will destroy tooth enamel, but yet the juice will help keep scurvy away.
You know what I mean by "processed foods" and it is not frozen vegetables, salted meat, or smoked fish. The "meat stick" you get at the store is not just "salted meat". It is not a preserve, it is a processed food. Look at the ingredient label, they use a lot more than just "salt and meat" to make that stick and it is pretty sketchy to put that stuff in a person's body.
The thing is: Not everything with a large, technical name is bad. Simply having preservatives isn't necessarily bad - and neither is artificial flavorings. I'm pretty sure modern "Beef sticks" aren't really bad either - I'm gonna guess you mean something like a "slim jim", whose ingredients seem pretty standard [1]. They just aren't good if you live off of them as a standard part of your diet.
And honestly, if you don't differentiate that you don't mean that stuff, there is no way for a reader to tell. Some people absolutely mean processed foods like smoked fish, canned/frozen vegetables, and the like.
>The thing is: Not everything with a large, technical name is bad. Simply having preservatives isn't necessarily bad - and neither is artificial flavorings.
It is simply bad if the substances are proven carcinogens, mutagens, endocrine disruptors, and sterilizers.
Not to mention all the poison which is produced and dumped into our air and water producing this stuff.
Your slim jim example includes the following:
Corn Syrup: proven harmful to human/animal health
Soy Protein Concentrate: proven harmful to human/animal
Spices: what is this? nobody knows
Dextrose: proven harmful to human/animal health
Paprika Extractives: nobody knows how this happens
Flavoring: flavoring is not an ingredient, this ingredient is concealed from view, and cannot be trusted
Hydrolyzed Soy: proven harmful to animal/human health
Sodium Nitrite: proven carcinogen, mutagen, and harmful to micro-biome.
Yes, sleep was always essential, but we didn’t have artificial lights and didn’t spend most of our days sitting on our asses. Both are things that probably disturb our natural sleep clues.
I didn’t suggest that you shouldn’t sleep enough, just that our feelings about how much we need to sleep might not be reliable, in either direction. Maybe we would benefit from sleeping even more than we do because we rarely are physically exhausted at the end of the day.
I do find that physical exercise and exhaustion are helpful for good sleep. If I lay down and "can't fall asleep", I typically get up and keep working until I can't help but fall asleep.
If I lived 10K years ago I imagine I would have been frequently sleep deprived. Obtaining food, building shelters, and guarding against attacks were all higher priorities. We don't have any hard data on neolithic sleep patterns.
That's a good point, and one of my arguments for unscheduled sleep.
All the things you mention would indeed take priority, and we probably spent days sleep deprived at times, making up for it with extended long sleep when there was opportunity.
I think our lives were not nearly as difficult or demanding as some imagine, however, especially when you factor in the social and tribal factor. Sleeping in shifts would allow for plenty, attacks were not constant, especially with good shelter, and shelter only takes so long to construct, if that's necessary at all.
Remember, we started in an environment which provided everything we needed already, and one we were evolved for.
If you look at the lives of other apex predators like lions, bears, and eagles, their lives are pretty good in this respect, and their biggest threats are either their own species or humans.