2021-05-15 21:06:00 UTC: We're in read-only mode for probably ~30 minutes for a database migration. Join #lobsters on freenode or follow the todo list.

  1.  

    You can get rid of head -n1 at the end of the pipe by using seq 1 6 | shuf -n1.

    1.  

      I know that’s not the point of the article, but my “Unix” doesn’t have seq or shuf. So i propose jot -r 1 1 6

      1.  

        I’ve found a lot of “Unix philosophy” arguments online rely heavily on GNU tools, which is sort of ironic, given what the acronym “GNU” actually stands for.

      2.  

        i don’t think that helps with the demonstration of programs that each do “one thing well”.

        1.  

          However it still helps in faster execution as that is one less program in the pipeline. I don’t see a problem with shuf containing the ability to output a certain number of lines as that still feels like it pertains to the subject matter of the program and it is quite useful. At least from what I’ve seen used with shuf it is probably the most used option for it too.

      1. 2

        i’m interested in your workflow for creating the font. i haven’t run the files in tools, is one of them for drawing individual glyphs or did you use other software?

        looks great, by the way. pretty close to my ideal font :)

        1. 1

          I first began by using fnt; I now use gbdfed for the font creation.

          And, yes, draw.lua is for drawing stdin with the font and outputting it as a farbfeld image with the help of mkff. charmap.lua generates a character map of all the glyphs present in the font.

        1. 32

          Wow.

          This article starts off with a thoughtful and nuanced exploration of some of the hard issues around open source and big tech, and then kinda jumps the shark as far as I’m concerned:

          Work at a megacorp and either you rot working on menial things, or learn to play the politics game to get a shot at working on the one interesting project… until it gets canceled when the CEO decides to “refocus”, or when Monday comes if you work at Google.

          Honestly, there’s no reason for this kind of attitude. You don’t want to work for big tech? Great! There’s a lot of merit for staying small and feisty and having total control. Rock on with your bad self! But don’t tar every employee working for big tech with the same brush, because:

          1. Your preferences are not their preferences
          2. Your goals may not be their goals
          3. What brings you pleasure and fires your passion may not do the same for them.

          And who are you to tell me what I do or don’t love, or where I can or can’t find fulfillment?

          Am I asking everyone to sit around the campfire and have a sing along? Heck no! Big corporate jobs aren’t for everyone, What I would like is a bit more nuance, understanding and open mindedness and bit less vitriol.

          The “software you can love” idea is interesting, but I guess I don’t really understand the advantage of further muddying the waters in an already super complicated licnesing landscape.

          1. 19

            Thanks both of you for clearing up my own concerns about the lines about Big Tech being tone deaf.

            The “software you can love” idea is interesting, but I guess I don’t really understand the advantage of further muddying the waters in an already super complicated licnesing landscape.

            I, personally, loved this framing. Among many issues with the Free Software movement, one I see constantly is an insistence that personal feelings of delight and good UX are sidelined in the name of “freedom”. Hate how config files feel and there’s no Settings GUI, so you’re not interested in using the software? Well, you’re an enemy of freedom. You didn’t reach the patch notes, the new software broke your system, and you’re annoyed? Well freedom is a choice, and you just chose against it. Not only does this cause people to not take free software seriously, it just means that people won’t actually use free software and will use proprietary alternatives instead, because you’re not taking the users’ desires into account when you’re designing the software.

            I’d love to see an increased focus in free software on software that actually brings joy to its users; software that is fun to use and also free, not free but sometimes fun to use. I love the framing of that in this article. Software, at the end of the day, should solve a need.

            1. 1

              this feels wrong to me. sure, there are a lot of elitist people in the crowd something like the free software movement attracts, but there are also at least a handful of prominent gnu projects with ease of use as a high priority. gnome is probably the best example here, but there’s also lmms and emacs (emacs not so much, but they’ve made some efforts for semi-gui configuration and so on).

              which is not to say that i disagree with your main point. i love gnome for how little i need to configure it (these days i turn animation off and compose key on, and that’s it), and that’s great. but i also love emacs, and that’s for very different reasons, and maybe a lot of people who love the former wouldn’t love the latter or something, but emacs has very much taken its users desires into account in its design (even if currently maintenance isn’t doing such a good job at that).

              1. 1

                I don’t think we disagree on anything discussed actually. Users of different systems have different expectations and needs. A user of Emacs probably has different expectations than a user of MS Word, for example.

                there are also at least a handful of prominent gnu projects with ease of use as a high priority

                Gnome is actually probably the only one I know. And even then, Gnome gets so much flak from many modern FOSS fans.

                there are a lot of elitist people in the crowd something like the free software movement attracts

                This is a question I’d love to unpack. Nothing about free software ostensibly requires elitism, but it’s present at many points of the conversation. Why?

                1. 2

                  i think you’re right, and i misinterpreted some of what you were getting at.

                  Gnome is actually probably the only one I know. And even then, Gnome gets so much flak from many modern FOSS fans.

                  yeah, this sucks. i think a lot of that flak plays into the elitism thing, particularly as gnome seems to take a lot of inspiration from the mac aesthetic. also it appears that gnome do not consider themselves part of the gnu project, so i guess my point falls down anyway.

                  Nothing about free software ostensibly requires elitism, but it’s present at many points of the conversation. Why?

                  i find this interesting too, and i briefly touched on it in my post about nano being pretty good. fundamentally, i’d say it comes down to the fact that free software is an ethical stance. once the ethics of anything get involved, it becomes easy to consider those who don’t subscribe to, or understand, the ethical position as worse in some way, ergo, elitism. with that foundation, all sorts of other elitism can grow, and technical aptitude is an easy target in a technical environment.

                  1. 1

                    it becomes easy to consider those who don’t subscribe to, or understand, the ethical position as worse in some way, ergo, elitism

                    Yeah that might be it. It’s just unfortunate since elitism and ethics just mean that you can bully folks into accepting your UX of choice in the name of ethics, even though the ethics say nothing about UX.

            2. 21

              And who are you to tell me what I do or don’t love, or where I can or can’t find fulfillment?

              Did you miss this part?

              Big tech has been increasingly unable to create software you can love, and that’s the ability you gain by refusing to work for the silicon valley. It’s not for everyone and I can understand if somebody prefers the security of a stable job in a company too big to fail, where they can just go home after work, forget about software, and live a very comfortable life but big tech jobs are not the absolute best choice for those who really love software craftsmanship and, as it turns out, some of these people have taken a liking to Zig.

              Also

              The “software you can love” idea is interesting, but I guess I don’t really understand the advantage of further muddying the waters in an already super complicated licnesing landscape.

              This has almost nothing to do with licenses, where did you get that idea? It seems to me you need to re-read the post.

              1. 18

                I didn’t miss that part. That part is just as tone deaf as the rest of this section of the article.

                Would it surprise you to learn that there are a number of AWS employees who are fans of Zig?

                People take jobs for all kinds of reasons. Those reasons can and often do have nothing at all to do with what those people may or may not love doing on their own time.

                1. 30

                  Just like some work for AWS, I worked for Redis Labs. I don’t regret it, I learned a lot of things, and it was fun until the last phase. It also paid well and allowed me to live a good life.

                  I have no ill will towards people that work at AWS. I do have ill will towards the company, just like I have ill will towards Redis Labs given what’s happening to Redis.

                  If I had no other alternative, I would be still working at Redis Labs. I was lucky and so now I’m in a position where I can share what I think without fearing losing my job. I don’t expect anybody to become a human sacrifice in the name of software.

                  I really encourage you to read the article without seeing it as a personal attack towards you, or as a statement on licensing. It’s neither. It’s about the current dominant model of producing software, its limitations, and how the ZSF knows how to deal with big players that have different interests that conflict with ours.

                  1. 14

                    I really encourage you to read the article without seeing it as a personal attack towards you, or as a statement on licensing. It’s neither. It’s about the current dominant model of producing software, its limitations, and how the ZSF knows how to deal with big players that have different interests that conflict with ours.

                    Thanks very much for this. I will definitely do so.

                2. 6

                  … but big tech jobs are not the absolute best choice for those who really love software craftsmanship and, as it turns out, some of these people have taken a liking to Zig.

                  It’s bullshit to say I don’t “love software craftsmanship” because I don’t work for, and frankly don’t want to work for, a non-profit startup building a new language. I will decide the “absolute best choice” for me. I really like the ideas and motivations of zig, and Andrew seems like a great guy, but your statement is just categorically false.

                  1. 5

                    I might have messed up the English, but I think you have interpreted the sentence in the opposite way of its intended meaning. The sentence doesn’t say that if you love software craftmanship big tech is the worst choice, nor that if you work in big tech you can’t love software craftmanship.

                    What the sentence hints at is the sentiment where if you are a skilled engineer that care about the craft then you have to aim for a big tech job. I used to have relatives tell me that “oh, you’re so passionate, one day you’ll work at google for sure”.

                    I guess it’s hard to have a honest conversation about something that people consider part of their identity. I personally don’t consider my job part of it. I didn’t before working for a SV startup, nor during, and neither I do now.

                    1. 1

                      Maybe this exchange can be of interest to you.

                      https://news.ycombinator.com/item?id=26789129

                3. 14

                  The “software you can love” idea is interesting, but I guess I don’t really understand the advantage of further muddying the waters in an already super complicated licnesing landscape.

                  I had the exact opposite reaction: “software you can love” is nice but honestly doesn’t actually address the root cause of the problem: the profit motive is toxic to software and users. You can talk about love all you want, but the failure of Open Source shows that any approach that isn’t rooted firmly in anticapitalist principles isn’t going to be very effective in the long run.

                  Getting very strong “you don’t hate mondays; you hate capitalism” vibes from the second half of this piece.

                  1. 5

                    I had the exact opposite reaction: “software you can love” is nice but honestly doesn’t actually address the root cause of the problem: the profit motive is toxic to software and users. You can talk about love all you want, but the failure of Open Source shows that any approach that isn’t rooted firmly in anticapitalist principles isn’t going to be very effective in the long run.

                    I suppose I should remind myself that we can hold two ideas in our minds at once. Capitalism though awful has produced a LOT of incredibly good (and incredibly bad :) ) software through the years. That doesn’t necessarily contradict your statement about profit motive’s toxic effect on the process.

                    1. 4

                      Don’t mix up co-occurrence with causality.

                    2. 4

                      I think small shops such as Panic (https://panic.com/) are doing great: it is for profit, but not greedy. Mega corporations are in a totally different league.

                      1. 1

                        I would maintain that it is not capitalism specifically that is the problem, although the profit motive is usually toxic to a degree. Modern capitalism is nothing like what Adam Smith originally proposed and should possibly not even be called capitalism, I prefer the term Neo-feudalism but that is a bit tongue in cheek. I feel like large corporations have become creatures of their own which we no longer control as a species.

                        The pattern of what is happening with humans vs. corporations is starkly reminiscent of what you see in nature when a newly introduced species of plants or animals crowd out endemic species.

                        Should we be concerned that in the long term corporations will replace humans altogether? If so, should we not be waging all out war against them while we still can?

                      2. 5

                        Honestly, there’s no reason for this kind of attitude.

                        100% agree

                        I work for a large corporation. I’m very happy with it. I don’t see any reason to shit on me for that.

                      1. 8

                        I totally support the tag proposal!

                        If a specific tag for Raku could not be accepted, another possibility would be to change the description of the Perl tag in the spirit of the APL tag to include Raku specifically. It is not ideal but an option.

                        1. 5

                          I think this is probably best. I don’t think that there’s enough of a difference between the two languages to support an extra tag (I know there’s some difference. Maybe I’m completely off the mark here, I’ve only slightly used Raku). I’d point to the “lisp” tag as an example of a tag for various languages that are only tangentially related (admittedly clojure is a separate tag) and I’ve seen a lot more around here about lisp than perl.

                          maybe perl people are different from lisp people in what they do and don’t want to see, but i know that a lot of common lispers don’t care at all for scheme, and schemers don’t care for common lisp.

                          1. 11

                            They’re basically two different languages, and I’d personally appreciate being able to browse Perl (5) posts without seeing Raku posts. But I’m okay with Raku posts under the perl tag if the amount of Raku posts is still low.

                            1. 2

                              I would differentiate between what I see and think that the communities only partly overlap. There are also some historical reasons I think.

                              Personally I’d prefer to be able to filter between one or the other, so I agree with the statement:

                              Having a separate tag will both enable Raku enthusiasts to promote the language, and Perl 5 curmudgeons to filter it out ;)

                          1. 7

                            i agree with most of the other comments, this seems a bit excessive. the more concerning cases of email validation being wrong that i’ve seen in the wild tend to be whitelists:

                            • blocked because my address used the .pink tld.
                            • blocked because my address used the .io, .co, and .sh tlds. .co and .io in particular seem common enough these days.
                            • blocked because my university .ac.uk address wasn’t on a “whitelist” of “legitimate institutions”. my uni is pretty highly regarded, so i don’t know what their criteria are. i played around with this one, and it accepted only about ten uk university domains.
                            • blocked because i used plus addressing.
                            • blocked because “it looks like you’re using a custom domain. to continue, please use your actual gmail or outlook address”. paraphrased, but it made the assumption that i would be using a mainstream email provider and wanted me to use that address.
                            • blocked because i wasn’t using a gmail address. perhaps it accepted something else too, but the only error i got was “your email is not valid” so i can’t say.

                            i care way more about this kind of email centralisation and gatekeeping than i do about whether an old rfc says emails should accept multiple @s for routing purposes.

                            1. 2

                              My first two contributions were a documentation fix to Emacs, and the addition of global-goto-address-mode. I’m happy I did both, but I still do not feel comfortable contributing, and I also kind of can’t at the moment due to difficulties sorting out their papers I need to commit anything more.

                              Be curious and use IRC.

                              1. 2

                                this is pretty cool. i did a similar thing ages ago, but with the bee movie script. because i needed to do /something/ to get through computer science classes at high school, i also went through the script and modified it to use the toki pona phonology, which didn’t get me as far as i wanted, but did get me farther than using the full alphabet.

                                1. 1

                                  I encoded 3 books as QR codes and printed them as part of my bachelor’s degree graduation work. Something between conceptual and generative art lol. They were not compressed (so you could scan any part of it and see the text) but they were still smaller than the original plain-text.

                                1. 7

                                  many companies that are household names today–Netscape, Yahoo, Excite–simply did not exist.

                                  It’s funny how these things go. I didn’t realise this was from 1999 until this point.

                                  1. 5

                                    The original debate is from 1992, back then the Internet still had an Acceptable Use Policy that prohibited commercial activity.

                                  1. 3

                                    Doesn’t answer your questions but if you’re looking into something similar with wider adoption, from my experience, Kotlin Native is pretty close from Swift and benefit from a larger community.

                                    1. 4

                                      I was thinking the same thing. Relevant article http://nilhcem.com/swift-is-like-kotlin/

                                      1. 2

                                        Afaik swift uses exclusively value types (using cow to avoid spurious copies), while kotlin has reference semantics. Which is a pretty big difference.

                                        1. 7

                                          No, in Swift a “class” type is a (ref-counted) heap object with reference semantics. A “struct” is a value.

                                          Most standard library types — strings, collections — are structs, because value semantics are useful. Internally they are wrappers around a class object holding the data, with some COW idioms that allow the class object to be mutated if its refcount is 1, else copied.

                                          1. 1

                                            Most standard library types are structs, because value semantics are useful

                                            So, my point stands: swift has pervasive value types, in a way that kotlin doesn’t.

                                            1. 2

                                              I don’t think your point stands. You might as well say that C++ “uses exclusively value types” instead of reference semantics, because the STL containers and strings are value types. Which is silly.

                                              (Is this an English-language issue? “Exclusively” means “only”, so you were saying that Swift only has value types.)

                                      1. 1

                                        we’re making explicit that once third-party cookies are phased out, we will not build alternate identifiers to track individuals

                                        idk man didn’t you also make it explicit you weren’t gonna be evil?

                                        I’m very pleased that third-party cookies are being phased out. But I’m not going to be pleased with what happens next until enough time has passed and Google has continued to undo the damage they’ve caused. Which, given the article also makes explicit that they still have a significant interest in advertising, seems unlikely to be the case any time soon.

                                        1. 1

                                          I haven’t heard Google say “don’t be evil” in maybe ten years. It’s amazing how much sticky goodwill that earned them early on.

                                          These days many of us don’t trust Google, deliberately avoid their products, avoid their ads. So this looks to me like a case of responding to market demand. They’ll stop the things people are wise to, and may continue doing things people wouldn’t like but don’t know about. I’m not sure that will gain them much trust back where they’ve lost it, but it might mean people don’t switch away from Chrome so fast.

                                        1. 3

                                          Why would I use screen over tmux? Honestly curious, have no experience with screen.

                                          1. 7

                                            It’s often preinstalled. Many users are familiar with it over tmux for that reason.

                                            1. 7

                                              There are many reasons, none of them is really general:

                                              • Being oldschool and being used to it. tmux is different and even if you change Ctrl-B back to Ctrl-A, it’s not a drop-in replacement.
                                              • Missing serial console support in tmux and some other more exotic features missing in tmux (probably on purpose).
                                              • IMHO easier to configure (albeit definitely less mighty)

                                              (Disclaimer: I’m the author of the linked blog posting and the maintainer of Debian’s screen package, so I’m probably biased. ;-)

                                              1. 5

                                                Screen is good enough, I know the shortcut keys I need and it does serial ports. There is nothing I need that it doesn’t do, so why change? Not all change is progress…

                                                1. 7

                                                  Good summary, yes. :-)

                                                  There are admittedly also some downsides: Most of the code of screen is ancient, has only few comments and is not easy to understand. It’s older than the Linux kernel. And despite it’s a GNU project these days, it started as IIRC “BSD Screen Manager” or so on BSDs.

                                                  1. 1

                                                    what’s wrong with old code?

                                                    1. 3

                                                      Nothing in general, but it tends to accumulate issues over time:

                                                      • Occasionally stops compiling with newer, more strict compilers.
                                                      • Does not adhere to current coding standards which usually focus on readability and avoiding common errors → harder to read, more error prone.
                                                        • Also might hinder attracting new contributors or maintainers.
                                                      • The current maintainers might no more know what the code was for if the original authors are no more around.
                                                      • At least Screen is known to have support for quite a few dead operating systems (think SunOS, etc.). These kind of tweaks can cause issues on modern operating systems. The master branch in Screen’s git repo has some cleanup on that, but unfortunately also kicked out some features which are still in use. No release has been made out of that branch anyway. I suspect that it will become version 5 if there will be ever a release out of that branch.
                                                      1. 3

                                                        The rest of the sentence says:

                                                        has only few comments and is not easy to understand

                                                        So, harder to maintain, fix, improve upon?

                                                        1. 1

                                                          that would be an issue, but i don’t see what that has to do with the age of the code

                                                          1. 2

                                                            Different common sense and coding style now and back then.

                                                            1. 2

                                                              Maybe, but two developers today may differ just as much in their common sense and coding style. It can be a pain to work on a code base written in a fancy IDE, if the author leaned on syntax highlighting and auto-completion to compensate for clunky names. There are a lot of factors that could make old code better or worse than new code.

                                                2. 2

                                                  In addition to the other answers… tmux feels generally more vim-like, while screen is more emacs-like. If you already have a preference in that game, that tends to color your perceptions of them.

                                                  1. 2

                                                    Any chance you could elaborate on that? I’ve never gone deep into configuring either of them, but by default both feel more emacsy in bindings. What is there beyond that?

                                                    1. 2

                                                      Interesting. Never came to that thought, but at least it seems to fit for me: I’m a GNU Emacs (and GNU Zile) guy. :-)

                                                      Then again: I don’t see where Screen is very emacs-ish. So I’d also be interested in a more detailed explanation.

                                                  1. 5

                                                    nano is my daily driver of editors, never really understood the amount of negativity it seems to attract.

                                                    1. 2

                                                      I think it’s not the inherent qualities of nano that cause it to be so reviled, but the fact that in some distributions it’s the default editor. All of my experiences with nano can be described as follows: “Ok, $EDITOR and $VISUAL are not set, so git commit opens the confusing default editor; how do I exit this?” This happens fairly often if you have to jump between various machines. I didn’t even actually ever try using nano seriously and only know of it due to these frustrating experiences, which, irrationally, link this editor in my head with the general sense of irritability. I don’t go around disparaging nano, but can see why some people do.

                                                      1. 2

                                                        Maybe there’s something to this, but what would you propose happens instead? The program refuses to run until $EDITOR is set? That would certainly be more frustrating and confusing for many than Nano. Maybe vi or ed? If you find it easier to exit one of those than an editor with a permanent label in the corner telling you how to quit, I don’t know how to argue. A GUI editor? That wouldn’t work well on servers.

                                                        Maybe I’m sheltered, but the only people I’ve heard speak down on Nano are those who use advanced editors like Emacs, Vim, and now VSCode. If one is at a level where they are comfortable in any of these, I think it’s reasonable to expect them to be able to export $EDITOR wherever they go.

                                                        Regardless, I still don’t see why people go around disparaging nano if they find it irritating. Just as I don’t understand why people disparage Vim or Emacs. It solves nothing and is kind of juvenile.

                                                        1. 1

                                                          Any fixed option would likely frustrate a lot of people, so is it even a problem to be solved, as opposed to a sad fact of life? It seems that it’s only the emotional response to nano that is harmed here. Also, having used both vi(m) and emacs, I agree that nano is a much more sensible default than they are.

                                                          That said, if one did pose this as a problem, one solution would be to allow the user to choose among the popular editors in $PATH via dialog(1), though in my opinion, this would be overengineering given the low impact of the issue.

                                                          1. 1

                                                            That seems like a great solution, and reminds me of the select-editor command. I don’t know what actually makes use of it, but when run it has a list like you said, and sticks a binary to run in a dotfile. It’d have to be patched in to software in some way I guess, unless the dotfile was sourced by the default shell, but I like where you’re coming from. Overengineering? Probably.

                                                    1. 1

                                                      I use jove for many of the same things, and I’d like to add another advantage: It allows full-speed typing. Emacs, for example, does not. You have to start it, wait for a window to become ready, then resume typing.

                                                      Editors like jove, nano and vi accept commands from the moment you’re done invoking them, even before the kernel has started paging the editor’s executable into memory.

                                                      1. 3

                                                        I only have to open Emacs once every time I restart my machine, so it is non-problem for me.

                                                        1. 1

                                                          I’ve not used Jove. Is it Emacs without the lisp, like mg or zile? I use mg on OpenBSD sometimes, but forget whether I’m in Emacs and get frustrated when things don’t work.

                                                          I can’t say I’ve ever experienced the problem you describe, but I work quite slowly. I just timed opening Emacs from cold, and it takes just over a second. It takes less than half a second after that, even without using emacsclient. That’s still fifty times slower than nano, true, but it seems to grab keypresses from the get go as well - every time I started typing as soon as I pressed enter and all the text showed up.

                                                          1. 2

                                                            Yes. Jonathan (whose last name I’ve forgotten) wanted an emacs and wrote one, in C. I tested a couple of curses-based editors with emacs keybindings and found jove best, and it’s stayed with me for 25 years. Maybe mg or zile are better nowadays. I do use emacs itself for when I’m working in the editor, but jove’s my to-go when I’m working on the command line.

                                                            I know that a lot of people either never work on the command line and/or can’t type quickly. But for those of us who can type quickly and do work with command lines, being able to type at the editor without any pause is valuable.

                                                            When I looked for jove, emacs itself would either accept keypresses at once or require you to wait for it to open an X11 window depending on…. I think there were two conditions, but I can’t remember. It’s been so long.

                                                            1. 1

                                                              Did jove use to be “joe” (Joe’s Own Editor)? I think it used the slang library, like the slrn newsreader.

                                                              1. 2

                                                                No, that’s a completely different editor written around the same time. Someone named Joe wrote one, someone named Jonathan wrote the other.

                                                                1. 2

                                                                  You might be thinking of JED there - that one definitely used slang. https://en.wikipedia.org/wiki/JED_(text_editor)

                                                                  1. 1

                                                                    Correct, someone named Joseph created JOE:

                                                                    https://joe-editor.sourceforge.io/

                                                                2. 1

                                                                  Oh I see, I forgot that Emacs had an X11 version. I always run Emacs in the terminal so don’t need to wait for a window to spawn. I’m glad you’re happy with Jove!

                                                            1. 7

                                                              nano is my go-to editor and I have only good things to tell about it.

                                                              Also, unlike Vim (and Emacs for a long time) it supports the XDG spec.

                                                              1. 2

                                                                If you feel comfortable elaborating, I’m curious why you’d pick it over other editors. Are you primarily sshing to places that don’t always have other editors installed?

                                                                1. 7

                                                                  That is mostly my use case with it. nano works out of the box. It requires no configuration and it’s the same everywhere. That is valuable to me as I need to change a setting or tweak a service file or whatever. It’s not my main editor. I use VSCode for that. You could argue that I could use vi for this, but I just need to change a damn file. I’m not going to work on it for long. Maybe I’ll tweak a line or two and move on with my life. I can use vi, but really, it’s an extra mental load when all I’m doing is scrolling down a file to find the setting I need to change to “yes”.

                                                                  1. 2

                                                                    that makes complete sense. i definitely wasn’t asking from a position of trying to evangelize my own approach. thanks for explaining

                                                                2. 1

                                                                  Also, unlike Vim (and Emacs for a long time) it supports the XDG spec.

                                                                  It is possible to configure vim to respect XDG. I have this in my ~/config/vimrc:

                                                                  set undodir=${XDG_CACHE_HOME}/vim/undo//
                                                                  set dir=${XDG_CACHE_HOME}/vim/swap//
                                                                  set backupdir=${XDG_CACHE_HOME}/vim/backup//
                                                                  

                                                                  These tell vim to put everything in .cache (I also create those directories if they don’t exist in a file included from my .bashrc because vim sulks if they don’t exist). This also avoids cluttering my filesystem with ~ and .swp files: they all go in ~/.cache where I can clean them out centrally if I ever want to.

                                                                  I have this in a file included from my .bashrc:

                                                                  export EDITOR=vim
                                                                  export VIMINIT="source ${XDG_CONFIG_HOME}/vimrc"
                                                                  

                                                                  The second of these lines tells vim to source my ~/.config/vimrc file when it starts up. It will also try to source .vimrc but it’s quite happy if that doesn’t exist.

                                                                  With this combination, I don’t have a ~/.vimrc and everything seems to work quite happily in XDG locations.

                                                                  1. 3

                                                                    I don’t think there’s any question about a highly configurable editor being able to be made to respect XDG. But that’s not really the same as supporting it, is it? That’s a quite a bit of configuration, in files for two different programs. And even then you have to manually create directories to get it to play nice.

                                                                1. 1

                                                                  I really like projects such as micro, because while I think that it’s good to have a million editors that are basically the same some diversity and projects trying to do stuff differently is good.

                                                                  1. 1

                                                                    I was under the impression that micro aimed to get rid of diversity in the terminal editor space by moving to standard GUI keybindings?

                                                                  1. 2

                                                                    It seems like vi lite with emacs-ish bindings (chording over combinations).

                                                                    1. 2

                                                                      Pretty much. Although some of the common keybindings are different enough it can get confusing (C-w, C-s, for example).

                                                                    1. 3

                                                                      those were some of the things that you can do with nano that a lot of people don’t seem to realise. it is definitely not up to the level of vim or emacs, but it is a very capable editor.

                                                                      I think that this is just the reason why so many people are surprised when someone invests time into nano: If you’re ready to learn an editor and invest your time, why not use something as widespread as vi or as powerful as Emacs? As a TA, I usually recommend people use nano over vim when starting to work in a shell environment, but if they seem interested in learning more, it seems to make sense to look elsewhere?

                                                                      1. 3

                                                                        I think it depends what the person wants. Nano is in my reckoning quite equivalent to Notepad++, and there are a lot of people out there who find Notepad++ the comfiest environment for them. The features in the article are essentially equivalent to what I use in vi/Vim, except with a modeless paradigm. Vim offers more (I don’t think vi does), but most people really don’t need more. Emacs is slightly different, but once again those features are the core of what I do. The Emacs advantage comes from being a whole interface rather than an editor. In my experience, Nano is as widespread as vi these days, and out of the box is friendlier.

                                                                        I don’t know. The point of the article wasn’t really to convince anyone to switch to Nano. Personally I use Emacs and am very content, but I was fed up with Nano being used as a punchline by people who hadn’t even actually looked at it.

                                                                        1. 1

                                                                          Oooh I wouldn’t go nearly that far to call nano equivalent to Notepad++. Notepad, yes, but the ++ has so many “advanced” features, and most of them out of the box, that it’s simply not the same category.

                                                                          At least that’s my opinion. But of course, what you use your editors for and what I use them for are probably vastly different.

                                                                          1. 2

                                                                            I didn’t necessarily mean in terms of features (and in terms of features, just skimming the documentation it appears to have significantly more than both Nano and itself last time I used it). I do object to the Notepad comparison, which was what sparked the entire article in the first place. Notepad only allows the editing of plain text files. Nano has multiple features to benefit programmers and fit pretty well in a Unix environment.

                                                                            By comparing Nano to Notepad++, I was definitely focusing on the “comfiness” aspect. That is, a primary goal is to be intuitive as well as power. Notepad++ fits in well on Windows and behaves as one would expect a Windows program to behave. I believe that Nano is the Unix equivalent.

                                                                            Out of interest, what do you use your editors for? You’re probably right, I don’t program professionally and mostly do typesetting.

                                                                      1. 3

                                                                        nano was my go-to CLI editor for a long time. I eventually replaced it with micro, a self-described successor. In both cases I always liked that I could use them out of the box and that they felt relatively close to the GUI editors I used more frequently (in terms of keybindings and editing modes). Learning vim or emacs never felt worth the time.

                                                                        1. 2

                                                                          I used micro for a while, and I definitely think that the “self-described” part is important. I found it very different to nano, and that confused me (although that might be because I haven’t used any “normal” editors for so long). It was also a significantly larger program with no real gain: I used the same few features. I am glad it works for you, that is all that matters.

                                                                        1. 3

                                                                          Trying to improve my Go skills to implement an rss2email knockoff, because Python is hot garbage and keeps breaking on me for reasons I don’t understand at all.

                                                                          Also clearing up and organising all my paper. There’s a lot of it.

                                                                          1. 1

                                                                            I only keep track of trivia in a somewhat structured way. If it’s a holiday or historical event, I’ll add it to my calendar file. Then I call calendar in my shell startup script, and when the date comes up it’ll prompt my memory of what happened.

                                                                            I also have a til script. It looks like this:

                                                                            #!/usr/bin/env sh
                                                                            
                                                                            if [ $# -eq 0 ]; then
                                                                            	printf "til "
                                                                            	cat $XDG_CONFIG_HOME/til | sort -R | tail -n 1
                                                                            else
                                                                            	printf "%s\n" "$*" >> $XDG_CONFIG_HOME/til
                                                                            fi
                                                                            

                                                                            It’s simple, but it works. I learn something and type til a second is defined relative to radiation levels in a caesium atom. That’s also in my shell startup, so I get some fun trivia whenever I open a new shell.

                                                                            til that a second is defined relative to radiation levels in a caesium atom
                                                                            Feb 03* seminar: ethics (9:00-10:30)
                                                                            Feb 04  patricia hearst kidnapped by symbionese liberation army, 1974
                                                                            ;