1.  

    I like the treatment in Exercise 1.19 of SICP which I think is a version of matrix exponentiation expressed in a different way.

    1. 3

      What I like about this thread is the many light themes rather than dark.

      Looking around the web you’d think those of us that want/need light themes are unfashionable or misguided or just the minority. Maybe we’re just less vocal.

      1. 2

        Dark text on light background works better for people with astigmatism, and astigmatism is quite common.

      1. 3

        This looks great, thanks for sharing it here! I’m keen to join but can’t make the first session due to other commitments.

        Given that the reading material is clearly laid out it should be possible to catch up but are meetings recorded or transcribed at all?

        1. 4

          I’ve asked about this in chat. It is planned that the meetings will also be transmitted on Twitch, with recordings kept for 14 days.

          1. 4

            Please encourage them to do that and to post the recording links.
            My time zone means I can’t join live, but I’d like to follow along “offline”.

            Working through something with recordings of discussions is strangely motivating and you actually feel involved, despite not being able to contribute.

            1. 2

              Thank you!

            2. 3
            1. 31

              That’s cool and all, but knowing Mozilla, an about:config option called “legacyUserProfileCustomizations” is gonna disappear.

              Related: In Firefox 90, they removed the “Compact” density option, which I kind of rely on to be comfortable with Firefox. They added an about:config option, “browser.compactmode.show”, to add it back. In Firefox 91, if you have the option enabled, they renamed the option from “Compact” to “Compact (not supported)”. I know it’s only a matter of time before they remove it entirely. And I’m kind of panicking about that, because I really, really don’t want more vertical space to be wasted by padding in the tab bar on small laptop screens. If anything, I find the “Compact” option too big. I wish Mozilla would stop changing things for the worse, and I wish Mozilla would stop taking away configuration options.

              1. 18

                What is wrong with them? Every major release, they’ve taken away functionality that I depend on.

                1. 12

                  Every major release, they’ve taken away functionality that I depend on.

                  I feel the same. I even often joke that Mozilla is spying on me with the sole goal of knowing what features I rely on and yanking them away from me :).

                  What is wrong with them?

                  Nothing is wrong with them. We just aren’t part of their main demographic target.

                  1. 11

                    I absolutely dread every single firefox update for the same reason - something I rely on or have burned in have and muscle memory get altered or removed.

                    It feels completely hopeless to me as well because I can’t see another acceptable choice. I can’t support Google’s browser engine monopoly and every other browser I research has some other issue that makes me reject it in comparison.

                    It feels like abuse by endless paper cuts, unwanted and unnecessary changes forced on me with no realistic choice to opt out. These changes seem to be accelerating too and meanwhile firefox market share declines further and further.

                  2. 10

                    That’s cool and all, but knowing Mozilla, an about:config option called “legacyUserProfileCustomizations” is gonna disappear.

                    The reason it was made an option is to slightly improve startup time since it won’t have to check for this file on the disk. Comparatively few people use it, which is hardly surprising since it’s always been a very hidden feature, so it kind of makes sense: if you’re going to manually create CSS files then toggling an about:config option is little trouble.

                    Apparently, the name “legacy” is in there “to avoid giving the impression that with this new preference we are adding a new customization feature”. I would be surprised if it was removed in the foreseeable future, because it’s actually not a lot of code/effort to support this.

                    That being said, instead of relegating userChrome to a “hidden feature”, it would seem to me that properly integrating support for these kind of things in Firefox would give a lot more benefits. In many ways, almost everyone is a “power user” because a lot of folks – including non-technical people – spend entire days in the browser. For example, I disable the “close tab” button because I press it by accident somewhat frequently which is quite annoying. While loads of people don’t have this problem, I suspect I’m not the only person with this small annoyance considering some other browsers just offer this as a setting, but I am one of the comparatively small group of people who has the know-how to actually fix it in Firefox.

                    The technical architecture to do a lot of these things is right there and actually works quite well; it just doesn’t fit in the “there is one UX to satisfy everyone, and if you don’t like it then there’s something wrong with you”-mentality 🤷

                    1. 18

                      All preference changes through about:config are officially unsupported and come with zero guarantees. This includes creating custom chrome folders.

                      There actually is a maintenance and complexity cost for keeping these things alive. We’ve done a lot of hardening lately that was cumbersome to pull off in light of those customizations. In essence, we are disabling some protections when we detect profile hackery. I want to repeat: despite our team working around and “acknowledging” the existence of those hacks, they are still unsupported and we can’t promise to always work around custom profile quirks.

                      The best way to be heard and change things in an open source project is to show up and help drive things. I know this isn’t easy for big project like ours…

                      1. 4

                        This used to be a longer comment but I edited it and now it only shows this note 😳. I was needlessly nasty. Sorry, man, rough day.

                        1. 1

                          No harm done 👍

                        2. 2

                          I, too, prefer the “Compact” theme. Is there still anything that can be done to keep it going forward?

                        3. 2

                          I’ve heard this startup time justification before, but surely the additional hassle of implementing, testing, and documenting a new configuration parameter isn’t worth saving a single stat call on startup? It’s hard to imagine that even shows up in the profile.

                          1. 1

                            If everything else has already been tightly optimized, the stat call being performed on a spinning rust drive could be shown as being a major performance bottleneck when profiling startup performance.

                            1. 6

                              When I rebuild LLVM, ninja does a stat system call for every C++ source and header file on the disk, about 10,000 of them in total. If I have no changes, then it completes in so little time that it appears instantaneous.

                              If the cost of a stat system call is making a user-noticeable difference to start times, then you’re in an incredibly rare and happy place.

                      1. 3

                        The terminology and lack of consistency mapping concepts to commands caused me so much confusion early on.

                        One tool I stumbled on that helped clear up a lot of confusion was NDP software’s Git Cheatsheet - no affiliation, just a grateful user.

                        1. 10

                          I glanced at lucky-commit to see what it was doing:

                          lucky-commit adds its whitespace to a 64-byte-aligned block at the very end of the commit message. Since everything that precedes the whitespace is constant for any particular commit, this allows lucky-commit to cache the SHA1 buffer state and only hash a single 64-byte block on each attempt.

                          1. 3

                            Did you look at the commit history :)

                            1. 2

                              Oh wow, that’s clever.

                            1. 12

                              TIL about starship for prompts. Looks good, I will give that a try.

                              1. 3

                                I used it when it was a regular zsh script. I got tired of having to re-configure it whenever updates broke my configuration as it changed or removed features I used. I’m not sure how stable it is now but I did enjoy it while it lasted.

                                1. 2

                                  I’ve been using it for a while and haven’t had any of the problems that the other commenter seemed to have. My setup is pretty simple though.

                                  1. 3

                                    There was one significant backwards-incompatible change that I can recall, but it was trivial to address. And for my part, I’d rather have my software evolving than never releasing a change in case it breaks someone somewhere.

                                  2. 1

                                    I used starship previously and something happened to make it grind to a halt. I moved to romkatv/powerlevel10k and have had no such issues since. I once saw a discussion around a plug-in being implemented which was rejected as it took 10ms to run!

                                    Edit: found the discussion, it was 11.4ms and it was reworked rather than rejected, but hopefully you get the point I was trying to make

                                    1. 2

                                      One aspect of my choice of Starship that doesn’t come through in this post is that I use the fish shell as my daily driver, but I use zsh and bash on remote hosts in various places. Having a consistent prompt on all three of those is a huge selling point, even if my prompt might take 50-70ms to render.

                                      1. 2

                                        Don’t worry, not trying to invalidate your choices or anything. I’m sure it was something I did otherwise the GitHub issues would be full of noise! Having a consistent prompt is a really solid pro for sure.

                                        1. 1

                                          I didn’t think you were :D

                                          I just figured it might help to have a bit of clarity on the rationale. Arguably I should edit the post with that :)

                                        2. 1

                                          I’m curious why such a dichotomy? Are you required to use zsh/bash on the remote machines or is it a matter of convenience? I’m forced to use bash, but would gladly switch to zsh if I could install it…

                                    1. 12

                                      For a few years now, my response to this question is a counter-question:

                                      Is reading/writing/arithmetic a science or an art?

                                      Of course they’re neither. So it is with programming. You can use programming to do either science or art. But it’s just a tool.


                                      There’s a cool question in the middle of the post. As I understand “ontological status”:

                                      Where does the essence of a program reside?

                                      Following Peter Naur, the unsatisfactory answer for most programs is, “in the programmers’ heads,” with the increasing implication of incoherence for large teams of programmers. Very large programs stop being comprehensible in humanistic terms, and start to rather resemble egregores. Like gods, or bureaucracies.

                                      But I think we can do better, retain more control. A better answer, for well-written programs, is “in the space of inputs accepted, as categorized into different regimes with relatively linear processing logic.” Personally I like to visualize this input space as tests. Haskell/OCaml and APL propose alternative approaches that also seem plausible.

                                      1. 3

                                        But I think we can do better, retain more control. A better answer, for well-written programs, is “in the space of inputs accepted, as categorized into different regimes with relatively linear processing logic.” Personally I like to visualize this input space as tests. Haskell/OCaml and APL propose alternative approaches that also seem plausible.

                                        I think I’d say you were somewhere near the mark with “egregore”, a cool word I just learned from your comment, but that the space of what a program “really is” extends not just to the minds of the people who write / maintain / administer it, but to the entire substrate it operates on, including physical hardware and the minds of its users and the shadowy, informal conceptual footprint it has therein. Much like the way that, say, a fictional / mythological / historical narrative exists in the often vast and highly ramified space between authors and readers and cultural context.

                                        Not that there’s anything wrong with trying to delineate space-of-inputs-accepted and the like - just that we’re probably kidding ourselves if we think that we’re going to get to comprehensibility at all, for large things. Creating bounded spaces within which to reason and exercising extreme humility about the big pictures seems like as good as it’s ever really going to get, most days.

                                        1. 2

                                          Very valid considerations. My answer to that is: if making it large gives up control over it, perhaps we shouldn’t make it large.

                                          As a concrete example, one project I work on explores maintaining control over a full computing stack with the following limitations:

                                          • single instruction set (32-bit x86)
                                          • single video mode (1024x768 with 256 colors)
                                          • single fixed-width font (8x16px)
                                          • mostly text mode
                                          • only ATA (IDE) disk drives, running in a slow non-DMA mode

                                          It’ll add features over time, but only so fast as I can figure out how to track – and communicate to others! – the input space. For example, it doesn’t have a mouse yet, because I don’t understand it and because I don’t want to just pull in a mouse driver without understanding it and having thorough unit tests (in machine code!) for it.

                                          Basically I want to consider the possibility that humanity has been adopting computers way too aggressively and introducing lots of risks to all of society at large. I don’t want software to go from explosive adoption to another hamstrung and stiflingly regulated field, bureaucracy by other means. There’s too much promise here for that, even if we take a hundred years to slowly develop it.

                                          1. 2

                                            Very valid considerations. My answer to that is: if making it large gives up control over it, perhaps we shouldn’t make it large. … Basically I want to consider the possibility that humanity has been adopting computers way too aggressively and introducing lots of risks to all of society at large.

                                            Well said, even if I’m personally pretty sure the genie is out of the bottle at this point.

                                            I don’t think I can really draw a clear line in my own mind between what bureaucracy is and what software is, but I welcome efforts to ameliorate and rate-limit the poisoning of things that seems to come with scaling software.

                                        2. 0

                                          Uh, writing is definitely an art?

                                          1. 12

                                            Not if I’m writing a grocery list.

                                            1. 1

                                              hmm. I was initially unsure reading this, but I think I agree writing a grocery list is probably not an art. I’m not shocked there’s an edge case here, but it’s interesting to think about. I guess the programming equivalent would be code ls or similar trivial cases

                                              1. 5

                                                It is by no means a rare edge case. If you assume all writing is art, that implies science is also art. Which is a reasonable and internally consistent interpretation of the terms, but not the frame of reference of the original question.

                                                1. 2

                                                  Scientific writing (such as journal articles) is certainly an art. Many good scientists are bad at the writing.

                                                  1. 2

                                                    It sounds like you aren’t bothered by the original question. Which is great; it’s not a very interesting question. I’m personally more curious what you think about the second half of my first comment :)

                                                    1. 2

                                                      It’s a skill for sure, but that doesn’t necessarily make it an art. If I look at my own writing (which isn’t scientific but is technical) then the amount of creativity that’s involved isn’t much more than, say, fixing my bike: it requires a bit at times, but mostly it’s just working at it.

                                              2. 6

                                                It’s definitely a craft.

                                                1. 3

                                                  That’s been my opinion for a long time now. Like other crafts it isn’t automatically included or excluded from other human activities - art, science, commerce, hobbies …

                                                  If you accept that then the question posed isn’t very interesting.

                                                  1. 1

                                                    I think the interesting question is whether it’s a craft or an engineering discipline.

                                                  2. 2

                                                    Not necessarily. Designing a building can an art, a science, or a combination of both. A friend of mine does ghost writing for non-fiction. Most of it follows a formula and neither of us would consider it art.

                                                    Words are a tool used to communicate the same way verbal speech is.

                                                    1. 1

                                                      But surely in ghostwriting non-fiction you still have choice in what words you use to convey the concepts?

                                                      1. 1

                                                        I’ve done a fair amount of technical writing for hire. Art enters the picture somewhere, to be sure, but where you’re writing to strict house standards and pre-set outlines it does have a way of driving most of the feeling of creative expression out of things. And I suppose that gets at how I understand “art” - a feeling as much as anything.

                                                1. 2

                                                  Does anyone here use straight? I never got the advantage, compared to just cloning the repositories yourself (or as submodules). Plus you have to run random code from a github repository.

                                                  1. 2

                                                    You run random code anyway. Even without straight? Or do you audit all the packages and their dependencies before you use them?

                                                    1. 2

                                                      I minimize the number of packages I use and usually skim through the source code. Automatically downloading and evaluating code from a repository seems more dangerous, but I do get your point.

                                                    2. 2

                                                      No I haven’t felt the need.

                                                      I (ab)used Cask for a long time because it was a nice declarative way of configuring packages in ~/.emacs.d. Since I’ve returned back to using package.el and the fact that it handles dependencies much better now, I just rely on it maintaining package-selected-packages and if needed I can just call (package-install-selected-packages) but I don’t have more sophisticated needs.

                                                    1. 2

                                                      Racket:

                                                      (for/fold ([p #f]
                                                                 [cnt 0]
                                                                 [counts null]
                                                                 #:result (cdr (reverse (cons `(,p ,cnt) counts))))
                                                                ([c (in-string "aaaabbbcca")])
                                                        (if (equal? p c)
                                                            (values c (add1 cnt) counts)
                                                            (values c 1 (cons `(,p ,cnt) counts))))
                                                      
                                                      1. 1

                                                        Also using fold, with mnm.l :

                                                        (def challenge (IN)
                                                            (foldr (\ (C ACC)
                                                                     (let ((((V . N) . TL) . ACC))
                                                                       (if (= C V)
                                                                         (cons (cons C (+ N 1)) TL)
                                                                         (cons (cons C 1) ACC))))
                                                              IN NIL))
                                                        
                                                        1. 1

                                                          Racket’s group-by is wonderful but I usually want to group consecutive equal items into clumps as they arise rather than a single monolithic group.

                                                          (define (group xs)
                                                            (match xs
                                                              [(cons x _)
                                                               (define-values (ys zs) (splitf-at xs (curry equal? x)))
                                                               (cons ys (group zs))]
                                                              [_ null]))
                                                          
                                                          (define (encode xs)
                                                            (for/list ([x xs])
                                                              (list (first x) (length x))))
                                                          
                                                          (encode (group (string->list "aaaabbbcca")))
                                                          
                                                        1. 5

                                                          I didn’t know youtube had a RSS feed as well, cool!

                                                          I think you’ll find many RSS users here at lobste.rs, it’s really handy (even though I subscribe using email and not RSS ;)

                                                          1. 4

                                                            They have 3 feed types that I’m aware of:

                                                            You can usually get the appropriate slug from the url but It’s not always clear what the channel id is especially since youtube introduced urls like https://www.youtube.com/c/stanford for Stanford university. You need to scrape the page to find the channel id.

                                                            I should add that their feeds are limited to the most recent additions so don’t expect to see a full history after you subscribe.

                                                            1. 2

                                                              RSS is the only way I can handle Youtube subscriptions. Being able to watch the video from my feed reader instead of the actual site, which is designed to get you to watch a ton of semi related videos, is the best.

                                                            1. 10

                                                              I see a lot of comments (not just here but everywhere I;ve seen discussions) about mirrors which will address the immediate problem of the source code not being available.

                                                              The bigger issue though is how to host/maintain is distributed/federated project, not just hosting source code but discussions, bug reports, issue tracking etc. that currently github adds on top of git.

                                                              The current version of youtube-dl will continue to work until youtube changes something and it stops working. It also worked with a massive amount of other streaming sites.

                                                              For example the api key for one quite popular streaming service had to be changed from time to time, presumably as the service began to notice and invalidated the key.

                                                              That’s what I’m more concerned about.

                                                              1. 4

                                                                The bigger issue though is how to host/maintain is distributed/federated project, not just hosting source code but discussions, bug reports, issue tracking etc. that currently github adds on top of git.

                                                                Email. And there are plenty of privacy-friendly email providers.

                                                                1. 2

                                                                  While the tools doesn’t currently have a UX as good as GitHub, it is definitely possible to develop a project in a distributed way.

                                                                  git repository is already distributed, and tools like git-ipfs-rehost can be used to make the repository easily available. Issues/bug reports can be stored in the git repo itself using git-bug. Patches can be sent over email. Pull requests can be made in an informal way over any kind of communication channels, for example Matrix.org

                                                                  1. 2

                                                                    Self-hosted git accessible via Tor Onion Service. HardenedBSD uses Gitea, which manages issues, wiki, and code storage. All of HardenedBSD’s public infrastructure is made available through Tor as well as through normal means.

                                                                    1. 4

                                                                      Me too. I love it.

                                                                      One of the main benefits is having the title and (usually) an overview/description or excerpt. It makes it so much easier to prioritise and filter content before (and often instead of) having to deal with the modern web experience directly.

                                                                      1. 2

                                                                        Me too. Instead of “still” I would also say that I use RSS more than ever. All the news sources I read I subscribe to via RSS, Atom or JSON Feed.

                                                                      1. 6

                                                                        Command line options to convert to new hashes look weird. “Frobnicate blobs”, “climb subtrees”, “use shovels”, “carbon offsets”.

                                                                        1. 13

                                                                          I think it’s intended as a joke/funny example.

                                                                          1. 1

                                                                            Yes. Other parts that made me chuckle:

                                                                            Somewhere out there is certainly some developer who actually memorizes SHA‑1 hashes

                                                                            and

                                                                            The value of write-only repositories is generally agreed to be relatively low

                                                                          2. 10

                                                                            I think it’s tribute to people creating fake Git manual entries with Markov chains and a 17th century forestry book (and the resulting texts being barely distinguishable from the original man pages).

                                                                            (I can’t find the original “fake” generator, but here is a similar page: https://git-man-page-generator.lokaltog.net/)

                                                                            1. 7

                                                                              Have you tried the reader mode with Firefox?

                                                                              1. 1

                                                                                Yeah, but it’s very invasive and will often change far too much IMHO. With this most UI will be mostly intact. Reader mode is great for reading an article. Everything else: not so much.

                                                                                1. 3

                                                                                  It’s also not available under some conditions and I’ve never been able to figure out exactly what they are. It’s usually fine but no heuristic is perfect.

                                                                                  1. 2

                                                                                    I particularly like about reader mode that it changes much. :)

                                                                                  2. 1

                                                                                    Yeah, when it’s available I am more than happy with reader mode. But I will keep this around for the other cases, although they are pretty rare now.

                                                                                  1. 8

                                                                                    I will actually make it to the very end of SICP, register machines and all.

                                                                                    Then try a non-trivial thing in Racket.

                                                                                    1. 3

                                                                                      Awesome! Racket is the first language I will learn some years from now when I attain Journeyman level in Python.

                                                                                      I’m very fascinated by both the language itself and the rich deep ecosystem that exists around it. Really impressive stuff!

                                                                                      1. 1

                                                                                        Why delay? It’s sufficiently different that I don’t think learning racket will interfere with improving python.

                                                                                        1. 2

                                                                                          Because I have found that when I’m trying to learn something as complex as a programming language, simultaneously cramming other syntaxes and paradigms into my head lessens my ability to master the one I’m currently working on and with. I just wrote a blog post about this, posted under separate cover :)

                                                                                          As I’ve said elsewhere, this isn’t forever, but I do need to rein myself in long enough to get out of the hole I’ve dug for myself.

                                                                                      2. 3

                                                                                        Try nanopass framework and compite to wasm!

                                                                                        1. 3

                                                                                          Since the David Beazley talk posted here a few weeks ago where he wrote a wasm interpreter in python during the talk, I have been keen to play with it. I shall give this a go - thank you for the recommendation!

                                                                                          1. 4

                                                                                            Since the David Beazley talk posted

                                                                                            I missed that. Can you post a link please?

                                                                                      1. 6

                                                                                        So I really enjoyed this video, but when I clicked on it I was kinda hoping it would talk about the circuitry inside the microprocessor rather than talking about interfacing from the outside, which I already have a decent grasp on.

                                                                                        But the presentation is outstanding, he planned all the diagrams, sheets, and wires so well! I’ll have to watch more of these. The only problem is then I’ll wanna play with more hardware again :)

                                                                                        1. 8

                                                                                          the circuitry inside the microprocessor

                                                                                          You can see a basic version in his building an 8-bit breadboard computer! playlist. It’s not 1-1 but I think it gives a beautiful and clear idea of exactly what’s happening down to the level of bits/pins/logic gates.

                                                                                          1. 2

                                                                                            In a similar vein, this series on building a computer out of relays is pretty interesting too: https://www.youtube.com/playlist?list=PL_1HsIiuOfg3QA91DUd9kGJjQoOHwlt5Q

                                                                                        1. 4

                                                                                          I really like the iterative deepening approach to teaching/learning because it matches how I learn anyway. First the basics, then dive deeper and deeper. It also seems a good fit for learning something slowly or over a longer time.

                                                                                          1. 16

                                                                                            Having interviewed a lot of people, SQL is one of those things that everyone thinks they know well and very few actually do. In interviews now, if I see them claiming expertise, I ask if they can do something more than “SELECT * FROM foo” because so often that’s all it takes to “know SQL” on your resume.

                                                                                            Good database knowledge can be extremely valuable. I can’t tell you how many times I’ve seen code that makes four or five round-trips to the DB, grabbing data, processing it client-side, and sending it back that could’ve been done in one round-trip with a well-crafted SQL query.

                                                                                            There’s the other side too: I’ve seen some truly awful database designs that have required multiple round trips because the DB designer didn’t understand foreign keys or constraints or whatever.

                                                                                            1. 4

                                                                                              Depends on how you interview me.

                                                                                              If you sit me down with a pen and paper and tell me to write a complex query…. I might well fail.

                                                                                              If you sit me down with say sqlitebrowser… and an editor side by side, I will rapidly iterate starting from very simple queries (yes, I will start with select * from foo) to as complex as need be.

                                                                                              And yes, I might occasionally refer to the syntax for the gnarlier corners.

                                                                                              But I will get it done pretty rapidly in a single very well crafted query.

                                                                                              Conversely, I’m a true believer in what CJ Date has been saying for decades…. so if you allow me to redesign the table definitions…. you’d be shocked by how simple my queries will be.

                                                                                              1. 3

                                                                                                Imo one of the best arguments against relying on ORMs is performance: in some situations a CTE or window function can get you one or two orders of magnitude improvement over a naive orm solution.

                                                                                                1. 2

                                                                                                  Nothing prevent you from implementing those edge case in your ORM though. I personally use SqlAlchemy, and I feel like it cover what I need as-is 90% of the time, and the 10% of the time left it gives me the tool to build more complexe queries and even allow me to keep using the “object mapping”. SqlAlchemy supports CTE and Window function!

                                                                                                  For even too complexe query, it might also be possible to wrap them into SQL Function and simply map your ORM to this function.

                                                                                                  1. 2

                                                                                                    Oh, to clarify, I think ORMs are great, I just don’t think it’s great to rely on them. They do 90% of the things for you, but you need to know SQL for the other 10% of cases. Some things aren’t like that, where there’s not such a wildly significant benefit as knowing SQL gives you in this case.

                                                                                                    1. 1

                                                                                                      This is very true. It’s also helpful to know (in rough terms) what the ORM is doing under the hood, something that’s only really possible if you understand the SQL behind the operations.

                                                                                                    2. 1

                                                                                                      Yep, Peewee orm also supports things like CTE, window functions, insert/on conflict, etc. The query builders for both libraries are very flexible, but you pretty much have to know SQL and then translate it into the APIs the query builder exposes. For experienced programmers this is no problem, but someone less fluent with SQL is going to have no idea how to use this advanced functionality, regardless of how it is exposed.

                                                                                                      1. 1

                                                                                                        Definitely! My point was mostly about ORM and “advanced”/performant SQL not being mutually exclusive.

                                                                                                        1. 1

                                                                                                          I like ORM or query builders not because I don’t know SQL, but rather because I detest the SQL syntax. I wish there were a better relational language. Maybe Tutorial D in front on Postgres’ storage engine.

                                                                                                  2. 2

                                                                                                    What would you consider beyond “SELECT * FROM foo"? I don’t touch SQL on a daily basis, but I could throw together a left, right, and full join if I needed to, and I’m aware of how to use subqueries. What SQL skills would someone have in order for you to consider them competent / good at SQL?

                                                                                                    1. 4

                                                                                                      JOINs, GROUP BY, that sort of thing. If they’re going to be building DBs, understanding indexes, unique constraints, and foreign keys.

                                                                                                      If you’re gonna be my lead database programmer/DB admin/DB architect, I’d want to see understanding of good database design (normal forms, good foreign key relationships, good key choices), CTEs, triggers (in your preferred database), being able to spot when a full table scan might happen, understanding when and how to use precomputed values for future queries, and so on.

                                                                                                      1. 4

                                                                                                        The use of aggregate functions, defining new aggregate functions, the various joins, the 3VL truth table, grouping, subselects, CTEs, that kind of thing.

                                                                                                        1. 3

                                                                                                          I like asking candidates

                                                                                                          • find me the employee with the highest salary (entire row, not just the salary) - will usually use sub select with max.
                                                                                                          • find me the employee with the second highest salary - expected to use window function but can still get away with two subquries.
                                                                                                          • find me the employee with the second highest salary in every department - expected to use window with partition.

                                                                                                          If you found a guy that thought about equal values ( rank / dense rank / row number ) you know he did some work. Hire him.

                                                                                                          Haven’t touched joins yet.

                                                                                                          1. 2

                                                                                                            I don’t know window function, but believe that I know join

                                                                                                            1. 3

                                                                                                              It’s well worth the time learning window functions.

                                                                                                              As Maruc Winand (who created use-the-index-luke.com and the newer modern-sql.com) says in his talk on Modern SQL there’s life before windows functions and life after windows functions.

                                                                                                            2. 1

                                                                                                              I’d much prefer lateral joins be used in some of these cases.

                                                                                                            3. 1

                                                                                                              I’ve seen no mention yet of EXPLAIN queries (Or similar operation in other RDMS than Postgresql?). Never been doing a lot of SQL in the past, but lately I had to work with some complexe queries over large dataset and most of my learning involved playing with EXPLAIN [ANALYZE], understanding the result and tweak the base query to fix the performance issue. Once you understand that, you can work from there to find the best index, where to place subqueries, set large enough working memory, etc.

                                                                                                          1. 5

                                                                                                            Now I’m actually curious, does anyone learn programming from a book?

                                                                                                            I figured books (and tutorials) are a good way to just get started if you can’t get there on your own, and I guess you can learn new tricks & deepen your knowledge with the help of a book after you’ve got the core stuff figured out. Between the getting started stage, and the deep end, you just have to learn programming by actually programming eh?

                                                                                                            I’m not sure people in universities learn programming from books either. Well, my lil’ sister just started studying CS. There are books, but they’re rather supplemental. The core material is lectures and exercise.

                                                                                                            1. 6

                                                                                                              I learned from books (and magazines) in addition to writing programs. But this was back in the mid-80s when I was in high school. The only source I had were books (and magazines [1]). No one else I knew knew anything about computers (with the exception of one friend, and he had a different computer than I did).

                                                                                                              [1] Byte magazine was one of my favorites [2]. But even the computer I had, which was not popular by any means, had at least two different magazines devoted to it, both of which covered everything from hardware to software.

                                                                                                              [2] I recall it having a series of articles about compiler construction and parsing techniques. Mid-80s Byte magazines made incredible readings. By the late 80s it had morphed into a general PC rag, but I was in college at that point.

                                                                                                              1. 2

                                                                                                                “Getting started” isn’t learning? I learned C in the early 80s with a copy of K&R in one hand, doing the exercises. Or at least it sure felt like learning. Now, I didn’t get proficient/skilled without a ton of practice and subsequent help from more experienced mentors, but that strikes me as something different.

                                                                                                                1. 1

                                                                                                                  Books are an invaluable tool for learning, but they can’t do everything. Some people are just plain bad at teaching or writing or they have other incentives for writing aside from education.

                                                                                                                  The principal point I think is that someone (maybe several people) with wider and deeper knowledge on a subject present their knowledge for you to learn from.

                                                                                                                  My first approach when I want to learn something is to read about the subject - and we also have other media too. I don’t have to stumble along, making mistakes, going down the wrong path, wasting time on irrelevant material and so on. Others have already done that before. Why wouldn’t you learn from them?

                                                                                                                  Later, once I’ve gained some knowledge, I can explore and expand, go deeper or focus on topics that are interesting or relevant. Everyone is different though and some people do benefit and thrive from a hands-on, practical approach first.

                                                                                                                  Personally, I want pointers and relevant background and guidelines from others who have studied the subject already. I don’t want to have to learn by doing all my own research up front over and over and over.

                                                                                                                  You absolutely need to reinforce that knowledge with action, experimentation, application though. I think the best approach for me is to have that practice during the teaching - relevant exercises that push a little beyond the material you’ve just covered works best for me.

                                                                                                                  1. 0

                                                                                                                    You have said exactly nothing that discounted what I said. Please don’t piggyback your “let me tell you how awesome I am and how great I think my way of doing things” drivel on my simple response. It’s really pathetic.

                                                                                                                2. 1

                                                                                                                  I don’t see what you’re getting at. Books only provide information, learning is the responsibility of the reader. I don’t think anybody’s claimed otherwise.

                                                                                                                  And it’s the same with literally everything. Nobody learns to drive by reading a book, or learns carpentry from a carpentry book, or learns advanced math by merely reading a book, etc.

                                                                                                                  Learning anything requires doing and practicing. Just reading a book or listening to a lecture isn’t going work except maybe for the most trivial things.

                                                                                                                  1. 1

                                                                                                                    “You won’t learn how to write a novel by reading Betty Azar’s grammar book.”

                                                                                                                    1. 1

                                                                                                                      I managed to learn quite a lot from books (Various books on programming languages (Java, Python, Perl, …) and others like SICP). Not that I just read the books without writhing anything or using Google, but I got quite far. The main problem is that if you get to choose you’re own “schedule”, you might keep on avoiding more boring but important topics, like in my case computer architecture.

                                                                                                                      1. 1

                                                                                                                        I learned programming from a book, which included lots of code examples, but it was back in 2002 when paper was easier than the internet.

                                                                                                                        1. 1

                                                                                                                          Now I’m actually curious, does anyone learn programming from a book?

                                                                                                                          Yes and no. I learn programming languages from books because I want to know more about the semantics than pure examples often provide.

                                                                                                                          (Grrr.. hit “post” by mistake…)

                                                                                                                          As for programming, it would be unfair to say that learning hasn’t been at least well supplemented by books. It’s certainly a lot of “learn by doing”, but there’s a good mix of learning from others’ experiences as well. It’s a stretch to say I’ve learned programming from books and at the same time it’s accurate to say my programming skills have been enhanced by them.

                                                                                                                          1. 1

                                                                                                                            I would argue the inverse, can you learn programming without “books?” Here I am using “books” to refer to references that an autodidact might employ. I don’t think they can be the sole source of an education, and should be supplemented with real experience. However, they are an important resource early on and, at least in my experience, when continuing to learn. I have been doing this for 20 years now, I am still learning to program - often from books. And while this is not universally true, I have noticed a trend that those who don’t continue to read tend toward stagnation. I can also think of counter examples on both sides of that.

                                                                                                                            1. 1

                                                                                                                              I spent a good chunk of my life in some places, esp in rural areas, without access to a computer or the Internet. I could occasionally get an IT gift from well-off relatives (often chose wrong), find outdated books on any subject in thrift stores, and get recommendations from some elitist, possibly-fake hackers at times. I had to practice programming in my head, on paper, or (on budget) the dirt. Lots of time doing stuff, screwing up, introspecting, and repeating that process. My biggest concern over time was how many bad habits I might have picked up from wrong, mental model of how things actually worked. On top of that, total waste that resulted from having no ability to check my work or get feedback on doing it right.

                                                                                                                              The habits I developed doing that are probably the reason I still do that to this day with most of the papers and articles. People occasionally are like, “Nick, did you even read the damned article or dig deep into what they said?” Yeah, I probably tried to run through it like I never had access to the actual article or time to do that. I have better excuses for it these days but it could be habitual, too. Double reinforcement. So, it’s possible old habits that worked well enough over decades are hard to ditch. I did in fact learn programming, administration, business advice, speaking, etc from a mix of books and whatever people locally seemed to know about a topic. Cheap paperbacks were all I had for a lot of things.