17 ms·
Short term usability is not the same as long term usability
- chewxy 6y agoMaximal cooperation? Two schools of thought: 1. Maximal cooperation require maximal composability 2. Maximal cooperation requires some dictatorship Interestingly I find that this is quite embodied in two of my favourite languages - Go and Haskell. Haskell is all about composition. And it does so by dictatorship of its type system. Go is dictatorial in the sense that there is one way to do things, but encourages compositionality, coming from a unix world where pipes are everything.
- sanxiyn 6y agoI consider this a fundamental insight of Rust programming language: that it is a programming language optimized for long term usability. No wonder it is struggling for adoption.
- MaxBarraclough 6y agoI wouldn't say Rust is 'struggling'. Compared to other languages, like say D and Nim, it's doing well. No language could possibly topple its incumbent rivals overnight. To do this, it would have to have great advantages over existing languages, and excellent interoperability, and an approachable learning-curve. That's essentially a contradiction. If your language offers a new and better way to do things, it pretty much must be unfamiliar to those who use older languages. If the concepts involved were similar, you'd be releasing a library, or publishing a compiler optimisation, rather than developing a whole new language. Perhaps that's a bit of a generalisation though. TypeScript isn't doing anything new, it's just adding an old and familiar feature (static type checking) to an old and familiar language that lacks it. In TypeScript's case, the feature isn't ground-breaking, but it's valuable enough that it may be worth the pain of using a different language.
- Symmetry 6y agoIt seems like C++ offered all of "it would have to have great advantages over existing languages, and excellent interoperability, and an approachable learning-curve" and worked hard and made whatever compromises were needed to do it. Which is probably why it took off relatively quickly.
- jnxx 6y agoFor the deeply conservative domain that infrastructure code is, it has a fantastic fast and enthusiastic adoption. It will take a while until it is used as a standard choice for building python extensions and such (which also makes sense, this stuff should last for some while).
- ssivark 6y agoI like the two graphs to organize the conversation. IMHO the key to success (max bang for the buck) is better composability and as little boilerplate code as possible. Haskell and Julia (for example) do this fantastically well. The essential theme of long term usability is very close to what Guy Steele talks about in his fantastic talk/article Growing a language — you want as little as possible embedded into the language, and you want as much as possible farmed off to the libraries so that users can compose the pieces they like without drowning in too much code.
- jnxx 6y ago> Perhaps the best known example of this kind of tool is Make. At its core it is only a DAG solver and you can have arbitrary functionality just by writing shell script fragments directly inside your Makefile. I am still fascinated by redo (https://redo.readthedocs.io/en/latest/ https://redo.readthedocs.io/en/latest/), which provides exactly the same purpose as Make, but turns its interface inside out: Make is a DSL for describing an acyclic dependency graph, with attached command lines to compile, link, install or run stuff, with a minimum amount operations. The fact that Make is not language-specific, and one just uses shell commands to build stuff, makes it versatile. But there are edge cases which have the effect that people often to prefer to do "make clean", because dependencies might not be captured completely. "redo" is internally more complex, but basically it is a set of just ten shell commands which are used declarative to capture dependencies, and are part of build scripts. For example, #!/bin/sh redo-ifchange /usr/local/include/stdio.h redo-ifchange helloworld.c gcc -I/usr/local/include helloworld.c -o $3 has the effect to rebuild a program if the file "/usr/local/include/stdio.h", or the source file "helloworld.c" was changed - be it by the programmer or by a system update. That's it. No "clean" command is needed. The result is, in terms of user interface and usage, fascinatingly simple (I tried it with a ~ 20,000 lines C++ project which generated a Python extension module using boost.) The lack of special syntax needed is just astonishing. But I wonder how well it would run with all the additional complexities like autoconf and autotools - knowing that the all complexity of these tools is usually there for a reason.
- cjfd 6y agoOne thing that one usually does with make is that one also figures out on what header file helloworld.c depends during the make run. Is the above code fragment hand coded or generated? I also am wondering if this also works if one only wants to build part of the project. make can take a list of files to rebuild as arguments. This also provides the ability to only create some set on intermediate files.
- jnxx 6y agoYou could read here: https://redo.readthedocs.io/en/latest/#whats-so-special-about-redo https://redo.readthedocs.io/en/latest/#whats-so-special-abou... (I think this explanation is much better than what I can do) And yes, it can build specific intermediate files or targets.
- wruza 6y ago>project('tutorial', 'c') >gtkdep = dependency('gtk+-3.0') >executable('demo', 'main.c', dependencies : gtkdep) This is a snippet from meson tutorial, and that’s why I’m still using make (and not cmake) in all my personal C projects. I have no idea what flags will be passed to gcc and how to change them (-mmsbitfields was required on windows for gtk). Second, I may have no pkg-config environment when I link windows executable against msys2-installed libs in plain cmd. These shorthands may be a long-term win for a regular project in strict unixlike or msvc-env.bat, but it is not a build system. It is a fixed recipe book (as seen from the tutorial page, don’t take it as a criticism). It substitutes a simple knowledge on -I, -L and -l with a cryptic set of directives. You spoke gcc very good, now you have to speak meson’s local dialect and be able to catch and fix subtle errors in translation. The problem is, one has to investigate into seemingly-easy build system to tune it to their needs. It is much harder than just fixing CFLAGS+= or LDFLAGS+= in a Makefile. For me, a better build system would look like a set of rules, but not in a Makefile, but in a general-purpose language, like: var all_srcs = qw('a.c b.c') if_(files_changed(all_srcs)).do_(changed_srcs => { changed_srcs.forEach(src => compile(src)) }) fn compile(src) { exec('gcc', CFLAGS, '-o', to_o(src), src) } if_... This simple process would cover 99% of common cases and you’re still in control of everything. Just prepend: if (os == 'msys2') { CFLAGS += ' ...' } And that’s it. It is a long-term usability, because you may open this file a year later and still figure out what needs to be done in few seconds.
- wwright 6y agoI'd recommend you take a look at how Bazel works (Meson may be similar if you look further, but I haven't used it much myself). The default interface you get is relatively "high-level", but everything behind the scenes is a general-purpose system like what you describe, and you can customize it pretty deeply. What makes it really great IMO is that the language and tool are designed for best practices. For example, your scripts can't actually execute anything: they can tell the build system what command would be used to build the file and what the dependencies would be. The sandboxing allows the build system to be pretty hermetic without much effort. This means that it can always parallelize your build, and incremental builds are always fast and correct.
- cjfd 6y agoThe general point the author is making sounds true but I am sceptical regarding any criticism against make. Building and/or handling dependencies was basically a solved problem as soon as make was invented and all of the new stuff in this area just seems plainly unneeded to me. Also, when people invent new build systems one can end up with projects where one part is built using one build system and another part is using another. Since things can depend on each other in arbitrarily complex ways because of code generation this will lead to build either too much or too little. In particular having a build system for a particular language is such a strange concept.
- jnxx 6y agoMake works pretty well, that's why it is used. But there are a few points it does not cover: - Recursive building is complicated. it is not really easy to compose a small unit into a larger project, so that one just needs to copy the sub-unit into a folder. - in some instances, it is necessary to type extra instances of "make clean", because the dependency analysis of make does not understand that dependencies have changed. - say you build a program which includes /usr/include/ncurses.h. Then, you do a system update which replaces your ncurses library. Or, you do a git pull which changes that header. Make will not rebuild your binary without "make clean". - files appearing or disappearing along the include path can change the result of a "make clean;make all", but are not detected by make's dependecy analysis. Here an explanation of D.J. Bernstein: http://cr.yp.to/redo/honest-nonfile.html http://cr.yp.to/redo/honest-nonfile.html - doing atomically rebuilds: http://cr.yp.to/redo/atomic.html http://cr.yp.to/redo/atomic.html, so that a new dependency is either there, and complete, or not there - parallel builds (which is related to the previous point, and also to the necessity to have complete dependency information).
- boomlinde 6y ago> in some instances, it is necessary to type extra instances of "make clean", because the dependency analysis of make does not understand that dependencies have changed. The only sense in which Make will analyze a dependency is that it will run rules for which the target does not exist or has a less recent mtime than any of its dependencies. When what you describe happens, it's not a failure of Make's dependency analysis, but your failure to specify the dependency. This is easier said than done with the Make+CC combo, but I attribute that problem to quirks of C and CC, not to Make's dead simple and basically infallible dependency analysis. The only way to cause Make's dependency analysis to "fail" is to modify the mtime of an already built target to be more recent than that of a dependency that would otherwise be more recent. That's only a failure in the sense that it might not desirable, it's still well defined behavior of Make. > say you build a program which includes /usr/include/ncurses.h. Then, you do a system update which replaces your ncurses library. Or, you do a git pull which changes that header. Make will not rebuild your binary without "make clean". If this happens, it's because you have a dependency on /usr/include/ncurses.h that you have not specified for the target. Again, easier said than done to specify the location of system wide header files that are maybe only resolved using pkg-config because you have no idea of their location on the users' systems, but that's not a problem that Make supposes to solve for C and the ecosystem of applications that exist to patch up its deficiencies. Even worse is for example if you've specified your dependency on the ncurses header, update the system and end up with a new ncurses header that has new includes of its own that you have not specified. The only way you'll ever know is by reading ncurses header file. If you don't, the next system upgrade might update those unspecified indirect dependencies and your Makefile will shrug because you haven't specified those as dependencies. Broken, but really not on the Make end. > files appearing or disappearing along the include path can change the result of a "make clean;make all", but are not detected by make's dependecy analysis. Here an explanation of D.J. Bernstein: http://cr.yp.to/redo/honest-nonfile.html http://cr.yp.to/redo/honest-nonfile.html If the developer in the scenario described had simply added "vis.h" as a dependency to the rule that depends on it, it would not have happened. Creating "vis.h" and adding it and running make again would have solved the problem. > doing atomically rebuilds: http://cr.yp.to/redo/atomic.html http://cr.yp.to/redo/atomic.html, so that a new dependency is either there, and complete, or not there target: generate_something ./generate_something -o target.tmp && mv target.tmp target > parallel builds GNU Make for example does parallel builds fine. Yes, it's necessary to have complete dependency information (which in Make is achieved only by specifying it) but that's a necessity of any build system that supposes to reliably track dependencies in every case. In general, your criticism seems aimed specifically against Make+CC. In that sense I completely agree that it's not a great combination and that there are probably solutions much better tailored for building C code that address its quirks specifically. Make works well however when you know what and where your dependencies are. C, when used to build software for n>1 frequently updated operating systems presents a header and library labyrinth that makes that a non-trivial problem.
- deleted 6y ago[deleted]
- hinkley 6y agoI remember when I was starting out that people talked about this problem a lot. But it's been years since I've heard it said unless I was the one saying it. I still routinely wonder if the right solution is to build up an 'action bar' the way video games often do. Microsoft got into this neighborhood with the Ribbon but I feel like they missed the target. You graduate to more sophisticated options and the ones you use all the time are mapped to whatever key you want it to be. Add a hidden flag for setting up a new machine or user where you jump straight to expert mode and you're done. This costs the expert one more setting to memorize, but the payoff for doing so is quite lucrative. Shortcuts seem to work great on QWERTY but less awesome for everyone else. Just let me set my own so I don't have to use an extra finger on Dvorak or a Japanese keyboard.
- tomlagier 6y agoI love this idea! I feel like there are three paradigms that can cover 100% of software. The first is re-mappable hotkeys. An action bar would be great, but failing that - obvious tooltips of the hotkey on every single action. Also a complete and searchable reference that's easily discoverable. The second is a quick-actions panel (a la Alfred, Spotlight, Cmd-P in Chrome Inspector and VSCode). Having this as a generally available searching hub is a huge timesaver, and lets you quickly find actions that you might not have bound. It's also (IMO) the best interface for quickly navigating between objects in different trees. The third is a bog-standard menu system. It should use the same patterns that are ingrained in every software user's head from their first program (File, Edit, View, ..., Window, Help). If every program had these features I feel like there would be very little UI friction at the expert level and a good deal of comfort at the beginner level. Providing a good default "action bar" and mapping of keys for the beginner is left as an exercise for the UX team :)
- mjevans 6y agoWhile that sounds like a great idea... * How do these shortcuts remain consistent between applications? * What's a system wide, task-type-wide, and program specific action? * How do these persist across different versions of OS, application, devices, different ownership (work / home / etc), or otherwise follow the user? * "X is broken" use the shortcut... wait what did you configure that as?
- allenu 6y agoI agree with the notion. I find that a lot of less experienced devs I work with like to prioritize "ease of use" in API design over other things, such as testability, orthogonality, decoupledness, reversibility, etc. If an API is "easy to use" from a client perspective, they often deem it a good one. API ease of use is definitely important, but weighed against other constraints, which are more fuzzy and more about long-term maintainability. Sometimes making an API slightly harder to use (often requiring additional client knowledge about the domain before using it) is worth the trade-off against ease of use since it means it's easier to extend in the future. It's definitely a skill to learn what helps long-term usability vs short term usability. I often go back to Rich Hickey's talk about Simple Made Easy when thinking about this problem. https://www.infoq.com/presentations/Simple-Made-Easy/ https://www.infoq.com/presentations/Simple-Made-Easy/
- umvi 6y agoIMO "public" facing APIs should always be easy to use and only require the minimum information from the user necessary. An example of an outstanding public API would be nlohmann's json library for C++[0]. Whether that API is merely a wrapper for an internal API that is more testable (i.e. allows injection, etc.) or whatever is another matter. [0] https://github.com/nlohmann/json https://github.com/nlohmann/json
- allenu 6y agoI think there can be debate on what is "minimum information". I'd also say "easy" for one developer may be challenging for another developer if the domain of the model is foreign to them. A lot of frameworks require up-front knowledge to work with. To some, that's not "easy", but it allows the client to do so much because what the framework is providing is not simple. In other places, the API can be dead easy because what it's providing is so simple.
- boomlinde 6y agoI agree with the sentiment in the headline, but want to offer a counter example. Consider Emacs vs. Notepad++, for the purpose of editing code. Emacs in this example represents "maximal flexibility" for having a configuration interface where almost every aspect of its function can be (re)programmed, and Notepad++ represents "maximal cooperation" for having a configuration interface and limited toolset tailored to the task specifically at hand (editing code). I'm not going to contribute code to either project; submitting patches for a "maximally cooperative" system to adapt it to your use case is just an advanced and inconvenient form of "maximal flexibility". In my experience this has the opposite relationship to that described in the article. Getting started with Emacs is a significant investment (as per the article, "everything is possible but nothing is easy"), while Notepad++ is pretty much pick-up-and-go out of the box, but over time the extensibility of the former pays off in a better functionality/amount of work ratio. There is an example of "maximal flexibility" in the article, but none for "maximal cooperation", and I'd like to see one.
- robbyt 6y agoI recently worked with a developer who proudly told me he has over 25 years experience. Unfortunately, he wasn't a very good developer. In talking to him, he told me he switched jobs on average every 3-5 years. And I realized this was the problem. He didn't have 25 years of experience, he had 5 years of experience, 5 times over because he never went deep enough to master his craft. He stuck with Notepad++, never bothered to understand topics like hard tabs vs. soft tabs, never added automated linting or reformat to his coding workflow, didn't bother writing tests (or testable code). I'm sure many of us have worked with someone who's terminal is misconfigured, has a messy PATH or their computer is in a general state of disarray. This is an example of short-term usability. Long term assumes general mastery of a tool/system... But this isn't always the case.
- m463 6y agoYou could make the same argument for presales vs postsales. There are numerous examples of this: The look of the apple keyboard in a store, vs day-to-day functionality (or admittedly many apple products, such as a glossy display) Any RGB product for sale now -- RGB keyboards, RGB mouse, RGB computer, RGB system memory. (get it home, turn it off) meanwhile, a trackball or weird vertical mouse might be completely unapproachable, but for the folks who need them they are usable forever after putting in the time.
- lcuff 6y agoContext matters, and context changes over time, making the whole process more difficult. When Apple was exploring how to build the Lisa (their first GUI system) they did user testing on both a single button mouse and a multi-button mouse. New users were confused by a multi-button mouse, so Apple went with a single button mouse. But as the years go by, and users get more sophisticated, it's clear that multi-button mice are better. There's no clear right choice that spans time. How fast are users going to come up to speed? What level of difficulty are you foisting on new users? Will they persist through that difficulty?
- RangerScience 6y agoTake a queue from games: Gradually unlock more features as people use the existing ones.
- Tainnor 6y agoI don't know. There is some truth to this, but it's the same kind of argument I've heard from Rails people, EmberJS people, maven people, and many others; it's the famous "you're holding it wrong" argument. Sometimes you really are the best judge of what you need, and when the system works against you because for whatever reason the designer of the original system thought your problem is not an actual problem, you have to resort to weird monkeypatches or weird workarounds. I would be fine with the "this problem has been solved" argument if we could all agree about objectively right solutions, and in some cases we can (e.g. you don't want to handroll your own crypto), but more often we just don't.