1.  

    When I worked on projects using the old phase gate and waterfall approach, it was common to skip creating unit tests. In fact I don’t recall ever being on a project where we did more than a token stab at it. Of course the plan said we would, but the plan said a lot of things and by the time we were a couple months into the work, reality and “on paper” were very different things. This divergence was allowed to stay hidden till almost the end of the projects. Then it would all fall apart. Non-compliance to the plan was not an isolated thing, but was the norm for those projects - even ones that were safety-critical.

    Well that’s horrifying.

    1. 15

      I’m hosting my first TLA+ workshop this week. Beyond excited and beyond nervous.

      1. 2

        Good luck!

        1. 2

          Kick ass!

          1. 1

            Wish I was in Chicago! Do you ever come out to Seattle?

            1. 2

              I’d be totally down to host a workshop in Seattle!

          1. 3

            I write about software history, formal methods, and Weird Niche Topics that catch my interest.

            https://www.hillelwayne.com

            1. 3

              Sprinting to finish the TLA+ workshop I’m hosting on Tuesday!

              1. 1

                @hwayne Calling the pony developers smug for that is a bit misleading with the missing context… Pony has checked exceptions, calls that can fail need to be annotated with ‘?’ . If division could fail a whole bunch of functions would need annotations defeating the value of ‘?’ as a documentation tool.

                This means 1/0 == 0 is practical in pony to avoid typing ‘?’ everywhere.

                1. 3

                  It’s not 100% clear but I’m referring to the original tweet being smug: the person who made the “we men of industry” tweet. I cut off their username to anonymize them.

                  1. 2

                    Oh ok, btw, your twitter account is a lot of fun. thanks for the laughs - everyone reading this follow him :)

                1. 0

                  This is ill-advised.

                  You cannot define 1/0 and still have a field. There’s no value that works. Even when you do things like the extended real numbers where x/0 = infinity, you’re really just doing a kind of shorthand and you acknowledge that the result isn’t a field.

                  You can of course define any other algebraic structure you want and then say that operating on the expression 1/0 is all invalid because you didn’t define anything else and no other theorem applies, but this is not very helpful. You can make bad definitions that don’t generalise, sure, definitions that aren’t fields. But to paraphrase a famous mathematician, the difficulty lies not in the proofs but in knowing what to prove. The statement “1/0 = 0 and nothing else can be deduced from this” isn’t very interesting.

                  1. 1

                    Could you explain why, formally, defining 1/0=0 means you no longer have a field?

                    1. 7

                      I want to make an attempt to clarify the discussion here because I think there is some substance I found interesting. I don’t have a strong opinion about this.

                      The article actually defines an algebraic structure with three operators: (S, +, *, /) with some axioms. It happens that these axioms makes it so (S, +, *) is a field (just like how the definition of a field makes (S, +) a group).

                      The article is right in saying that these axioms do not lead to a contradiction. And there are many non-trivial such structures.

                      However, the (potential) issue is that we don’t know nearly as much about these structures than we do about fields because any theorem about fields only apply to (S, +, *) instead of (S, +, *, /). So all the work would need to be redone. It could be said that the purpose of choosing a field in the first place is to benefit from existing knowledge and familiar expectations (which are no longer guarantteed).

                      I guess formally adding an operator means you should call it something else? (Just like how we don’t call fields a group even though it could be seen as a group with an added * operator.)

                      This has no bearing on the 1/0 = 0 question however, which still works from what’s discussed in the article.

                      1. 1

                        As I understand it, you’ve only defined the expression 1/0 but you are saying that /0 isn’t shorthand for the multiplicative inverse of 0 as is normally the case for /x being x^-1, by definition. Instead, /0 is some other kind of magical non-invertible operation that maps 1 into 0 (and who knows what /0 maps everything else into). Kind of curious what it has to do with 0 at all.

                        So I guess you can do this, but then you haven’t defined division by zero at all, you’ve just added some notation that looks like division by zero but instead just defined some arbitrary function for some elements of your field.

                        If you do mean that /0 is division by zero, then 1/0 has to be, by definition, shorthand for 1*0^-1 and the arguments that you’ve already dismissed apply.

                        1. 4

                          The definition of a field makes no statements about the multiplicative inverse of the additive identity (https://en.wikipedia.org/wiki/Field_(math)#Classic_definition). Defining it in a sound way does not invalidate any of the axioms required by the field, and, in fact, does define division by zero (tautologically). You end up with a field and some other stuff, which is still a field, in the same way that adding a multiplication operator on a group with the appropriate properties leaves you with a group and some other stuff.

                          The definition of the notation “a / b => a * b^-1” assumes that b is not zero. Thus, you may define the case when b is 0 to mean whatever you want.

                          That people want to hold on to some algebraic “identities” like multiplying by the denominator cancels it doesn’t change this. For that to work, you need the assumption that the denominator is not zero to begin with.

                          1. 1

                            In what way, whatever it is you defined /0 to be, considered to be a “division”? What is division? Kindly define it.

                            1. 3

                              Division, a / b, is equal to a * b^-1 when b is not zero.

                              1. 2

                                And when b is zero, what is division? That’s the whole point of this argument. What properties does an operation need to have in order to be worthy of being called a division?

                                1. 3

                                  Indeed, it is the whole point. For a field, it doesn’t have to say anything about when you divide by zero. It is undefined. That doesn’t mean that you can’t work with and define a different, but still consistent, structure where it is defined. In fact, you can add the definition such that you still have the same field, and more.

                                  edit: Note that this doesn’t mean that you’re defining a multiplicative inverse of zero. That can’t exist and still be a field.

                                  1. 1

                                    In what way is it consistent? Consistent with what? As I understand it, you’re still saying that the expression 1/0 is an exception to every other theorem. What use is that? You still have to write a bunch of preconditions, even in Coq, saying how the denominator isn’t zero. What’s the point of such a definition?

                                    It seems to me that all of this nonsense is about not wanting to get an exception when you encounter division by zero, but you’re just delaying the problem by having to get an exception whenever you try to reason with the expression 1/0.

                                    1. 3

                                      I mean that the resulting structure is consistent with the field axioms. The conditions on dividing by zero never go away, correct. And yes, this is all about avoiding exceptions in the stack unwinding, programming language sense. The article is a response to the statements that defining division by zero in this way causes the structure to not be a field, or that it makes no mathematical sense. I am also just trying to respond to your statements that you can’t define it and maintain a field.

                                      1. 1

                                        It really doesn’t make mathematical sense. You’re just giving the /0 expression some arbitrary value so that your computer doesn’t raise an exception, but what you’re defining there isn’t division except notationally. It doesn’t behave like a division at all. Make your computer do whatever you want, but it’s not division.

                                        1. 5

                                          Mathematical sense depends on the set of axioms you choose. If a set of axioms is consistent, then it makes mathematical sense. You can disagree with the choices as much as you would like, but that has no bearing on the meaning. Do you have a proof that the resulting system is inconsistent, or even weaker, not a field?

                                          1. 1

                                            I don’t even know what the resulting system is. Is it, shall we say, the field axioms? In short, a set on which two abelian operations are defined, with two distinct identities for each abelian operation, such that one operation distributes over the other? And you define an additional operation on the distributing operation that to each element maps its inverse, except for the identity which instead is mapped to the identity of the distributed-over operation?

                                            1. 2

                                              It’s a field where the definition of division is augmented to include a definition when the divisor is zero. It adds no new elements, and all of the same theorems apply.

                                              1. 1

                                                I’m bailing out, this isn’t a productive conversation for either of us. Sorry.

                                                1. 1

                                                  You are correct. The field axioms are all still true, even if we extend / to be defined on 0.

                                                  The reason for this is that the axioms never “look at” any of the values x/0. They never speak of them. So they all hold regardless of what x/0 is.

                                                  That said, even though you can define x/0 without violating axioms it doesn’t mean you should. In fact it seems like a very bad idea to me.

                            2. 1

                              That doesn’t make it not a field; you don’t have to have a division operator at all to be a field, let alone a division operator that is defined to be multiplication by the multiplicative inverse.

                              1. 1

                                What is division?

                                1. 1

                                  zeebo gave the same answer I would give: a / b is a multiplied by the multiplicative inverse of b when b is not zero. This article is all about how a / 0 is not defined and so, from an engineering perspective, you can define it to be whatever you want without losing the property that your number representation forms a field. You claimed that defining a / 0 = 1 means that your numbers aren’t a field, and all I’m saying is that the definition of the division operator is 100% completely orthogonal to whether or not your numbers form a field, because the definition of a field has nothing to say about division.

                                  1. 1

                                    What is an engineering perspective?

                                    Also, this whole “a field definition doesn’t talk about division” is a bit of misunderstanding of mathematical idioms. The field definition does talk about division since “division” is just shorthand for “multiplicative inverse”. The reason the definition is written the way it is (excluding 0 from having a multiplicative inverse) is that giving zero a multiplicative inverse results in contradictions. When you say “ha! I won’t let that stop me! I’m going to define it anyway!” well, okay, but then either (1) you’re not definining a multiplicative inverse i.e. you’re not defining division or (2) you are defining a multiplicative inverse and you’re creating a contradiction.

                                    1. 1

                                      (I had a whole comment here, but zeebo is expressing themselves better than I am, and there’s no point in litigating this twice, especially when I feel like I’m just quoting TFA)

                                      1. 1

                                        Me too, I’m tapping out.

                        1. 7

                          Bad idea, it should error or give NaN.

                          1/0 = 0 is mathematically sound

                          It’s not mathematically sound.

                          a/b = c should be equivalent to a = c*b

                          this fails with 1/0 = 0 because 1 is not equal to 0*0.

                          Edit: I was wrong, it is mathematically sound. You can define x/0 = f(x) any function of x at all. All the field axioms still hold because they all have preconditions that ensure you never look at the result of division by zero.

                          There is a subtlety because some people say (X) and others say (Y)

                          • (X) a/b = c should be equivalent to a = c*b when the LHS is well defined

                          • (Y) a/b = c should be equivalent to a = c*b when b is nonzero

                          If you have (X) definition in mind it becomes unsound, if you are more formal and use definition (Y) then it stays sound.

                          It seems like a very bad idea to make division well defined but the expected algebra rules not apply to it. This is the whole reason we leave it undefined or make it an error. There isn’t any value you can give it that makes algebra work with it.

                          It will not help programmers to have their programs continue on unaware of a mistake, working on with corrupt values.

                          1. 14

                            I really appreciate your follow-up about you being wrong. It is rare to see, and I commend you for it. Thank you.

                            1. 8

                              This is explicitly addressed in the post. Do you have any objections to the definition given in the post?

                              1. 13

                                I cover that exact objection in the post.

                                1. 4

                                  It will not help programmers to have their programs continue on unaware of a mistake, working on with corrupt values

                                  That was my initial reaction too. But I don’t think Pony’s intended use case is numerical analysis; it’s for highly parallel low-latency systems, where there are other (bigger?) concerns to address. They wanted to have no runtime exceptions, so this is part of that design tradeoff. Anyway, nothing prevents the programmer from checking for zero denominators and handling them as needed. If you squint a little, it’s perhaps not that different from the various conventions on truthy/falsey values that exist in most languages, and we’ve managed to accommodate to those.

                                  1. 4

                                    Those truthy/falsey values are an often source of errors.

                                    I may be biased in my dislike of this “feature”, because I cannot recall when 1/0 = 0 would be useful in my work, but have no difficulty whatsoever thinking of cases where truthy/falsey caused problems.

                                  2. 4

                                    1/0 is integer math. NaN is available for floating point math not integer math.

                                    1. 2

                                      It will not help programmers to have their programs continue on unaware of a mistake, working on with corrupt values.

                                      I wonder if someone making a linear math library for Pony already faced this. There are many operations that might divide by zero, and you will want to let the user know if they divided by zero.

                                      1. 7

                                        It’s easy for a Pony user to create their own integer division operation that will be partial. Additionally, a “partial division for integers” operator has been been in the works for a while and will land soon. Its part of operators that will also error if you have integer overflow or underflow. Those will be +?, /?, *?, -?.

                                        https://playground.ponylang.org/?gist=834f46a58244e981473c0677643c52ff

                                    1. 6

                                      Worth reading for the “A bit of history” section alone.

                                      1. 2

                                        That section still needs work. For example, I’m still not sure if Andrew Wright’s Simple Imperative Polymorphism was the impetus for implementing mutable references in MLs, or earlier MLs dealt with their type safety in some different ways. It also needs references to those papers in question. Any contributions to it are greatly appreciated!

                                      1. 7

                                        I think the author is conflating dependent types and refinement types.

                                        1. 3

                                          Could you elaborate why the author should use a broader term? Refinement Types is an even broader category than dependent types, and do not necessarily include types which depend on a value. In this case the author is specifically referring to types which depend on a value.

                                          1. 11

                                            In his example he’s not encoding the length of the arrays into the type, just adding a type contract that the length of the output of the function matches the lengths of the inputs. This is more in line with how refinement type systems work than dependent type systems.

                                        1. 5

                                          I just finished writing Practical TLA+ so it’s time for a break hahaha no I’ve got a workshop to write and a tutorial to clean up

                                          Outside of work I want to start revving up candymakimg again.

                                          1. 2

                                            Nice ~! I came across TLA+ recently and realized I should be using it at work. Got started with TLA+ using this intro guide - https://learntla.com/introduction/ (My schedule is a chapter per week).

                                          1. 13

                                            There’s a quote I like that I can’t remember from where:

                                            Thirty years ago “it reduces to 3SAT” meant the problem was impossible. Now it means the problem is trivial.

                                            1. 2

                                              I wrote something vaguely like that a few years ago, though I’m sure I wasn’t the first to observe it:

                                              SAT, the very first problem to be proven NP-complete, is now frequently used in AI as an almost canonical example of a fast problem

                                              1. 1

                                                Why is that? Because computers are much faster, or better algorithms?

                                                1. 3

                                                  We have faster hardware and better algorithms now, yes. But the real reason is because early theoretical results which emphasized worse-case performance had scared the entire field off even trying. These results based on complexity classes are true, but misleading: as it turns out, the “average” SAT instance for many real-world problems probably is solvable. Only when this was recognized could we make progress on efficient SAT algorithms. Beware sound theories mis-applied!

                                              1. 8

                                                I saw SAT solvers as academically interesting but didn’t think that they have many practical uses outside of other academic applications. … I have to say that modern SAT solvers are fast, neat and criminally underused by the industry.

                                                Echoing a good comment on reddit: The author didn’t list any practical applications!!! How can you then say they are criminally underused?

                                                The only one I know of is writing versioned dependency solver for a package manager (in the style of Debian’s apt). However, very few people need to write such code.

                                                What are some other practical applications? I think they are all quite specialized and don’t come up in day-to-day programming. Happy to be proven wrong.


                                                EDIT: I googled and I found some interesting use cases, but they’re indeed specialized. Not something I’ve done or seen my coworkers do:

                                                https://www.quora.com/What-are-the-industrial-applications-of-all-SAT-solvers

                                                http://www.carstensinz.de/talks/RISC-2005.pdf

                                                I can think of a certain scheduling algorithm that might have used a SAT solver, but without details I can’t be sure.

                                                1. 5

                                                  They see some use in formal methods for model checking. The Alloy Analyzer converts Alloy specs to SAT problems, which is one of the reasons its such a fast solver.

                                                  There’s also this talk on analyzing floor plans.

                                                  1. 4

                                                    A previous submission on SAT/SMT might help you answer that.

                                                    1. 4

                                                      I’ve used Z3 to verify that a certain optimized bitvector operation is equivalent to the obvious implementation of the intended calculation.

                                                      Just typed up the two variants as functions in the SMT language with the bitvector primitives and asked Z3 for the satisfiability of f(x) != g(x) and rejoiced when it said “unsatisfiable.”

                                                      1. 1

                                                        Hm this is interesting. Does this code happen to be open source?

                                                        1. 7

                                                          I’ll just post it here. :)

                                                          (define-sort Word () (_ BitVec 64))
                                                          (define-fun zero () Word  (_ bv0 64))
                                                          
                                                          ;; Signed addition can wrap if the signs of x and y are the same.
                                                          ;; If both are positive and x + y < x, then overflow happened.
                                                          ;; If both are negative and x + y > x, then underflow happened.
                                                          (define-fun
                                                              add-overflow-basic
                                                              ((x Word) (y Word)) Bool
                                                              (or (and (bvslt x zero)
                                                                       (bvslt y zero)
                                                                       (bvsgt (bvadd x y) x))
                                                                  (and (bvsgt x zero)
                                                                       (bvsgt y zero)
                                                                       (bvslt (bvadd x y) x))))
                                                          
                                                          ;; Here is a clever way to calculate the same truth value,
                                                          ;; from _Hacker's Delight_, section 2.13.
                                                          (define-fun
                                                              add-overflow-clever
                                                              ((x Word) (y Word)) Bool
                                                              (bvslt (bvand (bvxor (bvadd x y) x)
                                                                            (bvxor (bvadd x y) y))
                                                                     zero))
                                                          
                                                          (set-option :pp.bv-literals false)
                                                          
                                                          (declare-const x Word)
                                                          (declare-const y Word)
                                                          
                                                          (assert (not (= (add-overflow-basic x y)
                                                                          (add-overflow-clever x y))))
                                                          
                                                          (check-sat)
                                                          
                                                          1. 2

                                                            Here’s you an example of SMT solvers used for stuff like that. I added some more stuff in comments. You might also like some examples of Why3 code which is translated for use with multiple solvers. Why3 is main way people in verification community use solvers that I’m aware. WhyML is a nice, intermediate language.

                                                        2. 3

                                                          Keiran King and @raph compiled a SAT solver to WebAssembly to use for the “auto-complete” feature of Phil, a tool for making crossword puzzles (source).

                                                          1. 2

                                                            I found this library (and its docs) interesting. They go over some practical examples.

                                                            https://developers.google.com/optimization/cp/

                                                            1. 1

                                                              This looks like it’s about linear programming, not SAT solving. They’re related for sure but one reason it would be nice to see some specific examples is to understand where each one is applicable!

                                                            2. 2

                                                              I have personally used them when writing code to plan purchases from suppliers for industrial processes and to deal with shipping finished products out using the “best” carrier.

                                                            1. 1

                                                              Great article!

                                                              I’m a bit late to the party because I wanted to try this one myself by just eyeballing and refactoring.

                                                              Java concurrency

                                                              The first thing that confused me was the concurrency model. The methods are supposed to be atomic because of synchonized but wait obviously make it non-atomic (the operation is broken between before the wait call and after). Then what does notify do? Does it pause the thread that called notify? Or is the woken up thread paused but next to execute?

                                                              Looking at the first few Google results didn’t get me a clear answer to this.

                                                              I assumed the former and this could make a lot of take thread wake each other up, block on notify and then all continue pushing occupied into the negatives and return invalid values.

                                                              I think your spec assumes the latter.

                                                              Concurrency and testing
                                                              if random.randint(0, 10000) == 1234:
                                                                  cause_error
                                                              

                                                              would also be hard to test, need many runs and still have a chance of missing the error. This feels like a missing feature of the testing tool. For any non-deterministic part, the test should be allowed to pick the “random” values. In this case, the test should be allowed to pick which thread notify wakes up. And which thread runs next if there is a choice.

                                                              This is not saying anything about the difficulty in implementing such a testing tool but it also seems necessary if there’s going to be non-deterministic parts.

                                                              1. 3

                                                                Then what does notify do? Does it pause the thread that called notify? Or is the woken up thread paused but next to execute?

                                                                I assumed the former and this could make a lot of take thread wake each other up, block on notify and then all continue pushing occupied into the negatives and return invalid values.

                                                                I think your spec assumes the latter.

                                                                To my understanding it’s neither: notify wakes up a thread but does not execute it, nor does it guarantee it’ll be executed next. It just adds the woken thread into the scheduled pool.

                                                              1. 2

                                                                This is really a non-issue as far as I’m concerned.

                                                                Browsers (either standalone or with plugins) let users turn off images, turn off Javascript, override or ignore stylesheets, block web fonts, block video/flash, and block advertisements and tracking. Users can opt-out of almost any part of the web if it bothers them.

                                                                On top of that, nobody’s twisting anybody’s arm to visit “heavy” sites like CNN. If CNN loads too much crap, visit a lighter site. They probably won’t be as biased as CNN, either.

                                                                Nobody pays attention to these rants because at the end of the day they’re just some random people stating their arbitrary opinions. Rewind 10 or 15 or 20 years and Flash was killing the web, or Javascript, or CSS, or the img tag, or table based layouts, or whatever.

                                                                1. 10

                                                                  Rewind 10 or 15 or 20 years and Flash was killing the web, or Javascript, or CSS, or the img tag, or table based layouts, or whatever

                                                                  Flash and table based layouts really were and, to the extent that you still see them, are either hostile or opaque to people who require something like a screen reader to use a website. Abuse of javascript or images excludes people with low end hardware. Sure you can disable these things but it’s all too common that there is no functional fallback (apparently I can’t even vote or reply here without javascript being on).

                                                                  Are these things “killing the web” in the sense that the web is going to stop existing as a result? Of course not, but the fact that they don’t render the web totally unusable is not a valid defense of abuses of these practices.

                                                                  1. 3

                                                                    I wouldn’t call any of those things “abuses”, though.

                                                                    Maybe it all boils down to where the line is drawn between supported hardware and hardware too old to use on the modern web, and everybody will have different opinions. Should I be able to still browser the web on my old 100 Mhz Petnium with 8 Mb of RAM? I could in 1996…

                                                                    1. 12

                                                                      Should I be able to still browser the web on my old 100 Mhz Petnium with 8 Mb of RAM?

                                                                      To view similar information? Absolutely. If what I learn after viewing a web page hasn’t changed, then neither should the requirements to view it. If a 3D visualization helps me learn fluid dynamics, ok, bring it on, but if it’s page of Cicero quotes, let’s stick with the text, shall we?

                                                                      1. 5

                                                                        I wouldn’t call any of those things “abuses”, though.

                                                                        I think table based layouts are really pretty uncontroversially an abuse. The spec explicitly forbids it.

                                                                        The rest are tradeoffs, they’re not wrong 100% of the time. If you wanted to make youtube in 2005 presumably you had to use flash and people didn’t criticize that, it was the corporate website that required flash for no apparent reason that drew fire. The question that needs to be asked is if the cost is worth the benefit. The reason people like to call out news sites is they haven’t really seen meaningfully new features in two decades (they’re still primarily textual content, presented with pretty similar style, maybe with images and hyperlinks. All things that 90s hardware could handle just fine) but somehow the basic experience requires 10? 20? 100 times the resources? What did we buy with all that bandwidth and CPU time? Nothing except user-hostile advertising as far as I can tell.

                                                                        1. 2

                                                                          If you wanted to make youtube in 2005 presumably you had to use flash and people didn’t criticize that

                                                                          At the time (ok, 2007, same era) I had a browser extension that let people view YouTube without flash by swapping the flash embed for a direct video embed. Was faster and cleaner than the flash-based UI.

                                                                          1. 1
                                                                          2. 2

                                                                            I’d say text-as-images and text-as-Flash from the pre-webfont era are abuses too.

                                                                      2. 7

                                                                        On top of that, nobody’s twisting anybody’s arm to visit “heavy” sites like CNN. If CNN loads too much crap, visit a lighter site.

                                                                        Or just use http://lite.cnn.io

                                                                        1. 2

                                                                          nobody’s twisting anybody’s arm to visit “heavy” sites like CNN

                                                                          Exactly. It’s not a “web developers are making the web bloated” problem, it’s a “news organizations are desperate to make money and are convinced that personalized advertising and tons of statistics (Big Data!!) will help them” problem.

                                                                          Lobsters is light, HN, MetaFilter, Reddit, GitHub, GitLab, personal sites/blogs, various wikis, forums, issue trackers, control panels… Most of the stuff I use is really not bloated.

                                                                          If you’re reading general world news all day… stop :)

                                                                        1. 1

                                                                          I turn in my my final draft of Practical TLA+ on Wednesday.

                                                                          1. 1

                                                                            I just turned in my final draft.

                                                                          1. 1

                                                                            I might be in the minority here, but I don’t mind whiteboard puzzles. I’m not saying they’re effective as a hiring tool (I’m also not not saying that), but I’m always surprised when people say they stress specifically about them over other interview methods. I’m genuinely curious what exactly people dislike (other than ‘it’s not representative of the job’, which I agree with). Is it the stress and time pressure? Or the reliance on past knowledge? Would it be possible to construct a good whiteboard interview for you, or is the format itself distasteful?

                                                                            1. 4

                                                                              I think for the majority it’s because a lot of their knowledge is stored on the internet with their working memory copy simply being how to quickly look up the documentation to get the right answer.

                                                                              I think for the majority it’s because the internet has become an extension of their working memory and without it they flounder simply because they haven’t needed to commit to memory the details, or anything much more than were to find them when needed.

                                                                              The best analogy I can come up with is mental arithmetic, it used to be that you could take someone to the white board and ask them to work out a long division question or complex multiplication and most would be able to do so with little to no stress. With the prevalence of calculators nobody bothers to remember how to do long division or factorisation of difficult multiplication because they know how to use a calculator that does it quicker (we are animals of path of least resistance after all.)

                                                                              A white board interview where you’re describing abstract concepts would probably solve a lot of the worries, because that tends to be what most people remember, with the details filled in by a few searches of the documentation.

                                                                              1. 4

                                                                                A white board interview where you’re describing abstract concepts would probably solve a lot of the worries, because that tends to be what most people remember, with the details filled in by a few searches of the documentation.

                                                                                This makes sense to me – I feel like if you handed someone a marker and said “explain {something from their resume} to me,” a whiteboard interview would be a lot less intimidating.

                                                                                1. 2

                                                                                  I’d certainly expect people to be able to do a long multiplication on a whiteboard, though. It’s pretty standard stuff. If they couldn’t, I’d hope it was due to a mind blank under stress and not because they literally don’t understand how multiplying numbers works.

                                                                                  And I think that if you can’t do basic programming without the internet you’ll struggle to be productive. That’s not to say that you should just know everything, but far too many people I’ve seen can’t do any little basic bit of programming without googling the most basic things. I like that programming competitions, if nothing else, at least force you to learn to write the basic ‘glue’ code quickly without having to look up e.g. how to print something to two decimal places or how to read a float from standard input. Basic stuff you should just know. They also are an okay litmus test. I’ve never met anyone that did well in programming contests that was a bad programmer. But I’ve definitely met good programmers that didn’t do programming contests. It has a high false negative rate and a very low false positive rate, I expect.

                                                                                  1. 3

                                                                                    I personally haven’t had to do long multiplication on paper in well over a decade and while I can describe three different methods in abstract I wouldn’t be able to do them without looking up simply because I have forgotten the details over the years of resolving to use a calculator.

                                                                                    The same can be said for some with programming, maybe they use a framework that provides verbose abstractions but no longer remember how to do such things (e.g sessions, http, file handling) on “bare metal” without first looking it up.

                                                                                    Having a decent memory isn’t a bad thing but as Einstein supposedly once said “Never memorize something that you can look up.”

                                                                                    1. 5

                                                                                      Einstein probably never said that. However he did say. (In response to not knowing the speed of sound as included in the Edison Test: New York Times (18 May 1921); )

                                                                                      [I do not] carry such information in my mind since it is readily available in books. …The value of a college education is not the learning of many facts but the training of the mind to think.”

                                                                                      Basically don’t labor over learning dumb facts. I also though think it’s wise if you find a free moment to understand how and why things work.

                                                                                      1. 3

                                                                                        That is a much better quote, it also encompasses what milesrout was saying in a separate thread.

                                                                                        1. 2

                                                                                          It’s also likely that Einstein never said “Never memorize something you can look up”, so it’s not really fair to call it a quote. If you had to create a pithy new phrase from his quote it might be something like “Facts are no substitution for reason and understanding.”

                                                                                          1. 2

                                                                                            That is the reason for why I wrote “Einstein supposedly once said”; I wasn’t trying to pass off something that may not be true as fact. However it is certainly something that a small amount of searching found to be a popular phrase attributed to Einstein and that is the reason why I quoted it.

                                                                                            The New York Times reference you provided was much better not only in being easily traced back to the man himself but also because it better conveyed the point I was trying to make. Thank you for sharing it :)

                                                                                            1. 2

                                                                                              Yes, sorry for being pedantic. I just wanted to make sure I wasn’t being misunderstood there. I had assumed that you said it in good faith. Thank you for being patient.

                                                                                      2. 2

                                                                                        The ‘details’ are essentially that 2134 * 34 = 2134 * 30 + 2134 * 4. I really don’t think you’d have any trouble if you thought about it for a few seconds.

                                                                                        The problem I’ve seen is that people don’t even think about something. They either know it and do it or they convince themselves they don’t know it and don’t try to work it out. That, the predilection to giving up, that is the danger sign, not that they don’t know it.

                                                                                        The same can be said for some with programming, maybe they use a framework that provides verbose abstractions but no longer remember how to do such things (e.g sessions, http, file handling) on “bare metal” without first looking it up.

                                                                                        I mean if you’re doing high level stuff you shouldn’t expect to know the details of writing low level code. If people are testing your algorithm knowledge at a Javascript webapp gig, then it’s just bad interviewing. But people testing your algorithm knowledge at a routing algorithm gig seems pretty fair.

                                                                                        Having a decent memory isn’t a bad thing but as Einstein supposedly once said “Never memorize something that you can look up.”

                                                                                        But if you asked Einstein some basic physics he wouldn’t look it up, he’d know it. Because having fully internalised the basic principles of physics is just part and parcel of understanding physics at the level he understood physics. Like, if you asked a mathematician the epsilon-delta definition of a limit, they’d be able to explain what it is, and what it meant, even if perhaps they couldn’t write it down formally left to right in one go if they hadn’t recently taught a course on analysis. Not because they’re geniuses that remember everything but because it’s just the most basic fundamental knowledge that everything else is based on.

                                                                                        1. 5

                                                                                          I think we are both on the same page, possibly I am bad at explaining what I am trying to say.

                                                                                          people testing your algorithm knowledge at a routing algorithm gig seems pretty fair

                                                                                          Agreed, the problem I think many see with white board interviews is that they are largely used to test knowledge that isn’t pertinent to the job at hand for example testing your algorithm knowledge at a job where you’re largely expected to write high level web apps where everything is wrapped in an closed source abstraction you’re going to need to learn on the job anyway.

                                                                                          1. 1

                                                                                            Exactly. They used to test how an individual candidate goes about problem solving, but nowadays they’re just a litmus test to see if you’ve memorized all the graph algorithms you might be asked to regurgitate.

                                                                                          2. 3

                                                                                            But if you asked Einstein some basic physics he wouldn’t look it up, he’d know it.

                                                                                            All of my physics professors and PIs looked basic stuff up all the time. There’s a reason we were allowed to take two pages of equations into exams.

                                                                                  1. 2

                                                                                    The non-syncing of spec code with implementation code really feels like the big barrier to making this usable in general.

                                                                                    One idea I had to tackle this issue in a language like Python would be to allow for executable doc-strings within the code that could let you write specs inline, and have those be parsed out (but by default it would use the actual in-code implementation)

                                                                                    That way you could write simplifying specs for certain parts of the code (say, the result of input will be any string instead of waiting on stdin when checking), while still avoiding duplication because most code is straightforward

                                                                                    Though to be honest this might be very hard to get right. I feel like it’s a bit like the ORM/Type System issue, where type systems are usually rigid and don’t give much “type-check-time” flexibility, but ORMs are usually defined dynamically (relative to the type system)

                                                                                    1. 6

                                                                                      This is why I ended up spending less time with TLA after learning it. However, learning it was an incredibly useful exercise that has dramatically informed the way I build systems. It made me start to ask why I can’t write TLA style invariants and check executions of concurrent and distributed algorithms I build in general purpose languages.

                                                                                      I realized I actually can get similar results on real code if I build systems carefully: schedule multithreaded interleavings at cross-thread communication points, simulate distributed clusters with buggy networks in a single process at accelerated speed a la discrete event simulation, things that use files are communicating with future instances of themselves and you can record logs of file operations and arbitrarily truncate them and ensure invariants hold after restart.

                                                                                      my main project right now is trying to make the above ideas into nice libraries that let people run their code in more realistic ways before opening pull requests, and integrating those tools into the construction process of the sled database.

                                                                                      1. 3

                                                                                        An idle thought which can go on my list of side projects to start “one day” (probably right after the bus accident): probably symbolic execution can be used to demonstrate, if not enforce, the synchronisation of TLA+-type models with code. A symbolic executor can show the different cases a program will execute based on its input and the outputs that result; those can be compared with the cases discovered by the model-checking tool.

                                                                                        Hooray, I’m not the first person to have that idea! You can combine formal methods with symbolic execution and meet in the middle.

                                                                                        1. 2

                                                                                          One idea I had to tackle this issue in a language like Python would be to allow for executable doc-strings within the code that could let you write specs inline, and have those be parsed out (but by default it would use the actual in-code implementation)

                                                                                          While this example was pretty close to the code implementation, TLA+ (and most specification languages) are too flexible to allow easy embedding. Here the processes were actual threads, but they could just as easily be servers, or human agents, or an abstracted day/night cycle. In one spec I wrote, one process represented two separate interacting systems that, at that level of detail, were assumed to have perfect communication.

                                                                                        1. 5

                                                                                          Seems to be some kind of viewport issue on iOS / Safari- text on the left and right is clipped off:

                                                                                          https://imgur.com/a/kl9P6PG

                                                                                          1. 4

                                                                                            I have the same issue on mobile chrome.

                                                                                            1. 1
                                                                                            1. 4

                                                                                              To the people saying “I get what he’s trying to say, but his tone is wrong”, I think you may be misunderstanding him. He straight up said

                                                                                              Why do people like you like frameworks? Are you weak or are you stupid? Or both?

                                                                                              The tone is exactly right for what he’s saying: “if you use frameworks, you’re beneath me.” With a less appropriate tone, we might mistake him for being thoughtful.

                                                                                              1. 30

                                                                                                Other important political aspect of Material Design (and some other UI/web styles that are popular now) is “minimalism”. Your UI should have few buttons. User should have no choices. User should be consumer of content, not a producer. Having play and pause buttons is enough. User should have few choices how and what to consume — recommender system (“algorithmic timeline”, “AI”) should tell them what to consume. This rhetoric is repeated over and over in web and mobile dev blogs.

                                                                                                Imagine graphics editor or DAW with “material design”. It’s just nearly impossible. It’s suitable only for scroll-feed consumption and “personal information sharing” applications.

                                                                                                Also, it’s “mobile-first”, because Google controls mobile (80% market share or something like that). Some pages on Google itself (i.e. account settings) look on desktop like I’m viewing it on giant handset.

                                                                                                P.S. compared with “hipster” modernist things of ~2010, which often were nice and “warm”, Material Design looks really creepy for me even when considering only visual appearance.

                                                                                                1. 10

                                                                                                  A potentially interesting challenge: What does a design language for maker-first applications look like?

                                                                                                  1. 17

                                                                                                    Not sure if such design languages exist, but from what I’ve seen, I have feeling that every “industry” has its own conventions and guidelines, and everything is very inconsistent.

                                                                                                    • Word processors: lots of toolbar buttons (still lots of them now, but in “ribbons” which are just tabbed widgets). Use of ancient features like scroll lock key. Other types of apps usually have actions in menus or in searchable “run” dialogs, not toolbar button for each feature.
                                                                                                    • Graphics editors: narrow toolbars with very small buttons (popularized by both Adobe and Macromedia, I think). Various non-modal dialogs have widgets of nonstandard small size. Dark themes.
                                                                                                    • DAWs: lots of insane skeuomorphism! Everything should look like real synths and effects, with lots of knobs and skinning. Dark themes. Nonstandard widgets everywhere. Single program may have lots of multiple different styles of widgets (i.e. Reason, Fruity Loops).
                                                                                                    • 3D: complicated window splits, use of all 3 mouse buttons, also dark themes. Nonstandard widgets, again. UI have heritage from Silicon Graphics workstations and maybe Amiga.

                                                                                                    I thought UI guidelines for desktop systems (as opposed to cellphone systems) have lots of recommendations for such data editing programs, but seems that no, they mostly describe how to place standard widgets in dialogs. MacOS guidelines are based on programs that are included with MacOS, which are mostly for regular consumers or “casual office” use. Windows and Gnome guidelines even try to combine desktop and mobile into one thing.

                                                                                                    Most “editing” programs ignore these guidelines and have non-native look and feel (often the same look-and-feel on different OSes).

                                                                                                    1. 3

                                                                                                      3D: complicated window splits, use of all 3 mouse buttons, also dark themes. Nonstandard widgets, again. UI have heritage from Silicon Graphics workstations and maybe Amiga.

                                                                                                      Try Lisp machines. 3D was a strong market for Symbolics.

                                                                                                    2. 9

                                                                                                      I’d suggest–from time spent dealing with CAD, programming, and design tools–that the biggest thing is having common options right there, and not having overly spiffy UI. Ugly Java swing and MFC apps have shipped more content than pretty interfaces with notions of UX (notable exceptions tend to be music tools and DAW stuff, for reasons incomprehensible to me). A serious tool-user will learn their tooling and extend it if necessary if the tool is powerful enough.

                                                                                                      1. 0

                                                                                                        (notable exceptions tend to be music tools and DAW stuff, for reasons incomprehensible to me)

                                                                                                        Because artists demand an artsy-looking interface!

                                                                                                      2. 6

                                                                                                        We had a great post about two months back on pie menus. After that, my mind goes to how the Android app Podcast Addict does it: everything is configurable. You can change everything from the buttons it shows to the tabs it has to what happens when you double-click your headset mic. All the good maker applications I’ve used give me as much customization as possible.

                                                                                                        1. 2

                                                                                                          It’s identical to the material design guidelines but with a section on hotkeys, scripts, and macros.

                                                                                                        2. 5

                                                                                                          P.S. compared with “hipster” modernist things of ~2010

                                                                                                          What do you mean by this

                                                                                                          1. 4

                                                                                                            Stuff like Bootstrap mentioned there, early Instagram, Github. Look-and-feels commonly associated with Silicon Valley startups (even today).

                                                                                                            These things usually have the same intentions and sins mentioned in this article, but at least look not as cold-dead as Material Design.

                                                                                                            1. 3

                                                                                                              Isn’t this like… today? My understanding was: web apps got the material design feel, while landing pages and blogs got bootstrappy.

                                                                                                              I may be totally misinterpreting what went on though

                                                                                                            2. 3

                                                                                                              Bootstrap lookalikes?