Better HN
topnewbestaskshowjobs
Log inSign up

LessDmesg

45 karma · joined Oct 12, 2019 (7y ago) · 233 submissions

Submissions

comment 6y ago · link · parent

That's a valid point, of course. However, abolition of slavery is only a necessary condition, not a sufficient one. Remember e.g. the Black Plague in Europe which led to a sharp increase in the value of human resources and caused some positive effects like the rise of free cities, powerful guilds of professionals, and the Renaissance of arts and sciences. However, things stopped short of an industrial revolution: it took some 3 or 4 centuries more to come around.

comment 6y ago · link · parent

The industrial revolution's main prerequisite is not a converter or any other clever device. It's about power sources. When you've got e.g. a bunch of coal that gives off lots of thermal energy, finding ways to transform that energy (with engines, factory machining etc) becomes a hot open engineering contest with good solutions being a matter of years, and optimal ones, of decades or centuries (i.e. much longer than Roman history).

But if you ain't got the energy, then making any devices, however clever, isn't going to change the tide. Antique and medieval civilizations had some rather elaborate mechanisms like the antikythera, the trebuchet, rapid-fire crossbows in China etc. But without a major source of low-cost energy, none of them succeeded with an industrial revolution: large-scale coal-mining was what did it in the end.

comment 6y ago · link · parent

Enums are no substitution for sum types, though.

comment 6y ago · link · parent

Exceptions and Maybe types aren't mutually exclusive. They should be used together. Maybe types handle variability that is expected and predictable, like a dictionary not having a certain key; exceptions handle the unexpected situations, like a file handle being closed too early.

Maybes explicitly express what the programmer has foreseen, exceptions form a safety net over it. You need both in a wholesome language. That's wht even Haskell has exceptions.

comment 6y ago · link · parent

That's not important in practice. What's important is that null infects all reference types in Java and C#, whether you asked for it or not. Just today I've spent a half an hour looking for a null dereference error - which the type system should've warned me of but didn't. The sad fact is, neither Java nor C# are fixable, because no new feature will fix the broken, null-unsafe code already written. All because of this billion dollar mistake that should've had no place in a GCed language but was blindly copied over from C++. The sooner Java gives way to Kotlin and completely fades into obscurity, the better.

comment 6y ago · link · parent

"Delendum". Medium delendum est. It's neuter gender unlike Carthage which was feminine like many city names.

comment 6y ago · link · parent

VS installation is also a PITA if you have your C:\ on an SSD. The installer doesn't give you choice of what partition to install to (for most of its huge disk space demands) so you need to fake it with a bunch of symlinks. The VS team recognizes this problem but doesn't do anything about it, as follows from the comments on https://developercommunity.visualstudio.com/content/problem/...

comment 6y ago · link · parent

Romans... Slavers who washed their mouths and clothes with urine, and shat on the streets. They really weren't into this "treating people humanely" thing. Most of their lives were quite brutal: https://archaeologynewsnetwork.blogspot.com/2016/05/arthriti...

> The average ancient Roman worker was riddled with arthritis, suffered broken bones and was dead by 30 thanks to a diet of rotting grains and a lifetime of hard labour, a new study has found

comment 6y ago · link · parent

Java is also going to take a ton more memory.

comment 6y ago · link · parent

The hell stems from inheritance, which is just syntactic sugar over composition. And a very unhealthy kind of sugar as that: problems with co- and contravariance, problems with copying, the need for redundant type declarations. And inheritance doesn't guarantee autofulfillment of the Liskov principle, either. One might even wonder why inheritance is needed at all in a language. Go and Rust are certainly fine without it.

comment 6y ago · link · parent

C++: a language where you need 10 friggin lectures just to learn to pass variables around. I'm sincerely sorry for anyone who is forced to use this mountain of flaws of a language out of legacy reasons. We as humanity need a plan to reduce the number of C++ lines being written, then to phase out C++ code altogether. This sick roadshow by the ISO committee (and that numbskull Stroustrup) of adding features without fixing any bugs has got to stop. C++ is just horrible, and using it is a waste of time.

comment 6y ago · link · parent

C, the low-level language that cannot even get integer types right and believes that -1 is greater than 1... I wish the Zig language people get some industrial backers so C can finally start fading away to obscurity.

comment 6y ago · link · parent

(1) There's nothing messy about that graph. It's just two nested function calls. An exception by itself is just a goto to the catch block.

