1. 5

    I use zsh, and mine is pretty basic.

    [woz@freebsd.local ~]
    >
    

    Username, hostname, current directory (chopped if it gets too long). It also shows the return code of the last command if it wasn’t 0, and will show version control information (branch name, etc.) if applicable.

    Maybe the only slightly unconventional thing is to use two lines.

    autoload -U colors && colors
    PROMPT="[%{$fg[green]%}%n%{$reset_color%}@%{$fg[red]%}%M%{$reset_color%} %{$fg[blue]%}%8~%{$reset_color%}] \
    \$(_git_prompt_info)%{$fg[red]%}%(?..(%?%))%{$reset_color%}
    $(echo '>') "
    

    For the record, I think using a framework for this kind of thing is kind of silly.

    1. 3

      Funny in itself and because he did not cite Regehr and because those irq_chint settings could be legit

      1. 2

        Regehr is cited later.

        1. 2

          Regehr found the example, Bastien thought of scanning through github, and this person posted it as his own idea. Not a big deal - nobody is going to win a Field medal for noticing this - but still it’s not polite.

          Also the IRQ variable is almost certainly using xor as intended to zero the last three bits - it should have been done with defines or constants, but it illustrates the complexity of distinguishing good from bad even for this example.

          1.  

            It really doesn’t seem that filing this with links to twitter threads is presenting it as their own idea.

            Posting good tickets is also necessary and useful work to be done, I would say they were being helpful.

            1.  

              but he did not - someone else posted the link.

              1.  

                Umm the first note in the bug report links to twitter twice. Are you claiming this was edited later?

      1. 4

        The answer is no and the answer will always be no.

        This is one of those cases where pulling on a loose string yields more and more string, which then continues to escalate until the whole construction is in it’s constituent pieces.

        For if the answer would be “yes” as to whether C/C++ compilers should warn on bitshift operators when the user most likely ment exponentiation, then we would end up with the expectation that these compilers should consider programmer intent to be more important than arcane standards and the result would be something that’s no longer C/C++.

        There are hundreds of examples of C/C++ specification lawyering where compilers felt entitled to rely on a strict reading of the specifications to do the unexpected or programmer unfriendly thing, taking “undefined behaviour” as a license to shoot existing codebases in the foot retroactively, usually without warning.

        This is a collective delusion* that’s too late to nip in the bud. One of the distinguishing feature of some newer programming languages (beyond the syntax and semantics) is the vastly different attitude to creating compilers.

        *a bit like how the node community pretends it’s normal to have thousands of separate modules in one’s dependency tree, it’s not normal, but design costs like these are like background radiation

        1. 17

          The answer is no and the answer will always be no.

          Quoting Jonathan Wakely from the bug report:

          There’s nothing wrong about implicit fallthrough, misleading indentation, ambiguous else, or missing parentheses in nested logic expressions either. But people get it wrong all the time.

          Pretty sure the answer is going to be “yes”.

          1.  

            I’m not sure why you’re equating charging the language semantics with adding warnings, the entire purpose of which is to catch “correct” code that is unlikely to actually have the behaviour intended by the author.

          1. 4

            Then there’s the legacy code that even the owners have disowned.

            Reload is the GCC equivalent of Satan. […] What does reload do? Good question. The what is still understandable. Don’t ask about the how.

            Face it: some code is just garbage, and there’s no easy rule to quantify it.

            1. 6

              “75% of developers” and “75% of developers who chose to respond to a Stack Overflow survey” are two very different things. In my team of 7 devs, I’d hazard a guess that I’m the only one with any non-trivial OSS contributions (and I barely get past ‘non-trivial’, myself).

              The rest of the article doesn’t bring much to the table, either - perhaps not surprising as it is authored by a “Marketing and growth manager”.

              1. 1

                As of this writing, the account that posted this story has posted 17 stories and contributed no comments, and all the stories are to the same domain. I doubt the title of “Marketing and Growth Manager” should be surprising.

              1. 3

                I recently gave up on tiling window managers after some number of years of use. The main reason for stopping was I grew tired of constantly tweaking it to deal with windows that don’t quite fit the tiling mentality. Problems would show up with apps I don’t use very often or maybe just wanted to try out. Windows would sometimes be hidden or seemingly go missing and I just didn’t want to deal with it anymore.

                I’ve since gone back to twm, of all things. I’ve found that placing windows is not really a burden (since it doesn’t happen that often) and it still has simplicity on its side. I’ve never found that integrated desktop environments have helped my “productivity” so I don’t worry about them. I suspect my undercurrent of cynicism comes from the fact that I’ve been tweaking desktop setups for more than 20 years and finally come to terms with the idea that reaching desktop nirvana is most likely never going to happen.

                1. 1

                  I ran twm while working on KDE - specifically hacking the window manager and the panel. Working on something while trying to run it at the same time isn’t fun. I could very quickly kill twm and start kwin to test stuff out, then start twm again, without any disruption to my windows.

                1. 9

                  For me it very much depends on the type of the book. If I expect a book to have a lasting value, such as yours, then I generally prefer to have a paper copy (ideally would have both paper and ebook, but pricing rarely makes that sensible).

                  On the other hand, if it is a book with a more ephemeral value such as describing a particular technology (e.g. Using Angular X), then I prefer not to kill trees.

                  Our personal library has about 1000 paper books. I also have around 250 ebooks, mostly related to my work as a developer. I recently thrown away more than a meter of bookshelf worth of tech books because they were utterly useless. I still like learning from books, but this habit is being challenged with progressively worse quality (even from established authors). I am 45, so who knows how much of this is true for younger generations.

                  1. 1

                    If I expect a book to have a lasting value, such as yours, then I generally prefer to have a paper copy. On the other hand, if it is a book with a more ephemeral value such as describing a particular technology, then I prefer not to kill trees.

                    My rough rule of thumb is that if a book seems like it would make a reasonable thesis or research project, it probably deserves a paper copy.

                  1. 3

                    Related: native English speakers are the world’s worst communicators. Here’s an example from a story the other day:

                    As any beleaguered Pythonista knows, the move from 2 to 3 has been stretching on interminably.

                    I had to guess (and then look up to confirm) what “interminably” means. It would be so much clearer if the author had just used “forever” or “without end”.

                    Immediate feedback from services like Grammarly and Readable are helpful.

                    I tried Grammarly a few times, and found that literally every single suggestion it gave me was rubbish. I have not yet tried Readable.

                    1. 3

                      As any beleaguered Pythonista knows, the move from 2 to 3 has been stretching on interminably.

                      There’s nothing wrong with this sentence if the target audience is not the global audience. I don’t know the context of that sentence, however. If it’s someone’s blog, there’s nothing wrong with it. If it’s technical documentation, it seems like a poor sentence.

                      The article you linked does hit on one aspect that is important for non-native English speakers: abbreviations. If you’re writing something somewhat formal, do everyone a favour and introduce your abbreviations through parentheticals before using them.

                      1. 1

                        Not a native speaker of Englisch. By itself I was a bit puzzled by this sentence. I searched for its source on the web (a blog post) and read it in context: no problem at all.

                        As a non-native speaker I am very used to “parsing” sentences with words I don’t know. It’s not a big thing tbh. Whats probably a bigger problem is if central terms are not properly introduced / understood. For example I was for years not aware that fixture is not an absurd word (I always thought it would come from something like an “invariant” that every test method would have, whatever) but a word for permanent stuff in rooms and buildings like furniture.

                      2. 1

                        I found ‘beleagered’ more of a challenge. From context, I think it means something like ‘experienced’. I don’t know the word ‘interminably’, but I know the word ‘terminal’, so that and the context give me enough confidence that it means ‘endlessly’.

                        1. 3

                          “Beleaguered” is a less harsh way of saying “tormented” or “harassed”. It’s a way to capture the notion that you have been worn down and are ready to give up.

                      1. 3

                        I’m free for two weeks before starting a new job. I was planning to read and write a lot, but I barely get anything done. So just doing some stuff in the house, groceries, cooking for me and my GF, and training (sprinting). I have a competition next thursday. Last competition I ran 100m in about 13 seconds which is quite terrible, but I do it mostly for fun (but I’m still hoping to improve myself).

                        I still have this idea to make a simple specification for instruction set architectures, to automatically generate assembler and disassembler from it. That, and more blogposts and some shaders are stuff I still want to work on. Good job, everyone who is getting a lot of stuff done!

                        1. 2

                          I’m free for two weeks before starting a new job. I was planning to read and write a lot, but I barely get anything done.

                          This is fine. That kind of a break doesn’t need productivity. If you’re going to read, read for the joy of it!

                        1. 6

                          I’m going to spend the rest of the week touring with my musician friends in a few cities across Romania! 🤘

                          1. 2

                            Nice! Which cities? I have a coworkers there. Maybe I can promote for you. ;)

                            1. 1

                              Hah! :) We’re going to Brașov, Bucharest, Cluj, and Timișoara, venues here.

                          1. 5

                            I’m reading through UNIVAC I manuals and getting a sense for programming in the 50s. The manuals are maddeningly inconsistent and in some cases contain totally unexplained code. I’m trying to figure out an interesting blog post for them.

                            I’m also reading David Graeber’s “Debt” (great book and I’m choosing to read it slowly).

                            1. 13

                              I don’t think this is much of an insightful piece, and the “fragile/agile” thing isn’t much of an amusement, but it got me wondering whether the deification of the Agile Manifesto is appropriate.

                              This article does what a lot stuff that is critical of Scrum do: point to the Agile Manifesto and say, “Scrum isn’t doing that”, especially the “individuals and interactions over processes and tools” part. There is rarely an alternative presented and rarely any discussion around what something better would be. Maybe we should be asking, do the principles of the manifesto actually work, or does anyone even really follow them?

                              I mean, we keep saying they do, but that’s mostly because they just feel right. As a developer, it seems that interactions with stakeholdes is better than a rigid process. Working software certainly seems more valuable than lots of documentation. That said, I’d really appreciate some decent documentation a lot of the time (and learn about the software a lot faster with it). There’s no doubt that sticking to a plan despite changes is silly, but without a plan, you’re lost.

                              My reading from those who point to the Agile Manifesto as a kind of sacred text is that they don’t reflect on what it is they should be doing. Instead, they complain that they don’t like processes, documentation, and planning. And many who agree with Scrum being junk are pushing their own methods or methodologies. Given the vast number of failures supposedly based on the principles of the manifesto, perhaps it’s time to start questioning the manifesto.

                              (Disclaimer: I say this as someone who thinks the manifesto has an important kernel of truth, but like most other “sacred texts” has lots of interpretations and thus, isn’t very good as a citation mechanism.)

                              1. 4

                                The thing is – the Agile Manifesto was very much a reaction to the state of the world when it was written. I mean, it was trying to get things you could show/deliver to clients down to a few months! This was 2001, I think – it was normal for developers than to go off into the woods for months at a time with almost no client/customer interaction and return with something that didn’t meet the clients’ needs.

                                Even on large projects, the deliverables, scheduling, and interaction with business have gone up an insane degree in the last 15+ years. You could debate how much an impact that Agile Manifesto had on it, or if it was just tooling and general awareness.

                                Additionally, it might be worthing noting that Scrum predates the “Agile Manifesto” by 5+ years, so scrum not adhering to a manifesto written well after its norms were in place is – unsurprising. The Agile Manifest was inspired by Scrum (and RAD, XP, DSDM, FDD and various other “light” attempts in the 90s), then sort of ended up lumping all versions of those under a wider brand.

                              1. 3

                                [Make] tries to do everything: for example it includes an incompatable reimplementation of shell…

                                Where is this? I’m not aware of Make (in any form) reimplementing a shell.

                                The kind of ratio here: 80 lines [tests] vs 17195 lines [DejaGNU] for two programs that achieve the same task is something that I’ve discovered is complete normal.

                                DejaGNU is certainly a mess and you shouldn’t use it, but the 80 line script presented is not at all equivalent to what DejaGNU can do. (Maybe it achieves the same task you’re looking to accomplish, in which case, great. If your needs start to expand—and they inevitably do—that 80 line script is going to get pretty hairy.)

                                Aiming for simplicity is a good idea and a worthy goal. That said, software gets complex for a reason: once it’s out there people build things on top of it and are reluctant (or outright refuse) to change their interfaces. Any design or implementation problems that don’t show up for a while become features, not bugs. So if you change it for any reason, your downstream consumers will scream bloody murder.

                                An example: with something at my job that we ship, we shipped it with a name that was wrong/misleading. After the fact there was an effort to correct it. Those who were using it said doing that broke a bunch of their scripts and to not change it. So it still has that name that basically makes no sense, and there’s a lot of cruft in the code to deal with it. And that’s a simple example.

                                Compilers have a plethora of options and settings for similar reasons.

                                1. 3

                                  I’ve worked remotely for the last two years, and worked remotely during the latter part of my graduate work over 10 years ago.

                                  I think @lorddimwit’s point about getting out is important. I meet with my local coworkers about once a month and sometimes go to the library to work. It’s very helpful and I’m glad the post touches on this when talking about team summits.

                                  I work for a hardware company where most people are not remote workers. I don’t quite buy the post’s assertion that “you are either remote or you’re not”. Our team is almost all remote. Our manager is in the office and keeps us up on the latest company news, which is helpful. If you limit the assertion to a team, then perhaps I’d agree. In our case, we’re an outlier within the company and it’s just fine. (That said, we do software in a hardware company, so maybe we’re just an outlier to begin with.)

                                  Lastly, while I agree with the OP that you shouldn’t skimp on equipment, I can tell you that I also bought the Bekant standing desk from Ikea that is linked in the post. It turned out to be a dud. I didn’t move it for a while, now it can only move down in very small jumps. I managed to set it at a level that works for sitting. It was a waste of money. (I’ve since taken up the habit of just getting up and walking around for a few minutes every now and then, which is about as good as using a standing desk.)

                                  1. 1

                                    Lastly, while I agree with the OP that you shouldn’t skimp on equipment, I can tell you that I also bought the Bekant standing desk from Ikea that is linked in the post. It turned out to be a dud.

                                    Yeah, I think sit/stand desks are flashy distractions that don’t actually help. I just keep a chair next to my regular fixed standing desk, and I sit in it a few hours a day, but keeping my monitors on my desk means I’m incentivized not to be lazy and spend all day sitting down.

                                  1. 2

                                    This is described in the C99 standard, section 6.7.5.3, paragraph 14.

                                    An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied.

                                    This then references section 6.11.6:

                                    The use of function declarators with empty parentheses (not prototype-format parametertype declarators) is an obsolescent feature.

                                    It’s the same in the C11 standard, except it’s section 6.7.6.3, paragraph 14.

                                    1. 3

                                      FUNCNAME is another good one.

                                      An array variable containing the names of all shell functions currently in the execution call stack.

                                      When you need it, you’ll be glad it’s there.

                                      1. 10

                                        It can make for some pretty excellent stack traces from complicated (even multi-file) bash-based programs; e.g.,

                                        $ ./track.sh 
                                        I failed!
                                          at make_failure (file "common.sh" line 3)
                                          at d (file "./track.sh" line 43)
                                          at c (file "./track.sh" line 38)
                                          at b (file "./track.sh" line 33)
                                          at a (file "./track.sh" line 28)
                                          at main (file "./track.sh" line 54)
                                        

                                        From the source files:

                                        $ nl -ba < common.sh
                                             1	function make_failure {
                                             2	    echo "I failed!"
                                             3	    false
                                             4	}
                                        
                                        $ nl -ba < track.sh
                                             1	#!/bin/bash
                                             2	
                                             3	. "common.sh"
                                             4	
                                             5	function stack_trace
                                             6	{
                                             7	    set +o xtrace
                                             8	    set +o errexit
                                             9	    set +o errtrace
                                            10	    trap '' ERR
                                            11	
                                            12	    for (( i = 0; i < ${#FUNCNAME[@]}; i++ )); do
                                            13	        if [[ "${FUNCNAME[i]}" == stack_trace ]]; then
                                            14	            continue
                                            15	        fi
                                            16	        if (( i > 0 )); then
                                            17	            line="${BASH_LINENO[$((i - 1))]}"
                                            18	        else
                                            19	            line="${LINENO}"
                                            20	        fi
                                            21	        printf '  at %s (file "%s" line %d)\n' "${FUNCNAME[i]}" \
                                            22	            "${BASH_SOURCE[i]}" "${line}"
                                            23	    done
                                            24	}
                                            25	
                                            26	function a
                                            27	{
                                            28	    b
                                            29	}
                                            30	
                                            31	function b
                                            32	{
                                            33	    c
                                            34	}
                                            35	
                                            36	function c
                                            37	{
                                            38	    d
                                            39	}
                                            40	
                                            41	function d
                                            42	{
                                            43	    make_failure
                                            44	}
                                            45	
                                            46	#
                                            47	# Install our error handling trap, so that we can have stack traces on
                                            48	# failures.  We set "errtrace" so that the ERR trap handler is inherited
                                            49	# by each function call.
                                            50	#
                                            51	trap stack_trace ERR
                                            52	set -o errtrace
                                            53	
                                            54	a
                                        
                                      1. 4

                                        I’m celebrating my sons first birthday on Sunday, and probably trying to squeeze in some video games on Saturday. I probably won’t be touching any pet project. Judge me all you want ;)

                                        1. 4

                                          Weekends don’t have to (and probably shouldn’t) be about programming. :)

                                        1. 4

                                          Pulling a project off the backburner and seeing if I can make some headway on it. I’m hoping to have it ready for an ELS (European Lisp Symposium) submission for whenever the next one is happening.

                                          I’m doing this because my wife is from Europe and would love to visit again. When I said I had something that could give us an excuse to go, she said, “Get to work!”

                                          1. 0

                                            I don’t know what it is.

                                            1. 1

                                              It’s something with a name that causes your favorite search engine to give you many unrelated results when you try to find out what it is.

                                            1. 3

                                              We use OneNote and Word docs scattered about on SharePoint. There’s nothing good about it.

                                              Luckily we also have a GitLab instance, so I tend to try and put new technical documentation on a GitLab wiki associated with a repository. Then I can clone the wiki repository and grep it if it ever gets large enough to warrant fast text search.

                                              1. 3

                                                Same. We have a big fat OneNote. Hard to update, hard to search, hard to index, hard to link to specific things. I don’t love OneNote.

                                                1. 2

                                                  We use OneNote and Word docs scattered about on SharePoint. There’s nothing good about it.

                                                  Having a little experience with this, yes, it’s terrible. Search in SharePoint is next to useless and document uploading is baffling (seriously, creating directory hierarchies is an incredible chore). And good luck with history.

                                                  If this is your setup, I pity you, and seriously consider switching to something else. It’s this kind of setup that made me not hate Confluence.