2,803 karma · joined March 11, 2010
We should call it what it really is: oligapolization of intellectual work. The capital barrier to enter this market is too high and there can be no credible open source option to prevent a handful of companies from controlling a monster share of intellectual work in the short and medium term. Yet our profession just keeps rushing head first into this one-way door.
Cannot tell if this is a joke.
This year, I've switched to herbstluftwm, a tiling window manager that's really nice and works in a way that agrees with me.
Yes.
[1] https://www.humprog.org/~stephen//research/papers/kell17some...
- Having nearly 20 years of experience using Emacs, it's just a totally natural fit for me.
- I program primarily in Rust. I use the built-in LSP client, eglot, to communicate with rust-analyzer and have IDE features such as jump-to-def, find-refs, find-impls, auto-import, auto-format, semantic rename, etc. It works just as well as VSCode/Codium (which I tried for about a week to make sure I wasn't missing out; I wasn't.) I also do the odd shell script, Python script, YAML config, Dockerfile, etc. for which Emacs is also well-suited.
- As far as I know, I'm the only person in the company using Emacs. There's a few vim/neovim users, but the vast majority of people are using VSCode. Having paired with many, I don't think that I'm slower for using Emacs; in fact, I think that I am in many cases faster because I am so familiar with the text operations that I don't even think about them, I just do them.
- Overall, I don't see any reason for me to switch away from Emacs at the moment, especially since LSP really blurred the distinction between "text editor" and "IDE".
- I typically don't recommend that programmers try Emacs if they're not already familiar with it. Partly because I don't want them to ask me questions, but mostly because their natural tendency is to try and reproduce their VSCode/JetBrains/Visual Studio workflow. This usually causes frustration, because the way to use Emacs effectively is different from the way to use a product like VSCode that aims to have a good out-of-the-box experience.
Did you understand this comment to be positive or negative?
Of course, the extra hooks we put in to allow re-use and extensibility usually results in code that is slower and more complex than the simple thing. Worse, very often, when a customer needs a new feature, the current extension hooks did not predict this use case and are useless, and so the code has to be modified anyway, but now it's made 10x more difficult because of the extra complexity and because we feel that we have to respect the original design and not rip out all the complexity.
I like Knuth's quote [1] on this subject:
> I also must confess to a strong bias against the fashion for reusable code. To me, “re-editable code” is much, much better than an untouchable black box or toolkit. I could go on and on about this. If you’re totally convinced that reusable code is wonderful, I probably won’t be able to sway you anyway, but you’ll never convince me that reusable code isn’t mostly a menace.
[1] https://blog.jj5.net/blog/2021/05/21/knuth-on-reusable-code/
C-u M-| jq -c sortIt's not incompatible with the mechanics of OO, but it does require that programmers change how they approach problems. For instance, a common way to write code in an OO language is to focus solely on the thing you want to think about (a user, a blog post, a money transaction, what have you) and to implement it in isolation of everything else, to hide all of its data, and then to think about what methods need to be exposed to be useful to other parts of the system. The idea of encapsulation is quite strong.
In DOD, it is more common for data related to different domains to be accessible and let the subsystems pick and choose what they need to do their work. Nothing about Java or Ruby would prevent this, but programmers definitely have mental barriers.
It's nice to use the ? operator, but if you also want to include logging/metrics, I really recommend using `match` to make it clear what each branch does.
> Embrace the newtype pattern
A nice pattern for certain use cases, but often abused by programmers. Out of the box, a newtype is less useful than the type it wraps, because it has none of the underlying type's methods. This results in either having a ton of boiler-plate code that just does `self.0.underlying_method()` or in programmers making the wrapped value public, which defeats the purpose.
"Embrace" to me means "use it when possible", but my experience says that it should be like spice, a little bit can improve the dish, but too much can ruin it.
> Consider using iterator transforms instead of explicit loops
Similar comment to the point about avoiding matches for Option and Result. For simple use cases, a .map() or .filter() can be good and easy to read, but I've also seen monstrosities with .skip(), .filter_map(), .chunks(), etc. that become a lot harder to decipher than the equivalent for-loop. We also tend to try and write those in an FP style with no side effects, and sometimes that can discourage people from including logs and metrics in places where they would be useful because they would tarnish the purity of the code.
Whatsmore, in Rust closures are more finicky than in GC'ed languages like OCaml or F#, and some iterator methods take their closure parameters by ownership, others borrow, and it's very often an unnecessary mental burden.
> Don't panic
Good idea in general, but panicking is a great tool when the program is in a state that was not predicted by the programmer or cannot be recovered from. "In general, avoid panicking" would be better advice.
> Minimize visibility
It's been accepted since the advent of OOP that we should aim to minimize the visibility of the data in our structures. Every Java IDE defaults to making fields private and auto-generating getters and setters. But more often than not, when programmers hide all the internal details, they limit what other programmers. Yes, other programmers could use the API wrong and create bugs in their programs, but they could also use it in ways that the original programmer could not have anticipated and make something amazing out of it.
And when other programmers complain that they are limited in what they can do, the answer is always "we'll add more stuff (traits, plugins, closure parameters, etc.) to help you do more", increasing the complexity of the code.
> Listen to Clippy
Some of the warnings from clippy are good (e.g., when it reminds you to use .unwrap_or_else() instead of .unwrap_or()), but a lot of the lints are opinions made into code, and people view you very suspiciously if you disable any of them, which drives the general style of Rust toward the style of the people who successfully argued for their opinions to be part of clippy.
For example, I like putting return statements in my code; yes clippy, I know that the value of a block is the value of its last expression and thus it's unnecessary to put the return, but I want to make it more explicit that we are exiting the function here, why are you complaining about that?