1. 2

    Perhaps unsurprisingly, perl has both lexical (“my”) and dynamically (“local”) scoped variables.

    Also, no need for an imaginary language, perl also implements the “dynamic control flow” scoping, which is - frankly - my least favourite part of the language:

    $ cat tt.pl
    #!/usr/bin/perl
    use strict;
    
    foreach my $i (1..10) {
      doit($i)
    }
    
    sub doit {
      my ($i) = @_;
      next if $i % 3 == 0;
      print "$i\n";
    }
    $ ./tt.pl
    1
    2
    4
    5
    7
    8
    10
    

    The dynamically scoped variables are a useful tool to have in the toolbox, but the above code is frankly a footgun with no reasonable upside I can see.

    1. 2

      but the above code is frankly a footgun with no reasonable upside I can see.

      I believe the argument is: why should you not be able to abstract parts of one function into another simply because they contain control flow?

      1. 1

        Makes sense. You can easily get this behavior in Haskell if you want it, since side effectful computations like control flow are just values (with a type that is usually a M-word) so you can manipulate them, pass them around and return them from functions.

    1. 9

      My personal preference is to model as much of the requirements as feasible with types and write tests for the rest. In a language like Haskell, with a very powerful type system, this leaves little room for unit tests and somewhat more room for integration tests. You still need your traditional end to end system tests as well, of course, which fall outside the reach of your type system.

      1. 4

        You would like Idris, which takes this to an extreme. You can encode state machines, concurrent protocols, and much more in types, which looks like a whole new type of “metaprogramming”, and the choices it gives you are amazing.

        1. 6

          Idris is a great language, but it’s clearly not production ready. I can’t say I used any dependently typed language seriously, and I’m sure my opinion would change a lot if I did, but currently, I favor the “ghosts of departed proofs” kind of type level modeling, where you don’t prove your implementation internally, but you expose proof witnesses in the interface, so the users of your library can enjoy a very strongly typed interface.

          This aligns very well with how I perceive types should be used; i.e. organize code such that entangled pieces of code relevant to a propertiy that is hard to prove live next to each other, and you can informally (i.e without relying on types) prove to yourself that they satisfy the property. Then expose those pieces with an interface that doesn’t allow (relying on types) the property to be violated by consumers.

          1. 3

            you don’t prove your implementation internally, but you expose proof witnesses in the interface

            Can you point to some examples, please? I don’t really follow.

            1. 3

              Take a look at the justified-containers library. When you check whether a key is in a map, if the key actually is there, it gives you a type-level witness of that fact. Then when you lookup that key with that witness, you receive the value without a Maybe wrapping, because it’s proven already. However, the library uses fromJust internally (i.e doesn’t prove that fact to the compiler), because you can prove outside the type system that it’s impossible to receive a Nothing.

              1. 1

                Thanks

            2. 1

              but it’s clearly not production ready

              This sort of requires a qualifier. It’s probably not “introduce this to a company”-level production ready, but it certainly feels like it’s “start an open-source project”-level production-ready, which seems to be at least relevant in online discussions. It’s such a great language because it brings enormously powerful concepts from other languages like Agda and Coq, into an environment that basically looks like Haskell. I think any advanced Haskell programmer will be pleasantly surprised how these higher-level features that feel clunky and require extensions become trivially easy in Idris (although that’s just an intuition, I’ve never really dabbled in Haskell beyond trivial stuff and started using Idris directly).

              I can’t say I used any dependently typed language seriously, and I’m sure my opinion would change a lot if I did, but currently, I favor the “ghosts of departed proofs” kind of type level modeling

              It’s not just about writing explicit proofs in code. I mean in more advanced code it will pop up but being able to use expressions in types and types in expressions is extremely flexible. Look at this example of a concurrent interface for operations on list:

              ListType : ListAction -> Type
              ListType (Length xs) = Nat
              ListType (Append {elem} xs ys) = List elem
              

              How many languages allow you to express things on this level?:)

              Or look at this merge sort definition:

              mergeSort : Ord a => List a -> List a
              mergeSort input with (splitRec input)
                mergeSort [] | SplitRecNil = []
                mergeSort [x] | SplitRecOne = [x]
                mergeSort (lefts ++ rights) | (SplitRecPair lrec rrec) -- here
                          = merge (mergeSort lefts | lrec)
                                  (mergeSort rights | rrec)
              

              There you’ve used a view of the data-structure that is independent of its representation, specifically you viewed the list as a concatenation of two lists of equal length. A whole other axis to split your implementation over when it makes sense.

        1. 9

          Time for some nitpicking! You actually just need a Semigroup, you have no use for munit, and it’s pointless to append the list with munits, since mplus a munit = a by the monoid laws.

          1. 4

            Your comment reminded me of Data.These: since we don’t pad with mempty values, then there a notion of “the zip of two lists will return partial values at some point”.

            And that led me to Data.Align, which has the exact function we are looking for:

            salign :: (Align f, Semigroup a) => f a -> f a -> f a 
            

            http://hackage.haskell.org/package/these-0.7.4/docs/Data-Align.html#v:salign

            (that weird notion was align :: f a -> f b -> f (These a b))

            1. 1

              Yeah this is exactly it. Good eye!

              1. 1

                It’s funny, because I think I poked the universe in a way that resulted in salign going into Data.Align; A year or so ago, someone mentioned malign in a reddit r/haskell thread, and I pointed out that malign only needed Semigroup and one of the participants in the thread opened an issue requesting a malign alternative with the Semigroup constraint.

                Now I feel like a Semigroup evangelist :)

            1. 7

              This is a complicated issue for me, one that I haven’t really worked out to my satisfaction. I’ll give it a shot here.

              My first reaction is send the developer a real monetary donation! Gold stars are for kindergarten, you can’t pay bills with stars.

              But then I don’t think open source is motivated by contractually stipulated monetary reward. It’s more of an artistic expression, a pride in workmanship. Yes it does offer professional exposure, but I don’t think the best and most prolific contributors are fixated on that. They think to themselves, “I’m making this software well and no short-term business objective is going to get in my way. Everyone will see this and be pleased.”

              Stars are thus saying, “You’ve made something beautiful and true.” It’s shared appreciation, online applause for a performance that has collectively elevated the audience and the performers.

              However, to continue the concert analogy, great performances do typically sell tickets. This is where open source doesn’t hold up. It’s as if they audience asks, “Can we get in for free if we just clap really loud?”

              I believe that existing web patronage models are a failure. Look at the average Patreon page – the scale of donations are like an alternate reality. Maintainers collecting like $100 per month total for stunning expertise that provides huge time savings for users worldwide. The fundamental problem with the Patreon model is that the developer has relinquished their leverage the moment they release code under an open license.

              If I put myself in the shoes of the would-be patrons for a moment, I can totally see their side. Maintainers and bloggers begging for money are ubiquitous, and their requests are vague. After all, they kind of started their projects for nothing and apparently that was good enough for them, so their plea rings hollow.

              I believe that the only effective model for being paid for open source maintenance is to stop work after a certain point and negotiate contracts with specific people or companies to work on specific features. The idea is that the initial work on a project (which brings it to popularity) is the investment that allows you both to create artistry and gain leverage for future consulting.

              This is still a second-class arrangement compared to businesses based on selling products or rentals because it cannot scale beyond paid labor. The consulting rate may be high, but if you stop working on the project that’s the end of your pay from that project. By contrast, authors who sell physical books or training videos make the artifacts once and then enjoy revenue proportional to number of people buying those artifacts.

              Would that I could truly internalize this capitalist mindset. There’s just something seductive about open source software – it feels like it’s the only thing that actually stays relevant in the long term. The commercial stuff gets warped and fades away. Freedom from commercial obligations and deadlines means that open source maintainers retain the independence to do things correctly.

              Developers working together on OSS form an intellectual bond that spans nations, almost like the scientific community. It’s the software created (or the scientific truths discovered) that unite people and elevate them beyond their otherwise monotonous striving for money and physical comforts.

              I’ll end this rant here. Perhaps I’ll never reconcile these two viewpoints, the material and spiritual you might call them.

              1. 2

                I rely on the Godot engine nowadays, but don’t really have money to spare. I’d love to contribute to their Patreon campaign, but there are specific features I’d need, and I don’t think they’re a priority. So it’s hard to direct money into specific problems. Bounty programs would be more specific.

                Everything about this is hard, though. Having money stuck in a bounty escrow is not advancing anything. Contract negotiation and international billing has a lot of overhead, and may turn out to not advance anything. Not paying anything, money or code, doesn’t necessarily advance the project.

                C’est la vie, I suppose.

                1. 2

                  The money really has to come from businesses. It’s so easy to say “Hey, this JetBrains IDE I need costs $200” and that will get approved right away because it has to be paid for and it makes me much faster as a dev but saying “This open source library we use is asking for donations” will not get approved because it doesn’t have to be paid for. The most I can do for OSS we use at work is send bugfixes upstream.

                  1. 1

                    IMHO this is a very useful observation. Maybe we should build a culture that tolerates little paid gimmicks on top of open source projects so that you can justify what’s effectively a donation.

                    1. 1

                      This seems to be the way many OSS projects run now. The core is open source which usually has everything individuals need and then extras are proprietary which are needed for large corporate projects. Its called “Open Core” for people who want to search it. Gitlab even has the source for the paid features public but the license doesn’t let you use it without paying.

                      It does have some issues though. The major one being what happens when someone replicates your paid features. Gitlab says they will accept pull requests that recreate their paid features but they also have the resources to create 20 more by next month. As a solo dev, having someone recreate your paid features could cut out all of your revenue.

                      1. 1

                        I think this gimmicks can very effectively be access oriented. Custom slack channel, custom email address, custom phone number, access to a special meeting. Not so much a feature they get over others, but access to the team they get over others.

                      2. 1

                        It might also not be paid for because the value isn’t as obvious. A bounty-style deal might get approved, because you’re essentially paying for something you require.

                        It’s a question of the direction of the funds and value. This is very obscure when asking for donations in general, don’t you think?

                    2. 2

                      A lot of great stuff in this comment I want to reply to!

                      My first reaction is send the developer a real monetary donation! Gold stars are for kindergarten, you can’t pay bills with stars.

                      I actually think you hit the nail on the head with your first out of the gate recommendation. I think no matter how small your project is you should put up a Patreon or a Bountysource or similar. Not just for yourself for paying bills – but for the people who want to feel involved but can’t do so directly. The patreon model is about supporting what you love. Regardless of the platform you use, you can display you patreon count.

                      The fundamental problem with the Patreon model is that the developer has relinquished their leverage the moment they release code under an open license.

                      I fundamentally disagree with this. It simply isn’t about leverage. It is about eyeballs and goodwill. Look at DTNS – the show is free to listen to for all – heck, it is even free to remix how you want as it is released under creative commons. It brings in $18,000+ monthly because it feels good to support it and the perks it offers feel relevant.

                      I think it is about being savvy in regards to perks, and initial market. Developers were not the initial target for Patreon, there isn’t a lot of crossover there. That said, I think many projects could have very successful Patreon setups if they tried. Some of it is about tiers, if you want to get into the Slack channel it takes a an investment. The investment could be time and code or documentation, or that investment can be $5 a month. If you want to sit in on the monthly feature discussion roundtable – $40 a month or direct contributions at a level that you are invited, etc. If you want to get the project leads home phone number, be a sustaining supporter at $1000 a month for at least 6 month – etc.

                      After all, they kind of started their projects for nothing and apparently that was good enough for them, so their plea rings hollow.

                      Which is why you put up the Patreon feature early, so it doesn’t look like some bolt on or beg later. It is there from before anyone would consider contributing. Neovim had this as a bolt on after the initial funding push, and while I find their pitch possibly too gentle, at least it is there at the bottom.

                      to stop work after a certain point and negotiate contracts

                      This is devastating to good will, and will encourage forks so someone can take your work and be the more well known version of it with those +3 features. I do not think this is a good way forward.

                      (and one last mostly irrelevant reply)

                      But then I don’t think open source is motivated by contractually stipulated monetary reward. It’s more of an artistic expression, a pride in workmanship.

                      I honestly think far more work is done in anger than for artistry. In market terms, more “painkillers” than “vitamins”, doubly so in open source. “The bleep won’t beep bleep bleep what type of bleep bleep wrote this. I will just fix it, bleep it!”

                      1. 2

                        But then I don’t think open source is motivated by contractually stipulated monetary reward.

                        I guarantee that is sometimes the case. I’ve been turned down offering to pay for work on FOSS projects or public sites specifically because the developers and admins wanted to keep money and its psychological effects out of that part of their work. They were doing it for ideology, charity, fun, and so on. They had other work they did for money. They kept them separate.

                        I still advise offering to pay the going rate for work just in case they need it. If they refuse, maybe a cup of coffee or lunch for thanks. If they refuse that, then a heartfelt thanks, star, and whatever since they’re some really devoted people. I won’t say selfless since some do it for not-so-nice reasons and the good ones get personal satisfaction from the good they do. Definitely dedicated or devoted to helping others with their work without asking for something in return, though. I respect and appreciate those people. I also respect the ones doing it for money since they might have been doing something without large benefit or benefiting companies like Oracle hurting us all.

                        EDIT: Someone might wonder what I meant by not taking money for not-so-nice reasons. I’ll give a few examples. One is academics who release code as a proof of concept and/or with potential to benefit people if someone else works on it. They’re paid and promoted for output of papers, not maintainable FOSS. Many would refuse offers to extend older projects. Proprietary software vendors doing OSS side-projects and/or open core companies might refuse paid work on their FOSS because the features compete with their commercial offerings. Regulated industries using some FOSS or OSS components that had to be certified in expensive process would have to recertify them to use modified forms. They often don’t do bug/security fixes for this reason. They might turn down offers on specific libraries. Finally, some people might want the software to work a specific way for arbitrary reasons and/or straight-up hate some potential contributors for personal attributes. There’s a religiously-motivated project whose maintainer fits that description.

                        So, there’s some examples of maintainers that would turn down money for reasons having nothing to do with selflessness.

                        1. 1

                          It is basically same as science. Which is also tragically broken due to funding (and valuation) issues.

                          If only there were a global fund for free projects that would map their dependency tree, perform some health-checking and distribute donations in a predictable fashion…

                          Then a government or a company relying on free software might donate with indications on what to support. Gov. might, for example, donate 1% of purchased software project price to it’s dependencies or require the supplier to do so… That would be about €5.000.000 a year just for Czechia.

                          1. 1

                            My first reaction is send the developer a real monetary donation! Gold stars are for kindergarten, you can’t pay bills with stars.

                            I’m afraid that for most people, the hurdle to sending money over the internet is much higher than telling them they like what is done via a star (or analogous system)…

                          1. 5

                            Computer science clocksteps at the rate of algorithms and discoveries. Languages are always going to come and go, unless the language springs up from a good theory.

                            If you want to understand why this would be true, just look at the history of mathematics. Read about algebraic representations, which kind of abacuses have been used, slide rules, mechanical calculators. You will find out that what we have present today is a small fragment of what used to be, and the stuff that still exists was lugged to today because there’s not many obvious better ways to do the same thing.

                            By this basis, I’d propose that the current “top 20” by Redmonk cannot form any kind of a long-running status quo. It’s a large list of programming languages rooting to the same theory (Javascript, Java, Python, PHP, C#, C++, Ruby, C, Objective-C, Swift, Scala, Go, TypeScript, Perl, Lua).

                            There is going to be only one in 30 years, and I think it’ll be falling to C or Javascript axis. They are syntactically near and lot of software was and gets written with these languages. Although there is even more written with C++, it’s way too contrived to survive without reducing back to something like C.

                            CSS may have some chance of surviving, but it’s pretty much different from the rest. About Haskell I’m not sure. I think typed lambda calculus appear or will reappear in a better format elsewhere. The language will be similar to Haskell though, and may bear the same name.

                            Unix shell and its commands will probably survive, while Powershell and DOS will wither. Windows seems to have its days counted already by now. Sadly it was not because of open source movement. Microsoft again just botched themselves up.

                            R seems like a write-and-forget language. But it roots to Iverson’s notation.. Though perhaps the notation itself will be around, but not the current instances of it.

                            I think that hardware getting more concurrent and diverging from linear execution model will do permanent shakeup on this list in a short term. The plethora of programming languages that describe a rigid evaluation strategy will simply not survive. Though I have bit of bias to think this way so I may not be a reliable source for checking into the future.

                            But I think this be better than looking at programming language rankings.

                            1. 8

                              I think, most importantly, we haven’t even seen anything like the one language to rule them all. I expect that language to be in the direction of Conal Elliott’s work compiling to categories.

                              A language that is built around category theory from the start, like you have many different syntactic constructs and the ones you use in a given expression determines the properties of the category that the expression lives in. Such a language could locally have the properties of all the current languages and could provide optimal interoperation.

                              BTW, I think we won’t be calling the ultimate language a “programming language” because it’ll be as good for describing electrical circuits, mechanical designs and biological systems as for describing programs. So I guess it’ll be called something like a specification language.

                              1. 4

                                “we haven’t even seen anything like the one language to rule them all. “

                                That’s exactly what the LISPers always said they had. Their language could be extended to do anything. New paradigms and styles were regularly backported to it as libraries. It’s also used for hardware development and verification (ACL2).

                                1. 3

                                  Well, it’s hard to say anything about LISPs in general since the span is so vast and academic, and especially for me, since my contact with any LISP is quite limited. But, from my understanding of the common usage of LISP, it doesn’t qualify.

                                  First of all, I think dropping static analysis is cheating, but I don’t intend to tap into an eternal flame war here. What I mean when I say “the properties of the current languages” is no implicit allocations, borrow-checking and inline assembly like in Rust, purity and parametricity like in Haskell, capabilities-security like in Pony etc. etc. , and not only the semantics of these, but also compilers taking advantage of these semantics to provide static assistance and optimizations (like using the stack instead of the heap, laziness & strictness analysis etc.).

                                  And I’m also not just talking about being able to embed these into a given language; you should also be able to write code such that if it’s simple enough, it should be usable in many of them. For instance, it’d be hard to come up with some language semantics in which the identity function cannot be defined, so the identifier id x = x should be usable under any local semantics (after all every category needs to have identity morphisms). You should also be able to write code that interfaces between these local semantics without leaving the language and the static analysis.

                                  I know you can embed these things in LISP, expose enough structure from your LISP code to perform static analysis, get LISP to emit x86 assembly etc. etc. But, IMHO, this doesn’t make LISP the language I’m talking about. It makes it a substrate to build that language on.

                              2. 2

                                I think one major difference between math and computer science, and why we’re not going to see a lot of consolidation for a while (not even in 30 years, I don’t think), is that code that’s on the internet has a way of sticking around, since it’s doing more than just sitting in research papers, or providing a tool for a single person.

                                I doubt we’ll see 100% consolidation any time soon, if for no reason than that it’s too easy to create a new programming language for that to be the case.

                                Hardware changes might shake up this list, but I think it’ll take 30 years for that to be realized, but there will be a lot of programming languages that fall out of that.

                                We’re definitely still going to have COBOL in 30 years, and Java, and C. The rest, I’m unsure of, but I’ll bet that we’ll be able to recognize the lineage of a lot of the top 30 when we look in 30 years.

                                1. 1

                                  R seems like a write-and-forget language. But it roots to Iverson’s notation.

                                  Did you mean to write J or APL? I understand R as the statistics language.

                                1. 6

                                  Government jobs tend to be 40 hours or less. State government in my state has a 37.5 hour standard. There is very occasional off-hours work, but overtime is never required except during emergencies – and not “business emergencies”, but, like, natural disasters.

                                  1. 8

                                    I’m surprised that tech workers turn up their nose at government jobs. Sure, they pay less, but the benefits are amazing! And they really don’t pay too much less in the scheme of things.

                                    How many private sector tech jobs have pensions? I bet not many.

                                    1. 9

                                      I work in a city where 90% of the folks showing up to the local developer meetup are employed by the city or the state.

                                      It’s taken a lot of getting used to being the only person in the room who doesn’t run Windows.

                                      1. 4

                                        I feel like this is pretty much the same for me (aside from the meetup bit).

                                        Have you ever worked with windows or have you been able to stay away from it professionally?

                                        1. 3

                                          I used it on and off for a class for about a year in 2003 at university but have been able to avoid it other than that.

                                        2. 1

                                          Yeah. I hadn’t used Windows since Win 3.1, until I started working for the state (in the Win XP era). I still don’t use it at home, but all my dayjob work is on Windows, and C#.

                                        3. 5

                                          they pay less

                                          Not sure about this one. When you speak about pay, you also have to count all the advantages going with it. In addition, they usually push you out at 5pm so your hourly rate is very close to the contractual one.

                                          1. 3

                                            Most people who are complaining that they pay less are the tech workers who hustle hard in Silicon Valley or at one of the big N companies. While government jobs can pay really well and have excellent value especially when considered pay/hours and benefits like pensions, a Google employee’s ceiling is going to be way higher.

                                            There’s a subreddit where software engineers share their salaries and it seems like big N companies can pay anything from $300k–700k USD when you consider their total package. No government job is going to match that.

                                          2. 3

                                            Do you work in the public sector? What’s it like?

                                            1. 13

                                              I do.

                                              Pros: hours, and benefits. Less trend-driven development and red queen effect. Less age discrimination (probably more diversity in general, at least compared to Silicon Valley).

                                              Cons: low pay, hard to hire and retain qualified people. Bureaucracy can be galling, but I imagine that’s true in large private sector organizations, too.

                                              We’re not that behind the times here; we’ve avoided some dead-ends by being just far enough behind the curve to see stuff fail before we can adopt it.

                                              Also, depending on how well your agency’s goals align with your values, Don’t Be Evil can actually be realistic.

                                              1. 6

                                                I will say, I once did a contract with the Virginia DOT during Peak Teaparty. Never before in my life have I seen a more downtrodden group. Every single person I talked to was there because they really believed in their work, and every single one of them was burdened by the reality that their organization didn’t and was cutting funding, cutting staff, and cutting… everything.

                                                They were some of the best individuals I ever worked with, but within the worst organization I’ve ever interacted with.

                                                Contrast that to New York State- I did a shitton of work for a few departments there. These were just folks who showed up to get things done. They were paid well, respected, and accomplished what they could within the confines of their organization. They also were up for letting work knock off at 2PM.

                                                1. 2

                                                  Also, depending on how well your agency’s goals align with your values, Don’t Be Evil can actually be realistic.

                                                  Agreed. There’s no such thing as an ethical corporation.

                                                  Do you mind sharing the minimum qualifications of a candidate at your institution? How necessary is a degree?

                                                  I’m asking for a friend 😏

                                                  1. 2

                                                    What about B corps?

                                                    1. 1

                                                      No, not even them.

                                                      When you think about what “profit” is (ie taking more than you give), I think it’s really hard to defend any for-profit organization. Somebody has to lose in the exchange. If it’s not the customers, it’s the employees.

                                                      1. 5

                                                        That’s a pretty cynical view of how trade works & not one I generally share. Except under situations of effective duress where one side has lopsided bargaining leverage over the other (e.g. monopolies, workers exploited because they have no better options), customers, employees and shareholders can all benefit. Sometimes this has negative externalities but not always.

                                                        1. 1

                                                          Then I guess we must agree to disagree 🤷🏻‍♂️

                                                        2. 2

                                                          Profit is revenue minus expenses. Your definition, taking more than you give, makes your conclusion a tautology. i.e., meaningless repetition.

                                                          Reciprocity is a natural law: markets function because both parties benefit from the exchange. As a nod to adsouza’s point: fully-informed, warrantied, productive, voluntary exchange makes markets.

                                                          Profit exists because you can organize against risk. Due to comparative advantage, you don’t even have to be better at it than your competitors. Voluntary exchange benefits both weaker and stronger parties.

                                                          1. 1

                                                            Profit is revenue minus expenses. Your definition, taking more than you give, makes your conclusion a tautology. i.e., meaningless repetition.

                                                            I mean, yes, I was repeating myself. I wasn’t concluding anything: I was merely rephrasing “profit.” I’m not sure what you’re trying to get at here aside from fishing for a logical fallacy.

                                                            a tautology. i.e., meaningless repetition.

                                                            Intentionally meta?

                                                            Reciprocity is a natural law

                                                            Yup. No arguments here. However, reciprocity is not profit. In fact, that’s the very distinction I’m trying to make. Reciprocity is based on fairness and balance, that what you get should be equal to what you give. Profit is expecting to get back more than what you put in.

                                                            Profit exists because you can organize against risk.

                                                            Sure, but not all parties can profit simultaneously. There are winners and losers in the world of capitalism.

                                                          2. 1

                                                            So, if I watch you from afar and realize that you’ll be in trouble within seconds, come to your aid, and save your life (without much effort on my side) in exchange for $10, who’s the one losing in this interaction? Personally, I don’t think there’s anything morally wrong with playing positive-sum games and sharing the profits with the other parties.

                                                        3. 1

                                                          For an entry-level developer position, we want either a batchelor’s degree in an appropriate program, with no experience required, an associate’s degree and two years of experience, or no degree and four years of experience. The help-desk and technician positions probably require less for entry level but I’m not personally acquainted with their hiring process.

                                                          1. 2

                                                            I would fall into the last category. Kind of rough being in the industry for 5 years and having to take an entry level job because I don’t have a piece of paper, but that’s how it goes.

                                                            1. 2

                                                              For us, adding an AS (community college) to that 5 years of experience would probably get you into a level 2 position if your existing work is good. Don’t know how well that generalizes.

                                                              1. 2

                                                                Okay cool! I have about an AS in credits from a community college I’d just need to graduate officially. Though, at that point, I might as well get a BS.

                                                                Thanks for helping me in my research :)

                                                      2. 4

                                                        I don’t, but I’m very envious of my family members who do.

                                                        One time my cousin (works for the state’s Department of Forestry) replied to an email on Sunday and they told him to take 4 hours off Monday to balance it off.

                                                        That said, from a technological perspective I’d imagine it would be quite behind in times, and moves very slowly. If you’re a diehard agile manifesto person (I’m not) I probably wouldn’t recommend it.

                                                        EDIT: I guess it’s really what you value more. In the public sector, you get free time at the expense of money. In the private sector, vice versa. I can see someone who chases the latest technologies and loves to code all day long being miserable there, but for people who just code so they can live a fulfilling life outside of work it could be a good fit.

                                                  1. 41

                                                    It’s also developer-friendly because of its excellent wiki.

                                                    I learned Linux doing everything by hand on a Slackware system, then moved to Ubuntu after ~8 years when I realized I’d stopped learning new things. Then a couple years ago I realized I didn’t understand how a bunch of things worked anymore (systemd, pulseaudio, Xorg, more). I looked at various distros and went with Arch because its wiki had helped me almost every time I’d had an issue.

                                                    Speaking of distros, I’m currently learning Nix and NixOS. It’s very nice so far. If I can learn to build packages I’ll probably replace lobsters-ansible with it (the recent issues/PRs/commits tell a tale of my escalating frustration at design limitations). Maybe also my personal laptop: I can experiment first with using nix to try xmonad first because it’s mostly configured by editing + recompiling) and deal with python packaging, which has never worked for me, then move completely to NixOS if that goes well.

                                                    1. 9

                                                      I switched from Mac to NixOS and couldn’t be happier. At work we use Nix for building Haskell projects as well.

                                                      1. 9

                                                        The Arch wiki actually seems to be the only good documentation for using the advanced functionality of newer freedesktop components like pulseaudio, or much older software like Xorg.

                                                        But I’ve noticed it’s documentation for enterprise software like ZFS is usually hot garbage. Not surprising given the community. The recommendations are frequently hokey nonsense: imaginary micro-optimizations or blatantly incorrect feature descriptions.

                                                        What do you find better about nix for making packages than, say, making an rpm or deb? I’ve found those package systems valuable for large scale application deployment. Capistrano has also been nice for smaller scale, with its ability to deploy directly from a repo and roll back deployments with a simple symlink swap. And integration libraries are usually small enough that I’m comfortable just importing the source into my project and customizing them, which relieves so many minor tooling frustrations overall.

                                                        Of course in the end the best deployment system is the one you’ll actually use, so if you’re excited about packaging and deploying with nix, and will thus devote more time and energy to getting it just right, then that’s de facto the best option.

                                                        1. 3

                                                          What do you find better about nix for making packages than, say, making an rpm or deb?

                                                          I don’t, yet. The “If I can learn to build packages” sentence links to an issue I’ve filed. I was unable to learn how to do so from the official documentation. I’ve almost exclusively been working in languages (PHP, Python, Ruby, JavaScript) that rpm/deb have not had good support for, prompting those languages to each implement their own package management systems that interface poorly or not at all with system packaging.

                                                          I’ve used Capistrano, Chef, Puppet, and currently use Ansible for deployment. Capistrano and Ansible at least try to be small and don’t have a pretensions to being something other than an imperative scripting tool, but I’ve seen all of them break servers on deployment, let servers drift out of sync with the config, or fail to be able to produce new deployments that match the existing one. Nix/NixOS/NixOps approach the problem from a different direction; it looks like they started from what the idea of system configuration is instead of scripting the manual steps of maintaining one. Unfortunately nix replicates the misfeature of templating config files and providing its own config file on top of them instead of checking complete config files into a repo. Hopefully this won’t be too bad in practice, though it’s not a good sign that they implemented a programming language.

                                                          I appreciate your closing sentiment, but I’m not really trying to reach new heights of system configuration. I’m trying to avoid losing time to misconfiguration caused by services that fundamentally misunderstand the problem, leading to booby traps in common usage. I see almost all of my experience with packaging + deployment tools as a loss to be minimized in the hopes that they waste less time than hand-managing the global variables of public mutable state that is a running server.

                                                          1. 1

                                                            Hmmm. I don’t think the problems you listed are 100% avoidable with any tool, just easier in some rather than others.

                                                            I like Puppet and Capistrano well enough. But I also think packaging a Rails application as a pre-built system package is definitely the way to go, with all gems installed and assets compiled at build time. That at least makes the app deployment reproducible, though it does nothing for things like database migrations.

                                                          2. 1

                                                            What do you find better about nix for making packages than, say, making an rpm or deb?

                                                            Let me show you a minimal nix package:

                                                            pkgs.writeScriptBin "greeter" "echo Hello $1!"
                                                            

                                                            Et voila! You have a fine nix package of a utility called greeter that you can let other nix packages depend on, install to your environment as a user or make available in nix-shell. Here’s a function that returns a package:

                                                            greeting: pkgs.writeScriptBin "greeter" "echo ${greeting} $1!"
                                                            

                                                            What you have here is a lambda expression, that accepts something that you can splice into a string and returns a package! Nix packages in nixpkgs are typically functions, and they offer an a great amount of customizability without much effort (for both the author and the user).

                                                            At work, we build, package and deploy with nix (on the cloud and on premises), and we probably have ~1000 nix packages of our own. Nobody is counting though, since writing packages doesn’t feel like a thing you do with nix. Do you count the number of curly braces in your code, for instance? If you’re used to purely functional programming, nix is very natural and expressive. So much so that you could actually write your application in the language if it’s IO system were designed for it.

                                                            It also helps a lot that nix can seamlessly be installed on any Linux distro (and macOS) without getting in the way of its host.

                                                            1. 1

                                                              If only ZFS from Oracle hadn’t had the licensing compatibility issues it currently has, it would probably have landed in the kernel by now. Subsequently, the usage would have been higher and so would the quality of the community documentation.

                                                            2. 4

                                                              If I can learn to build packages I’ll probably replace lobsters-ansible with it

                                                              Exactly. I don’t have much experience with Nix (none, actually). But in theory it seems like it can be a really nice OS-level replacement for tools like Ansible, SaltStack, etc.

                                                              1. 1

                                                                This is exactly what NixOps does! See here.

                                                                1. 2

                                                                  Thanks for the video. I’ll watch it over the weekend!

                                                                  Curious - are you also running NixOS on your personal machine(s)? I’ve been running Arch for a long time now but considering switching to Nix just because it makes so much more sense. But the Arch documentation and the amount of packages available (if you count the AUR in) is something that’s difficult to leave.

                                                                  1. 1

                                                                    Yes, I’m using it on my personal machine :). I wouldn’t recommend switching to NixOS all at once, what worked for me was to install the Nix package manager, use it for package management and creating development environments, and then only switch once I was fully convinced that NixOS could do everything I wanted from my Ubuntu install. This took me about a year, even with me using it for everything at work. Another approach would be to get a separate laptop and put NixOS on that to see how you like it.

                                                                    1. 1

                                                                      Interesting. I’ll try it out for some time on a VM to get a hang of it. Thanks for the info!

                                                              2. 3

                                                                Even as a Ubuntu user, I’ve frequently found the detailed documentation on the Arch wiki really helpful.

                                                                1. 2

                                                                  I really want to use Nix but I tried installing it last month and it doesn’t seem to have great support for Wayland yet which is a deal breaker for me as I use multiple HiDPI screens and Wayland makes that experience much better. Anyone managed to get Nix working with Wayland?

                                                                  1. 2

                                                                    Arch’s wiki explaining how to do everything piecemeal really seems strange given its philosophy is assuming their users should be able to meaningfully help fix whatever problems cause their system to self-destruct on upgrade. It’s obviously appreciated, but still…confusing, given how many Arch users I’ve met who know nothing about their system except what the wiki’s told them.

                                                                    1. 1

                                                                      I gave up on my nix experiment, too much of it is un- or under-documented. And I’m sorry I derailed this Arch discussion.

                                                                      1. 1

                                                                        I’m happy to help if I can! I’m on the DevOps team at work, where use it extensively, and I did a presentation demonstrating usage at linux.conf.au this year. All my Linux laptops run NixOS and I’m very happy with it as an operating system. My configuration lives here.

                                                                        1. 2

                                                                          Ah, howdy again. I’m working my way through the “pills” documentation to figure out what’s missing from the nix manual. If you have a small, complete example of how to build a single package that’d probably be pretty useful to link from the github issue.

                                                                          1. 2

                                                                            I made a small change to the example to get it to build, and I’ve added it as a comment to your issue.

                                                                      1. 6

                                                                        I think that the view that type systems exist to just enforce rules and check that your programs are correct is very incomplete: type systems are extremely powerful reasoning mechanisms that themselves allow you to express properties of your programs and are a space where you construct them, not just restrict them at the value level. I think Idris is the best example of this, although Haskell might be more accessible and serve as a bridge if you want to go in that direction. I suggest getting the Idris book, currently going through it and it’s extremely well-written!

                                                                        The central idea in Idris are dependent types: essentially they remove the distinction between a type variable and a regular variable, allowing you to say that for example a Matrix 3 4 is a wholly different type than Matrix 4 3, and when you have access to such specific types, a large part of your programming is lifted to the type level.

                                                                        The author still seems to think, for example, that good type systems don’t force you to write annotations unless you really must. In Idris, type annotations are enforced, because they aren’t merely annotations to help the compiler infer other types, but are just the place where you write a large part of your program (albeit dependent types make type inference harder so there’s a technical component to that).

                                                                        1. 1

                                                                          Well, nothing stops you from writing stringly typed code full of mutations using IORefs in Idris. The point with strong type systems is not that you have to write safe code, it’s that you can do so.

                                                                        1. 1

                                                                          “all you need to annotate are function parameters and return values” - true in C++ now too, it’s not just Rust.

                                                                          “gtest sucks” - it does, but there are far better alternatives. I agree that pytest rocks. I’m curious as to whether dependency injection and mocking are better in Rust than in C++, especially given the lack of compile-time reflection.

                                                                          1. 3

                                                                            In my experience C++ generally requires more annotation of types within a function body, so it is still fair to call out annotating only function parameters and return values as a strength of Rust in particular.

                                                                            For example in Rust:

                                                                            // Within the same function body we push a `&str` into the vector
                                                                            // so compiler understands this must be a `Vec<&str>`.
                                                                            let mut vec = Vec::new();
                                                                            vec.push("str");
                                                                            

                                                                            versus C++:

                                                                            // Vector element type cannot be inferred.
                                                                            std::vector<const char *> vec;
                                                                            vec.push_back("str");
                                                                            
                                                                            1. 1

                                                                              C++17 has constructor template argument deduction, so you can just say auto vec = vector({"str"}) now. Though Rust’s type inference is obviously more powerful.

                                                                          1. 3

                                                                            Working remotely and having flexible working hours seems like two completely different topics to me. I wouldn’t mix them up.

                                                                            1. 2

                                                                              Well, not completely different, if remote means anywhere in the world, setting company-wide fixed working hours would be impractical. So the issues aren’t entirely orthogonal.

                                                                              1. 1

                                                                                I’d say it completely depends on the job and the team. I work remotely with people all around north america and europe (mostly), and I appreciate knowing when someone will be online to answer a question or handle a request. I see no reason why a remotee shouldn’t be asked to work 9-5 if it’s needed for communication/productivity/other reasons. That is, to me, a different topic from physical location.

                                                                              2. 1

                                                                                You certainly can have flexible hours without working remotely, but how many office bound staff have accsss to that office outside of say 6am till 8pm?

                                                                              1. 4

                                                                                Honestly, the driving script in bash feels like it’s cheating. It actually feels like despite all the new toys, metaprogramming in C++ still isn’t that powerful.

                                                                                Couldn’t this be done more easily with lisp macros? I can sort of see how to do it with D compile-time structures.

                                                                                1. 3

                                                                                  I don’t think there’s much point comparing such exercises across languages. For instance, with Template Haskell, you can run arbitrary Haskell code and even do IO at compile time, you could even write a 3D shooter, but I’d still say C++ templates are more powerful than TH in many aspects, due to the way they interact with the rest of their respective languages.

                                                                                  1. 1

                                                                                    Maybe I shouldn’t have said “powerful”, but “convenient”? I think it does make sense to have these comparisons at least for this example. In both Lisp and D, you have all of the language at compile time, so you can do just about anything.

                                                                                    It appears that even when attempting a ridiculous feat, thus accepting some inconvenience, C++ compile-time features are still too onerous to put the whole game loop into them.

                                                                                    Edit: After thinking about this for a second, I’m not sure it’s possible in D anymore since compile-time D functions have to be deterministic.

                                                                                    1. 2

                                                                                      I understand your point about the convenience, but my point is that the real purpose of the metaprogramming features isn’t to write interactive games. What matters is how it interacts with the run-time features. For instance, C++ templates are more powerful than Template Haskell, because of template argument deduction and due to how template instantiation can cause other templates to be instantiated seamlessly. Whereas in TH, you cause all template expansions by hand. Without considering the interaction with the rest of the language, the best metaprogramming would simply be generating C++ code using C++, then running that program as a preprocessing step. That’s why I think comparing the power of metaprogramming features accross languages through non-metaprogramming things you can do with them is pointless.

                                                                                      1. 1

                                                                                        Ah, it does sound inconvenient in TH to not have automatic instantiations.

                                                                                        1. 1

                                                                                          Yeah, it is, TH is much more bolted-on in Haskell compared to templates in C++, but on the other hand, Haskell’s type system is vastly more powerful without metaprogramming, so you rarely really need it. As I said, hard to compare across languages :)

                                                                                  2. 2

                                                                                    In Lisp you have the full language in disposal at compile-time, so it’s way too easy.

                                                                                    1. 1

                                                                                      That was my first thought, that the actual game loop is still implemented at runtime (with a bash runtime), which is sort of cheating. On the other hand, since one of my research areas is modeling game mechanics in formal logic, it somehow feels natural to accept an implementation of a state->state' transition function as morally equivalent to an implemention of a game. :-)

                                                                                    1. 6

                                                                                      I can’t agree with this article.

                                                                                      When writing new code, I can accept that making tasks smaller and discrete doesn’t require as much mental scaffolding, therefore it might be possible in some contexts to handle being interrupted without it being disastrous, but most of the time we’re working on existing code. We are compiling code in our brains and making all kinds of mental leaps stashing temporary memories as we debug and process what’s going on.

                                                                                      I’m not saying programmers are special snowflakes; I’m sure there are other fields of brain work that are as taxing, but yes, interruptions are catastrophic for programmers.

                                                                                      1. 2

                                                                                        I definitely agree, interrupting a debugging session is effectively resetting all progress. Not to mention the fact that the more you have to restart a specific debugging session, the harder it gets, because a sort of learned helplessness sets in.

                                                                                      1. 12

                                                                                        I thought it would actually be about std::optional, not workspace issues that have nothing to do with the problem at hand.

                                                                                        TL;DR: keep your toolchain up to date if you want to use recent language features.

                                                                                        1. 3

                                                                                          yeah. I suspect better article naming would be better at not leaving people feel like they kept on expecting the article to go somewhere it didn’t.

                                                                                          1. 9

                                                                                            I think it’s funny because the reader’s experience parallels the author’s experience of wanting to get someplace.

                                                                                            1. 4

                                                                                              Somebody gets me! :)

                                                                                            2. 2

                                                                                              Sorry folks :(. But std::optional works as one expects - you can write functions to accept std::optional and you just check early on if it evaluates to true and just return empty as needed, so you can chain functions neatly.

                                                                                              Now, if only we could have pattern matching …

                                                                                              1. 3

                                                                                                I think the consensus of languages with options and pattern matching is “don’t use pattern matching, use combinators”.

                                                                                                1. 4

                                                                                                  Hmm as a full-time Haskeller “don’t use pattern matching” is news to me. Do you mean “don’t use pattern matching for fundamental vocabulary types like Maybe or Either? In which case it’s a reasonable guideline. For types representing your business domain, pattern matching is perfectly good practice. IMHO exhaustiveness checking of pattern matching is an indispensable feature for modelling your domain with types.

                                                                                                  1. 1

                                                                                                    Do you mean “don’t use pattern matching for fundamental vocabulary types like Maybe or Either?

                                                                                                    Yes.

                                                                                                  2. 3

                                                                                                    Consensus, really? I’m a big fan of combinators, but I’ll still match on option types sometimes if I think it looks clearer.

                                                                                                    1. 2

                                                                                                      Ooh, this is interesting to me - can you expand on this (or point me to some writeups)? Thanks!

                                                                                                  3. 2

                                                                                                    Agreed. I read all the way down and nothing significant about std::optional.

                                                                                                    I thought it was going to be some sort of piece about how using std::optional could lead to yak shaving or something :(

                                                                                                1. 1

                                                                                                  TL;DR If a worker in an arbitrarily large group is faulty in a way that it immediately discards assigned tasks and asks for more, it can spoil a disproportionately large number of tasks in a load-balanced setting.

                                                                                                  1. 17

                                                                                                    Pointfree style in ML-family languages (e.g. Haskell) lets you avoid naming things, though the style was designed more for general conciseness than that specifically.

                                                                                                    1. 9

                                                                                                      Similarly, pipelines in shell scripts let you avoid naming intermediates.

                                                                                                      (Pipelines are a combination of pointfree style and array language style, in that well-designed pipelines are side-effect-free and the programs in the pipeline mostly implicitly iterate over their input.)

                                                                                                      1. 2

                                                                                                        There’s also a tool called Pointfree which auto converts code into “pointfree style” - e.g.

                                                                                                        \a b c -> b * c
                                                                                                        
                                                                                                        const (*)
                                                                                                        

                                                                                                        And there’s also Pointful, for the other way around.

                                                                                                        1. 1

                                                                                                          I think Haskell strikes a very fine balance here. Both point-free and pointful styles are very ergonomic, so you tend to name precisely those things that would be better off named.

                                                                                                        1. 5

                                                                                                          This a fascinating case. It’s very unfortunate that the cyclist had to die for it to come before us. However, had the car been driven by a human, nobody would be talking about it!

                                                                                                          That said, the law does not currently hold autonomous vehicles to a higher standard than human drivers, even though it probably could do so given the much greater perceptiveness of LIDAR. But is there any precedent for doing something like this (having a higher bar for autonomous technology than humans)?

                                                                                                          1. 13

                                                                                                            Autonomous technology is not an entity in law, and if we are lucky, it never will be. Legal entities designed or licensed the technology, and those are the ones the law finds responsible. This is similar to the argument that some tech companies have made that “it’s not us, it’s the algorithm.” The law does not care. It will find a responsible legal entity.

                                                                                                            This is a particularly tough thing for many of us in tech to understand.

                                                                                                            1. 25

                                                                                                              It’s hard for me to understand why people in tech find it so hard to understand. Someone wrote the algorithm. Even in ML systems where we have no real way of explaining its decision process, someone designed it the system, someone implemented it, and someone made the decision to deploy it in a given circumstance.

                                                                                                              1. 11

                                                                                                                Not only that, but one other huge aspect of things nobody is probably thinking about. This incident is going to probably start the ball rolling on certification and liability for software.

                                                                                                                Move fast and break things is probably not going to fly in the faces of too many deaths to autonomous cars. Even if they’re safer than humans, there is going to be repercussions.

                                                                                                                1. 8

                                                                                                                  Even if they’re safer than humans, there is going to be repercussions.

                                                                                                                  Even if they are safer than humans, a human must be held accountable of the deaths they will cause.

                                                                                                                  1. 2

                                                                                                                    Indeed, and I believe those humans will be the programmers.

                                                                                                                    1. 4

                                                                                                                      Well… it depends.

                                                                                                                      When a bridge breaks down and kills people due to bad construction practices, do you put in jail the bricklayers?

                                                                                                                      And what about a free software that you get from me “without warranty”?

                                                                                                                      1. 4

                                                                                                                        No - but they do take the company that build the bridge to court.

                                                                                                                        1. 5

                                                                                                                          Indeed. The same would work for software.

                                                                                                                          At the end of the day, who is accountable for the company’s products is accountable for the deaths that such products cause.

                                                                                                                        2. 2

                                                                                                                          Somewhat relevant article that raised an interesting point RE:VW cheating emissions tests. I think we should ask ourselves if there is a meaningful difference between these two cases that would require us to shift responsibility.

                                                                                                                          1. 2

                                                                                                                            Very interesting read.

                                                                                                                            I agree that the AI experts’ troupe share a moral responsibility about this death, just like the developers at Volkswagen of America shared a moral responsibility about the fraud.

                                                                                                                            But, at the end of the day, software developers and statisticians were working for a company that is accountable for the whole artifact they sell. So the legal accountability must be assigned at the company’s board of directors/CEO/stock holders… whoever is accountable for the activities of the company.

                                                                                                                          2. 2

                                                                                                                            What I’m saying is this is a case where those “without warranty” provisions may be deemed invalid due to situations like this.

                                                                                                                          3. 1

                                                                                                                            I don’t think it’ll ever be the programmers. It would be negligence either on the part of QA or management. Programmers just satisfy specs and pass QA standards.

                                                                                                                      2. 2

                                                                                                                        It’s hard to take reponsability for something evolving in a such dynamic environment, with potentially used for billions of hours everyday, for the next X years. I mean, knowing that, you would expect to have a 99,99% of cases tested, but here it’s impossible.

                                                                                                                        1. 1

                                                                                                                          It’s expensive, not impossible.

                                                                                                                          It’s a business cost and an entrepreneurial risk.

                                                                                                                          If you can take the risks an pay the costs, that business it not for you.

                                                                                                                    2. 4

                                                                                                                      It’s only a higher bar if you look at it from the perspective of “some entity replacing a human.” If you look at it from the perspective of a tool created by a company, the focus should be ok whether there was negligence in the implementation of the system.

                                                                                                                      It might be acceptable and understandable for the average human to not be able to react that fast. It would not be acceptable and understandable for the engineers on a self-driving car project to write a system that can’t detect an unobstructed object straight ahead, for the management to sign off on testing, etc.

                                                                                                                    1. 12

                                                                                                                      He didn’t really answer the question though :(

                                                                                                                      I think they’re CONSIDERED in opposition as a historical thing. While objects entered heavy use in the 80’s, the paradigm of “everything is an object” started with Java in the mid 90’s. Java rapidly became the most popular language, and functional languages started representing themselves as “not OOP”. Note that before the Java Era we had CLOS and Ocaml, both of which are functional languages with objects.

                                                                                                                      1. 5

                                                                                                                        You are right, he didn’t answer it! He answered “Is FP in opposition to OO”. I think your answer is pretty accurate. People confused C++ and Java as OOP (instead of recognizing them for what they were, Class Based Programming). And because these languages mutated state, FP is in opposition to them, and therefore OOP.

                                                                                                                        I think more importantly, the pop culture has no idea what OOP is and therefore people are confused when they think FP is in opposition to OOP.

                                                                                                                        1. 5

                                                                                                                          I think more importantly, the pop culture has no idea what OOP is and therefore people are confused when they think FP is in opposition to OOP.

                                                                                                                          I don’t think it’s fair to say that the “pop culture” doesn’t know what “OOP is”, because there really isn’t a definition of OOP. A lot of people equate it with Smalltalk, but you could also say OOP is Eiffel, or Ada, or Simula…

                                                                                                                          1. 3

                                                                                                                            People confused C++ and Java as OOP (instead of recognizing them for what they were, Class Based Programming).

                                                                                                                            I don’t really think that classes are problem*. They were not just Class Based Programming, but imperative Class Based Programming inspired by C. If you look at Smalltalk (which is also Class Based), missing component is late binding, which allows you to do all kinds of neat stuff and cleaner style of programming (imho).

                                                                                                                            *Although I really like Self, which is basically prototype based Smalltalk-like system.

                                                                                                                            1. 3

                                                                                                                              Unfortunately to most people class based programming and OOP are the same.

                                                                                                                              1. 5

                                                                                                                                I don’t know if “most” people do, but there is certainly a decent collection of people out there who think this. Consider this document (“Object-Oriented Programming in C”, revised December 2017), which starts out with this:

                                                                                                                                Object-oriented programming (OOP) is not the use of a particular language or a tool. It is rather a way of design based on the three fundamental design meta-patterns:

                                                                                                                                • Encapsulation – the ability to package data and functions together into classes
                                                                                                                                • Inheritance – the ability to define new classes based on existing classes in order to obtain reuse and code organization
                                                                                                                                • Polymorphism – the ability to substitute objects of matching interfaces for one another at run-time
                                                                                                                                1. 1

                                                                                                                                  most people I have met while programming professionally in New Zealand.

                                                                                                                                  1. 1

                                                                                                                                    Inheritance – the ability to define new classes based on existing classes in order to obtain reuse and code organization

                                                                                                                                    I think this is universally accepted as an anti-pattern, both by OO programmers and FP.

                                                                                                                                  2. 2

                                                                                                                                    I think how most C++, Java, and .NET programmers code supports your position. At least, how most code I’ve seen works looking at code from… everywhere. Whatever my sample bias is, it’s not dependent on any one location. The bad thinking clearly spread along with the language and tools themselves.

                                                                                                                              1. 22

                                                                                                                                Comments really aren’t a “code smell.”

                                                                                                                                1. 16

                                                                                                                                  Nothing stinks quite like uncommented complicated code.

                                                                                                                                  1. 7

                                                                                                                                    Exactly! Margaret Hamilton’s code itself, whom the author cites, is full of comments. Possibly more comments than source code. Which, if you’re sending a ship with the processing power of a toothbrush to the Moon, is a great idea.

                                                                                                                                    1. 10

                                                                                                                                      This code is not readable on it’s own, if it was possible to use variable and function names most of those comments could be removed. It’s also quite likely that every detail of the program was decided before writing the code. In a modern codebase things are always evolving and comments can get left behind.

                                                                                                                                      1. 5

                                                                                                                                        This is my fear with comments. I code in a team of 2, so we don’t really comment stuff. I know it’s bad, but I’m a team of two, we kind of know the whole code anyway.

                                                                                                                                        We also don’t write tests. We’re bad people.

                                                                                                                                        1. 4

                                                                                                                                          Oh man, save yourself some pain and write unit tests. You don’t need 100% test coverage, even non-zero coverage of basic functionality will save you so much time. If you don’t know how to use test frameworks then you don’t have to bother, just write one big main file with a function per test you want to do, and call them all in main. That’s basically what test frameworks are, so if you need a low barrier to entry then don’t bother learning one yet, just do something. If you program in a language with a REPL you can literally just save the stuff you use to manually test into a file so you don’t have to type it more than once.

                                                                                                                                          I personally couldn’t develop without unit tests. You can test the application and do something that hits the code path you just changed, which is time consuming and tedious, especially to do repeatedly, or you can write a little bit of code that calls the code and run it with zero effort every time all the time for the rest of forever. Even a small sanity test of the happy path is better than nothing, you can at least check your code doesn’t blatantly fuck up with normal input and save yourself the round trip through the application.

                                                                                                                                          If I had to code without unit tests I’d quit. And I have worked on teams that didn’t want to unit test, so I had out-of-tree tests I wrote for myself. The amount of bugs I fixed a couple hours after someone else committed was mind boggling.

                                                                                                                                          1. 4

                                                                                                                                            How do you even develop without unit tests?

                                                                                                                                            I’d avoid this kind of shaming, especially since the commenter has already noted (in a self-deprecating manner) that they’re aware of the stigma associated with not using tests.

                                                                                                                                            If the intent is to encourage the use of tests, I would put your last paragraph first and focus on how it would help GP.

                                                                                                                                            1. 3

                                                                                                                                              Revised, thank you for the feedback. 😊

                                                                                                                                            2. 2

                                                                                                                                              Depends on the language and coding style though. I wrote a 25000 line game in C++ without a single test, and I never had a regression. I obviously had occasional bugs in new code, but they’re unavoidable either way. Now my preferred language is Haskell, and I feel the need for tests even less. I generally prefer correct-by-construction to correct-by-our-tests-pass. My purpose isn’t to discredit tests though, just that not every codebase has as much need for them.

                                                                                                                                              1. 2

                                                                                                                                                I’m just self taught and kind of out of my depth on it. I had a dev friend who did integration tests, and they were really brittle and slowed us down a lot. Are unit tests not as bad at slowing down a small team of two devs who are both self taught? We’re good / mediocre / we build good stuff (I consider ourselves hackers) but we don’t have a ton of time.

                                                                                                                                                1. 1

                                                                                                                                                  Unit tests don’t have to slow things down like integration tests. In your situation, I’d wait until the next bug comes up, then instead of fixing the bug immediately, I’d write a test that reproduces the bug. Usually doing that helps narrow down where the bug is, and after fixing it, the test passes and (here’s the cool part) you will never see that bug again

                                                                                                                                                  1. 1

                                                                                                                                                    That’s what i was told about integration tests, but I had to set up all these extra dependencies so that the integration tests continued to work every time we added an external service… we’d have to mock it or shit would break.

                                                                                                                                                    I’m assuming since Unit tests don’t run like that, they don’t have external dependencies like that? You’d mock on a component by component basis, and wouldn’t have to mock unrelated shit just to keep them running… hmm… maybe i will.

                                                                                                                                                    Any unit testing video series I could watch as a noob to get started you’d recommend? Or anything like that?

                                                                                                                                                2. 1

                                                                                                                                                  I second saving yourself pain with writing tests! I’ve avoided lots of rakes with a handful of tests

                                                                                                                                              2. 2

                                                                                                                                                What makes everybody think that the programmers who change code so that it no longer matches the comments they just used to understand it will somehow write code so clear you don’t need comments to understand it?

                                                                                                                                                1. 1

                                                                                                                                                  Often people write code like total = price * 1.10 #This is tax which can be rewritten as total = price * TAX A lot of comments like that can be removed by just putting them in the actual code.

                                                                                                                                                  1. 2

                                                                                                                                                    I’m not suggesting it can’t be done I’m suggesting it won’t be done

                                                                                                                                              3. 4

                                                                                                                                                I’ll also correct the article to say a team did the code and review per the reports I read. She describes it here in “Apollo Beginnings” as a team with a lot of freedom and management backing with unusual requirement to get software right the first time. Unfortunately, a rare environment to work in.

                                                                                                                                              4. 5

                                                                                                                                                You can’t write test coverage for a comment. You can’t have your compiler warn you that a comment is inaccurate.

                                                                                                                                                If you have no tests, and your code is full of dead paths, you can’t even percieve the risk posed by an errant, out of date, or unintentionally misleading comment.

                                                                                                                                                Sometimes they’re necessary. But the best default advice to a ‘mediocre’ developer is to write better code, not add more comments.

                                                                                                                                                1. 5

                                                                                                                                                  You can’t write test coverage for a comment. You can’t have your compiler warn you that a comment is inaccurate.

                                                                                                                                                  https://docs.python.org/3/library/doctest.html

                                                                                                                                                  If you have no tests, and your code is full of dead paths, you can’t even percieve the risk posed by an errant, out of date, or unintentionally misleading comment.

                                                                                                                                                  If you have no tests or comments you have no way of knowing whether your code is actually matching your spec, anyway.

                                                                                                                                                  Sometimes they’re necessary. But the best default advice to a ‘mediocre’ developer is to write better code, not add more comments.

                                                                                                                                                  That’s like saying that the best default advice to a ‘mediocre’ developer is to write less buggy code, not add unit tests.

                                                                                                                                                  1. 2

                                                                                                                                                    doctest is great for testing comments that include code, but nothing else… If a comment says “Framework X is expecting variable foo in JSON format inside the array bar.” I would be inclined to believe it at first and then test the hypothesis that the comment is wrong. That’s the danger of comments.

                                                                                                                                                    1. 1

                                                                                                                                                      A couple of times today I caught myself committing deleted or changed lines without deleting or changing the associated comment. Luckily I could go back and fix things so that the comments weren’t complete nonsense. Sometimes though they escape detection.

                                                                                                                                                  2. 2

                                                                                                                                                    Once the code is cleaned as much as possible and still is hard to understand, or if something is tricky, comments help a lot!

                                                                                                                                                    I guess the author talked about comments that could be removed by making the code cleaner.

                                                                                                                                                    Maybe it depends on what motivates one to add comments, there might be good reasons as well.

                                                                                                                                                    1. 2

                                                                                                                                                      True.

                                                                                                                                                      But Comments that are wrong or out of date stink like dead rats.

                                                                                                                                                      I view asserts as “executable comments” that are never out of date. Sometimes they are wrong… but testing will tell you that.

                                                                                                                                                      If a plain comment is wrong… nothing will tell you except a very long, very Bad Day at work.

                                                                                                                                                      1. 7

                                                                                                                                                        But Comments that are wrong or out of date stink like dead rats.

                                                                                                                                                        Valuable comments are something along the lines of “this looks weird, but I did it because of [historical reason that is likely to be forgotten] even though [other implementation] looks like the more obvious solution at first glance; it wouldn’t have worked because [rationale].”

                                                                                                                                                        The longer I spend working with old codebases, the more I’ve come to treasure such comments. But comments that just explain what the code is doing rather than why are suspect.

                                                                                                                                                    1. 1

                                                                                                                                                      Hi, we are a small startup with ~10 engineers. We’re using AWS, both for customer services (we deploy a few instances per customer, so they are completely isolated) and for the services that support our own workflows (CI etc.). For customer instances, we currently use simple scripts utilizing the AWS CLI tools. For our supporting infrastructure we use NixOps. NixOps is a blast when it works, though it requires some nix-fu to keep it working.

                                                                                                                                                      1. 5

                                                                                                                                                        The right to be able to transfer your data from system to system is part of the new General Data Protection Regulation of the European Union.Apart from the above article on the GDPR (quoted below), see also the specific Wikipedia article on data portability in the GDPR. Not sure whether this also guarantees right to import your data in the other provider, though!

                                                                                                                                                        A person is to be able to transfer personal data from one electronic processing system to and into another, without being prevented from doing so by the data controller. Data that has been sufficiently anonymised is excluded, but data that has been only de-identified but remains possible to link to the individual in question, such as by providing the relevant identifier, is not.[25] Both data being ‘provided’ by the data subject and data being ‘observed’, such as about behaviour, are included. In addition, the data must be provided by the controller in a structured and commonly used a standard electronic format. The right to data portability is provided by Article 20 of the GDPR.[6] Legal experts see in the final version of this measure a “new right” created that “reaches beyond the scope of data portability between two controllers as stipulated in [Article 20]”.[26]

                                                                                                                                                        1. 1

                                                                                                                                                          Hmm, I wonder what happens if your data is inseparably mixed with other people’s private data.

                                                                                                                                                          1. 1

                                                                                                                                                            Fortunately, there are already market incentives to allow importing data :)

                                                                                                                                                            Will the GDPR force FB to allow users to take their social graphs with them?