HNHacker News
TopNewBestAskShowJobs

dpc_pw

1,827 karma · joined May 7, 2015

submissionscomments
dpc_pw··on What you could steal from the Kakoune code editor, and get away with
Editing in Vim feels like a bit like editing in `ed` if you ever tried it. It's a bit like "type in a command, and see the result". You type d3w and you will get 3 word deleted. In Kakoune every keypress results in visual response. You type 3w, you see that 3 words were selected, then you hit d and they get deleted. It makes editing much more interactive, smooth and less error prone.

Unlike the other responder, I am actually not big fan of multiple selections and prefer search and replace. But once in a while multiple selections come handy even for me, so I don't mind them being there.

dpc_pw··on What you could steal from the Kakoune code editor, and get away with
Before 3 yeas of kakoune, I did like 20 years of Vim. IMO, typing is less than 0.1% of SWE, so even if you can get 2x typing productivity with Vim it will still not amount to any substantial overall productivity benefit.

If IDE works for you and you enjoy it, stick with it. I enjoy modal editing (Vim/kak) because it feels good. I don't have to move my hands from the home row and I'm a damn impatient person, so that fast editing just makes me feel a little better about "waiting for IO".

dpc_pw··on What you could steal from the Kakoune code editor, and get away with
I really regret every trying Kakoune. It was totally not worth it, but I just can't go back now.

I've switched from Vim to Kakoune 3 years ago, and lack of support for this modal editing style elsewhere is really frustrating. It is better than Vim's, but in practice that's not a significant difference, and the pain of switching back and forth is something I'm agonizing over all the time.

BTW. The exact kakoune modal editing mode is not even all that flawless. The way x and X work on empty lines is infuriating, and I am actually using a personal fork of kakoune to fix it. https://github.com/dpc/kakoune-dpc . I went so far as prototyping a spinoff of Kakoune: https://github.com/dpc/breeze to look for improvement, but building a full-featured text editor is a lot of work, and I it's not like it's going to fix the problem of switching.

dpc_pw··on Principles of Data Oriented Programming
So... is Data Oriented something new?

Storing fields in a map leads me to believe this is not Data Oriented Design (DOD). And I completely reject this idea (fields in maps). The "flexibility" there is hardly useful, and could be achieved with defined shapes (types) in modern statically typed languages without all the dowsides.

"Separate code from data" is a big core belief I share with this article, but the rest doesn't seem good idea / novel / important.

dpc_pw··on An opinionated history of programming languages
Nothing but a flamewar tinder. :D
dpc_pw··on A web of trust for NPM
https://github.com/crev-dev/crev/

People willing to help out with `npm-crev` implementation needed. :)

dpc_pw··on Global capital is the tail that wags the U.S. economic dog
There are people who buy derivatives for practical rational reasons as well - e.g. producers who want to lock the price of pork belies, or business hedging currency risk in an international transactions. In a normal market

If people are crazy-buying TSLA stock, TSLA can issue more stock. If people are piling crazily into corporate treasuries and the yields are going down, corporations will issue more debt (and e.g. buy back more of their own stocks). When people were pilling up into a housing bubble in 2005, the builders were creating mc mansions like crazy as well.

All the financial assets are prone to systemic over leveraging, and fiat money central bank induced bubble is affecting absolutely every asset: housing, debt (private & public), equity, derivatives. Different things explode at the time, and central banks need to run to the rescue by blowing the bubble even bigger.

If it weren't for fiat money bubble, derivatives would be mostly rational markets as well.

dpc_pw··on Samsung Ads – Demand-Side Platform
Ad-based revenue should be heavily taxes, just like alcohol and tabaco products.
dpc_pw··on Global capital is the tail that wags the U.S. economic dog
I don't even understand what this is supposed to mean. Every asset allows infinite inflow of capital. If humans wanted, they could trade everything for TSLA, moving it's price to gazzilion dollars per share.

Derivatives are transaction between to parties like any other. One side pays money the other takes money for making certain bet.

The problems I'm aware of with derivaties is that it makes easier for companies to hide their speculative bets off the balance sheet, and it exaggerates overleveraged long-term bets. But it's hardly a root of all evil.

dpc_pw··on YouTubers are upscaling the past to 4K, but historians want them to stop
> But historians argue the process is nonsense

This article is nonsense. It absolutely fails to make a point.

It's not like up-scaling stuff with neural networks is going to introduce a random mobile phone into the medium being upscaled or introduce any other glaring misrepresentations. The upscaling is purely for improving quality.

Accuracy of the colors is rather secondary. And if anything, historians should just help out if they can.

Personally I've spent a lot of time watching upscaled&colorized videos on YT, and I'm just mesmerized. It's sooo much more vivid and gripping to look at the past like we can look at the present.