comment 6y ago · link · parent

I've started reading, and already the second anti-pattern, "Naive trees", is something I've been dealing with at work recently. Hey, how'd he know?!? Cool book.

comment 6y ago · link · parent

Nope, some obscure embedded or toy stuff doesn't count as real software that matters to people. Even Haskell, bless its academic ivory-tower soul, has real-time video games, IDEs and neural networks, not to mention tons of websites, written in it. And Forth has what, some device drivers and hobby/learning stuff? Point amply proven, thank you.

comment 6y ago · link · parent

Then how come no real software has been written in this wonderful language? Not even a decent text editor, let alone a browser or a game engine?

comment 6y ago · link · parent

Pypy seems to be reasonably well-documented:

http://doc.pypy.org/en/latest/parser.html

https://bitbucket.org/pypy/pypy/raw/b7b76322a4a7f53db98a883d...

comment 6y ago · link · parent

These blog posts are golden, thanks. I definitely will peruse them when creating my language.

comment 6y ago · link · parent

Nope, there's no practical way to cover all possible cases. There is always a possibility of a totally exceptional situation arising (we're only human). And then your beautiful ole error-cods returnin' function either takes down your whole application (which might result in someone dying while on life support in a hospital) or plods on with a successfull error code (leaving your program in an incorrect state). All because you didn't have a catch-all-exceptions clause.

This is why I find C++'s "nothrow" a joke, by the way. It's not within human power to guarantee that any piece of code never throws exceptions. A gamma ray might flip a bit. You never know. The only practical way to reliability is the Erlang way: be prepared for errors arising anywhere anytime, not rely on fallible notions of what can and cannot cause errors.

comment 6y ago · link · parent

1. Exceptions are necessary for correctness. This alone solves the question of whether they should be used. Error codes just don't cut it because they only handle expected errors (which is never enough in the real world).

2. Arguing about C++ exception performance is pretty pointless anyway since C++ performance is its (only) strong side. Until Java/C# matches C++ in e.g. cutting edge 3D engines, this question won't even become interesting.

comment 6y ago · link · parent

Many young post-grad people in today's economy are living with their parents while repaying their humongous student loans, yeah. Ironically, programming from the bedroom instead of going to a physical college may be a better way to obtain a place of your own sooner, heh.

comment 6y ago · link · parent

Windows has a big ole flaw nowadays: not friendly to SSD+HDD setup where you put the OS on the SSD. It insists on storing everything on drive C:\ which is on the SSD, even the behemoth that is Visual Studio (though that can be offset in large part with junction links). I've allocated 64GB of SSD space to my Windows and it managed to fill it up already even though I make it a point to install and save everything the HDD. Now, Win10 can't install any of its stupid updates anymore. Microsoft seriously needs to stop living in the 90s where it was okay to shove all data to drive C:\...

comment 6y ago · link · parent

Become Windows. That was Red Hat's plan all along. And then your personal data will end up on their cloud like with Win10.

comment 6y ago · link · parent

Because most people want a Lindows, not Linux. And a Lindows they got, with many pros and cons of Windows. Linux users will always be a minority because Linux is about tinkering and customization instead of a consistent corporation-concocted UX.

comment 6y ago · link · parent

Yes, so it's great to see at least some of them get to the 1.0 version eventually (and I mean Kotlin = Java 1.0). Now if only we could get people off the pre-release versions of Java (which for some reason are named "Java 11", "Java 12" instead of "Java 0.9.1", "Java 0.9.2" as they should) and on to the real deal!

Seriously, I have great hopes for Kotlin. It corrects some Java's most egregious sophomore mistakes, it doesn't try (and fail) to be Haskell like Scala did, it's accessible AND has a major company behind it. Kotlin is surely something I wish I could use at work.

comment 6y ago · link · parent

Kotlin is Java done right. It's what Java would have been from the start, if only original Java designers weren't C++ copycats in a rush.

comment 6y ago · link · parent

Both of them are invalid. What if you want a single-threaded allocator without the mutex overhead? And forbidding implementing traits for some types is just arbitrary stupidity. Developers don't need a nanny compiler to tell them which types they can or can't extend. Orphan instances are the solution in some cases.

comment 6y ago · link · parent

Almost half of the article is dedicated to fighting Rust. Rust compiler doesn't permit this, doesn't permit that... May the authors of Rust excuse me, but that language is as much not fun to program in as it is thought-out and well-designed!
12345
8