dpc_pw··on You're Allowed to Write Slow Rust Code
I'm seen other comments of yours and this is a final straw, which makes me stop wasting my time.
dpc_pw··on You're Allowed to Write Slow Rust Code
> available tooling for doing deterministic resource management in GC languages

Other than Python's `with` and alikes, wrapping in a closure, `defer`/`scope` (Go/D), what else is there? What am I missing? None of these work if the lifetime of a resource is not a simple "this scope".

dpc_pw··on You're Allowed to Write Slow Rust Code
Good luck trying to make your Rust code actually slow with random `clone` here and there. You really have to find something huge, or in a tightest loop to even notice a difference. And most applications are IO bound on some DB connection anyway.

But it's a good advice. For some reason people tend to forget that copying stuff is super cheap, and most lifetime issues can be entirely avoided with a `.clone()`.

dpc_pw··on You're Allowed to Write Slow Rust Code
Yeah, but dealing with debugging leaking resources (because memory is just one of many resources that a program will use, and GCs don't help with most of them) sucks.

https://ruudvanasseldonk.com/2015/10/06/neither-necessary-no...

Ownership model seems hard for people to internalize, but once learned feels very natural, leads to programs that are better structured and frees programmer from "manually managing resources".

dpc_pw··on You're Allowed to Write Slow Rust Code
Languages like Python being more productive is a myth. A story people keep repeating, with absolutely no way to back it by facts, not to mention that productivity is not a scalar.

All there is just bunch of subjective experiences in specific circumstances.

dpc_pw··on Coinbase offers exit package for employees not comfortable with its mission
I expect a lot companies and capital, given the COVID nudge, will accelerate moving to other locations and hiring remote, because they want to pay their employees to the their work, and not to go on moral crusades on company's time.
dpc_pw··on Things I Was Wrong About: Types
Interesting. Seems we have very opposite experiences.

I definitely agree that one can paint themselves into a static-typing corner where refactoring becomes painful (but as I said, usually because of OOP). Also in big projects care needs to be taken to keep compilation times manageable.

> Languages should facilitate thinking of enforced correctness as a gradual concept, like gradual typing in Python, so the programmer has freedom to make these choices.

Depends on the domain. In web-based non-critical applications, maybe. If there's a bug, users gets and error etc. reports it, you push a fix to prod and things are usually OK. In things I mostly worked with (embedded, automotive, on-premise appliances, systems, p2p, finance), the cost of debugging and fixing small bugs is far too high.

I am supporter of gradual typing though, if someone wants to go with dynamic typing route.

dpc_pw··on Things I Was Wrong About: Types
> The best approach I ever saw to using Haskell at scale was to severely disallow any complex type system feature, like even disallowing lensing or custom type classes. Just ruthlessly stick only to basic language features and module oriented design.

I agree. It's not unlike what you can do with reflections and other dynamic features of dynamicaly-typed languages. So it's not a problem of static typing itself. It's a problem of taking a feature of the language and strangling the code with it.

I had to do some refactors of JS code where everything was a shapeless objects with random fields, as the language doesn't even nudge the developer into considerations like keeping consistent "shapes" of data. Had similar experiences with some Python code, where I had to fight both data types fuzziness, reflective-features inventions (hello __getattr__!) and OOP over-abstracted nonsense at the same time.

One way or another, in larger teams/projects dynamic typing just doesn't scale. Type system works like a most basic documentation / developer aid / consistency encouragment, even if it is pushed into complexity nightmare.

I don't think I've ever even seen a reasonably well working large project in a dynamically-typed language...

IMO, static typing gets blamed for problems that are usually caused by OOP: complexity caused by needless abstractions (mostly inheritance taxonomies).

dpc_pw··on Things I Was Wrong About: Types
> There's a pleasure to solving problems that arise from type systems akin to solving Sodoku puzzles.

IMO, That's not type system but OOP. Where I have problems with types is usually due to class hierarchies, and developers trying to invent "beautiful" taxonomies and abstractions for the sake of abstractions.

I guess generics sometimes come as a cludge too, particularly if they are combined with the above OOP issues.

In a typical bussiness/app code if you don't use inheritance or keep it to minimum, and use generics where they belong, static typing is rather mindless. "This needs something that implements interface ServiceA, and a string" and then a bit of familiarity with handling collections and "Options".

From my experience, it's only sudoku puzzles if you (code author) make it so. Not very unlike the opposite version when people go very wild with abilities of lack/dynamic typing.

dpc_pw··on Things I Was Wrong About: Types
> It's hard to build large monoliths without typing.

It's hard to build anything larger. In a microservice architecture one of the best things one can do is to define machine-readable schema (which is just a way to "type" RPC calls and messages) for all APIs/messages/events, and then auto-generate generate client code from it.

Most of the people who oppose typing must have been working on tiny projects, in small teams where they were co-authors of most of the code.

dpc_pw··on Things I Was Wrong About: Types
Let me guess. You probably worked in small teams, mostly with code you co-wrote your whole carrier.

You literary compare 3 languages that you happened to use and think that all there is to know about this argument.

dpc_pw··on Building even faster interpreters in Rust
There's nothing inherent that would make JIT interpreted languages slower than AOT compiled languages. In fact JITs can apply optimizations that are difficult to do AOT.

The only reason why interpreted languages are usually much slower is semantics of the language itself. And maybe JITing itself, but that tends to get amortized rather quickly.

dpc_pw··on Building even faster interpreters in Rust
You probably could get same optimization in FORTRAN, but so what?

Rust is just a more modern, better and more approachable programming language than C and C++, and people care about it more and prefer to get their little system programming lessons in it.

dpc_pw··on Evil Unit Testing (2019)
The reason to mock out IO is not that much about the performance, but isolation. It's annoying to have to deal with setting up database instances, users, permissions and what not, just to run an otherwise standalone test. Also annoying when two test suites running in parallel conflict (though it can be avoided). If you use sqlite, it's much easier since it's all just working on standalone file.

> I disagree - I always test a real database, never mock it.

I always put an interface between the IO part and rest of the code, so I can either mock it or not. Ideally I would have a separate tests making sure that the real-IO implementation of the interface works, and not use in my normal test that are exercising logic. But it is indeed a lot of additional work, so I'm cutting the corners and let the test run against a real db implementation, only wrapping it in things like injecting faults etc.

dpc_pw··on Evil Unit Testing (2019)
I indeed see people calling pretty much any tests, except e2e test unit-tests.

However as per which test types to use: the right answer is (as with everything) "it depends".

When doing testing the overarching problem is that the testing was well thought. Different types of testing will behave differently at different scales and different problems.

Instead developers oftentimes thing in terms of WHAT, not WHY. One can't just do the same thing for completely different projects and expect the same results.

Most of the time best testing is opportunistic - one that does what's easy and fast to achieve.

In some apps functional test will test mostly separate and shallow code paths, which will not lead to a lot of coupling.

With some languages a good type-system is already a 90% of unit test suite.

A big part of testing is also designing your production code to be testable. (TDD is good here because it forces you to think about it upfront). With a right architecture even e2e test can be great.

dpc_pw··on PostgreSQL 13
New features often come handy if you have a very specific need and usually you don't really need them at all and you can stick to common-SQL features. You often discover them when you search online looking for some blogs and stackoverflow threads, and then someone mentioned "you can get this done using XYZ in psql", and then you start reading what's that about.
dpc_pw··on Firefox usage is down despite Mozilla's top exec pay going up
Firefox is dead. Deal with it. It's just a matter of time.

Web-browser is not very profitable bussines, and by bloating web with more and more complexity, we made sure maintaining alternative implementations is getting harder and more costly.

The Web degenerated into it's natural conclusion - a centralized platform controlled by a handful of corporations extracting value from its users.

Seriously, better start exploring alternatives already if you care about your privacy and freedom, because this route is gone.

dpc_pw··on The Expression Problem
This is not unlike any other engineering. One can't just arbitrarily change thermal isolation properties of a house without having to do some broader changes that can affect it's general structure and other aspects of it. Or you can't take a Cessna and dial up the performance requirements to make it fly as fast as a jet fighter.

For some reason SWE oftentimes hope to achieve some general-AI level tooling and methodologies that would magically let them ignore everything other than than aspect they desire to change.

dpc_pw··on A Picture of Java in 2020
Java pretty much requires an IDE because it's verbose, bloated, everything is inconvenient without IDE assistance and it's easy to create bugs.

Something as simple as opening a file of code requires IDE, because everything is hidden behind `./src/main/java/com/whatever` nonsense. The language was designed for IDE.

In Rust there is hardly any need for IDE (or a debugger), as long as your text editor has LSP support. Hell, even without LSP support it feels quite OK to write Rust code.

I use Intellij for Java, and Kakoune for Rust, and I really dislike working with Java. The fancy refactoring features don't make up for how verbose, clunky and inexpressive Java is.

The Rust way is to have great modular and reusable tooling for everything. Even stuff like complex refactoring can be achieved without an IDE with something like https://github.com/google/rerast

dpc_pw··on The unrealized potential of federation
I'm aware of GNUnet, and been following it loosely for too long to remember. It's been around for like 2 decades?

Superficially it looks to me like bunch of theoreticians overcomplicated everything, and it will never be practical. Probably great project to advance your academic carrier though. But maybe I'm wrong.

← PreviousPage 4 of 20Next →