1. 9

    Interestingly noone seems to bring up these valid arguments when discussing E-Mail. It’s the same distribution model, but either everyone deems it to be a lost cause or does not know/care.

    All these federated social media discussions can be dehyped if you explain it like you’d explain e-mail…

    1. 6

      This article is specifically about privacy. E-mail is well-known to have very poor privacy, to that point that it is often singled out by privacy-related regulatory schemes (like HIPAA) which require additional privacy-protecting measures (like user-level encryption). And email’s privacy weaknesses are the same as those pointed out by the author of this article: you must trust the operators of the federated nodes, and in a federated environment you may not even know all of the nodes you are trusting.

      1. 1

        you can just do e2e encryption (like xmpp or matrix do).

        1. 1

          E2E encryption is only part of the story. You also need to solve the metadata problem, which is where Cwtch comes in.

      2. 4

        There are also federated platforms that provide decent privacy. Matrix supports E2E encrypted messaging so the server only knows who you talk to and not the contents of the messages. The only system I have seen that obfuscates the receiver is bitmessage which works by sending your message to everyone and everyone tries to decrypt it to see if it was sent to them.

        1. 2

          It’s not completely one-to-one (at least, with modern email systems, as opposed to getting local unix mail federated on whatever machine you have a shell on thirty years ago), since there’s no sense of users on the local node being closer than users on a remote node anymore. A better match would be usenet, since the number of hops matters more.

          (Of course, if you don’t look at the local timeline, the fediverse doesn’t have much to do with locality except in terms of general visibility of remote hosts, which you as an unprivileged user have near-total control over.)

        1. 3

          Step 1: You have a problem
          Step 2: You introduce a blockchain to solve problem
          Step 3: You now have an incentives problem, a trust distribution problem, a regulation problem, a speculation problem, an upgrade path problem…
          @SarahJamieLewis

          1. 8

            Contrary to most opinions I think that acquisition might be a good thing:

            • Microsoft is a different company now their open source strategy recently is quite good.
            • Github seems in decline for some time, the inability to lock a permanent CEO, low number of new features
            • MS has all the resources to put Github on the next level if they don’t screw it up.

            What could be bad is if MS buys Gitlab, then they would control that space. Gitlab is also a heavily VC backed so investors will seek for an exit at some point.

            1. 10

              Honestly, my hope is that the fear factor of this, convinces more people to consider alternatives.

              I’ve setup gitlab (a few years ago) for a client, and it was a fucking pig. I’ve looked at your solution too, and wasn’t completely sold on some aspects of it (sorry, dont remember what right now) - but these things obviously work for some people, and getting out of this mindset that “GitHub is just what all developer use” is crucial to me.

              Monoculture should scare people a lot more than the boogey man from Redmond.

              This line from the Bloomberg article sums up the issue:

              San Francisco-based GitHub is an essential tool for coders.

              This is honestly like claiming “Windows is essential for technology companies”.

              1. 13

                Microsoft is a different company now their open source strategy recently is quite good.

                I’m getting awfully tired of people saying there’s nothing to worry about because they’ve been nicer for the past handful of years. They have been antagonistic to free software for decades.

                Microsoft changed their tune because it became profitable to do so. If it becomes profitable to be dicks again, they will be dicks again.

                I’m glad we have a kinder, gentler Microsoft. Don’t kid yourself about their motivations.

                1. 10

                  Also good to remember: they still routinely attack Linux and related free software by threatening with their patents, and extract patent royalties from many terrified companies who use Linux

                  1. 4

                    They’ve collected over a billion dollars on Android alone.

                  2. 1

                    I never said to not worry about. I’m writing this based on a feeling MSFT will do good with Github. Time will show, and their motivation is quite simple, buy more power and make more money.

                  3. 1

                    That would be very cool that as @nickpsecurity mentioned, RedHat take a shot at gitlab.

                    1. 3

                      Given the high performance has for on-premise installations, that would be a great addition for RedHat, TBH.

                      (I see GitLab, even paid, everywhere at clients and I have yet to see a GH Enterprise installation in the wild)

                      1. 3

                        Riot games had GH enterprise a few years ago, just for their web team. The rest of the company was using perforce.

                        1. 2

                          I’ve got the opposite experience. I’m seeing big installations/companies use GHE all the time, and none of them Gitlab.

                    1. 4

                      Boy this seems like just about the perfect use-case for XML

                      1. 8

                        Let’s not go there, because if we bring up XML, then somebody will mention DocBook XML. Once that happens, it’s only a matter of time before somebody else suggests SGML, and nobody gets paid enough to mess around with SGML.

                        JSON is fine.

                      1. 1

                        I don’t understand the timing of this at all. So they’re set to release a new flagship desktop machine one year before introducing a new chip architecture? Doesn’t that mean the upcoming desktops will become instantly obsolete?

                        1. 5

                          Whitelisting and automatic VPN connection can be achieved with Apple profiles. See for example how algo does it

                          1. 1

                            Yep, I use Algo to set up an IPSec VPN. It generates macOS and iOS configs which can be configured to automatically connect, with SSID exclusions e.g. for home and work.

                            Before Algo I used Streisand, and had to go through similar trickery as the OP to make it auto reconnect. When I saw the Algo way I realised that it’s both simple and pretty smart.

                            (Caveat: I don’t know if Algo generates similar auto connect setups for non-Apple OSes.)

                          1. 6

                            This isn’t news to anybody who has to be involved with Node.js development. This is also an NPM issue, not a Node.js issue, despite how tightly coupled they are. There’s alternative package managers out there (Yarn) that try and solve these problems.

                            1. 21

                              Do the alternate package managers use an alternate package repo?

                              An “ecosystem” that encourages and embraces “modules” to check if a number is even, and then another one to check if a number is odd, needs more than a different CLI tool to download the same shit code.

                              1. 2

                                I don’t disagree with that last statement of yours at all. I’m just saying Node.js isn’t really the problem in and of itself, and there’s people in the Node.js world who are actively looking for better solutions to these problems.

                                And to be fair, its not really shit code, its just run of the mill average code.

                                1. 12

                                  I’d argue that it is shit code. Shit doesn’t mean its faulty. Good code is both functional and uncomplicated.

                                  The isEven/isOdd shit is deliberately written to use a bitwise operation which makes it a lot less obvious what it’s doing, for this reasoning:

                                  everyone knows the i % 2 === 0 solution, I was trying to have fun with bitwise operators

                                  And frankly, JavaScript itself is part of the problem - “is-number” has 10 million downloads for the last 7 days.

                                  1. 2

                                    This microoptimization is silly because JavaScript runtimes recognize modulus by a power of 2 and change the generated code accordingly.

                                    The V8 code to do this is here.
                                    The ChakraCore code for this is here, search for isModByPowerOf2.
                                    SpiderMonkey appears to do something similar but the code is harder to track down.

                                    1. 1

                                      You raise a good point. In that module’s repo, there’s a comment that reads:

                                      Since it is ending up as a dependency of things like Webpack now (insane as that is), I would hope it would actually behave as expected given the name.

                                2. 3

                                  Yarn is an alternative dependency resolver, but it uses the exact same package ecosystem as NPM.

                                1. 3

                                  I just recently set up an etcd cluster at work. Literally everything about etcd is a footgun, so this comes as no surprise.

                                  It’s a nice DB once it’s actually up and working though.

                                  1. 1

                                    How do you mean? I’ve very limited experience, but it beat the shit out of Zookeeper last I used it on almost every metric.

                                    1. 4

                                      Maybe I was doing it wrong, but I spent a considerable amount of time searching for documentation, so it wasn’t for lack of trying.

                                      1. They made breaking API changes between v2 -> v3, and tons of Google hits for etcd gives you wrong information.

                                      2. The bootstrap process just sucks. SRV records didn’t propagate fast enough, so the cluster bootstrap failed with DNS discovery. Connections to the discovery service frequently timeout, so that caused constant bootstrap failures. Doing it by hand was the only thing that worked and I had everything else perfectly scripted with Terraform so that felt icky.

                                      3. Managing cluster membership also seems to be entirely manual. I really wish more of this thing could be automated.

                                      Perhaps if I were willing to spend another couple months on it I could figure out how to bootstrap a cluster with no manual input, but it wasn’t worth the time.

                                      But now that the thing is actually online and working it’s pretty nice.

                                  1. 10

                                    I’ve been a member of SO since public beta, and have just under 30K rep.

                                    My experience is considerably different. Looking through my deleted items, the ones that weren’t deleted by myself were deleted because the enclosing Q was deleted, and I agreed with every deletion I looked at.

                                    1. 3

                                      Depends on how you use it, and whether you are lucky enough to always take the discussions that are too complex or novel for StackOverflow off the platform right away, or not make them there in the first place. (E.g., effectively, depends on how much trust you put into the platform.)

                                      As I mentioned on reddit, most of the stuff that got deleted for me are actually my own questions, quite disproportionately, where I’ve spent considerate time on doing the research, and where the answer is non-obvious.

                                      If your question doesn’t meet metrics, the StackOverflow company will automatically remove it without any human intervention whatsoever, and block your own access from it, until/unless you have 10k. Is that really fair, after you’ve spent several hours doing the research and formulating a clear-enough question, which is so clear noone has even bothered to provide an incomplete and misunderstood answer for it? There’s really no reason for this.

                                      The toxic part is that when you bring up these kinds of things on meta, they school you into not posting questions that “don’t belong” in the first place, and your meta questions themselves quickly gain -15 downvotes (not -15 rep, but -15 actual downvotes, within a day or two), and get automatically deleted promptly, so, the next person wouldn’t even have anything to refer to (and neither will you have the text in case you wanted to repost elsewhere).

                                      1. 1

                                        If your question doesn’t meet metrics, the StackOverflow company will automatically remove it without any human intervention whatsoever, and block your own access from it, until/unless you have 10k.

                                        I have no idea what you are talking about. Can you elaborate on this?

                                        1. 1

                                          Go to /help/privileges, then the 10k link on StackOverflow to /help/privileges/moderator-tools has the following text:

                                          SO: You also have a new search operator available to find your own deleted posts: deleted:1.

                                          The reddit discussion has a link to the criteria for automatic deletion; in my case, the following seems to have been triggered a number of times:

                                          SO: The system will automatically delete unlocked, unanswered questions on main (non-meta) sites with score of zero (or one, if the owner is deleted), fewer than 1.5 views per day on average, and fewer than two comments that are at least 365 days old. (RemoveAbandonedQuestions)

                                          Basically, when you make that comment that the question is useless, you’re making sure it wouldn’t actually be deleted, unlike a question that’s simply ahead of its time. Duh!

                                      2. 2

                                        I still don’t understand how I’m supposed to get ‘rep’ to upvote something, and I’ve never had the time to understand their internet points system to do so. I’ve been ‘using’ stackoverflow since it came out to beat expertsexchange and usenet, etc. But yea I probably have like 1 rep. I understand why they hold voting, but it always makes me sad when I want to upvote a good answer or downvote a terribly wrong one and I can’t. No idea what the route is from user to community member and no desire to read up on it… which maybe makes me not a community member. :)

                                        1. 8

                                          It’s as simple as just asking and answering questions. I think just asking a single question and accepting an answer gets you enough rep to vote.

                                          1. 6

                                            I also have had semi-decent (if small) success editing questions for clarity. It got me far enough to get upvote/downvote privileges.

                                            1. 3

                                              They require a minimum of 15 rep to upvote, and 125 to downvote, see /help/privileges on each of their sites.

                                              Getting 15 rep is, like, really easy — you get 5 rep when your question gets +1, and 10 rep when your answer gets +1. Basically, all it takes is a single question and answer that someone does a +1 for, and you can upvote. (And you can even ask and answer your own question.)

                                              1. 1

                                                Interesting about that last one, knowing that that might’ve added 10-100 questions to stack overflow, if I’d taken the time to do it. Good to know. I think I have a complex about asking questions online in asynchronous forums. Chances are if I don’t know the answer, I’d rather keep looking than take the time to write it down somewhere and then wait. I’ll usually jump on IRC (or slack or discord these days) if the question is so pressing. I’d have to be in really dire straits to post and wait, it would feel almost like praying for an answer. :) (even tho 9 times out of 10 once I’ve worded the question I’m closer to a solution anyway… like I said I have a complex)

                                                1. 3

                                                  You assume that it takes time to get an answer on StackOverflow. IME, very often for the more popular topics, the answer often appears right away within a couple of minutes. Folks race each other to answer first. :-)

                                                  (Of course, it highly depends on the tag.)

                                                  1. 2

                                                    the answer often appears right away within a couple of minutes.

                                                    Only if your question is something every mildly experienced programmer would know. As soon as you start asking things a little harder than you are often left without an answer.

                                                    1. 1

                                                      Yeah I think I was molded in the era of web 1.0 responsiveness (think perl monks) and it’s probably cost me a bit. Not to mention whatever the false bravado/fear of showing ignorance that leads me to not ask enough questions in general.

                                                      Duly noted though, thanks!

                                            1. 2

                                              I Force Quit apps because they are bad, not for vague reasons like this.

                                              If I let Audible run with a sleep timer, the next time I use it the audio stutters until I FQ.

                                              Sometimes the Facebook app stops being able to access the Internet until a FQ.

                                              Sometimes Twitter forgets to give me a back button to go back to the main feed (thankfully haven’t seen this one recently)

                                              1. 1

                                                Yeah, I use it as a troubleshooting step or to ensure Internet access is disabled. Certain apps, like Amazon or FB will almost always get a force close from me because I also use them infrequently.

                                              1. 13

                                                A good candidate for our new performance tag!

                                                Thanks for the good writeup @schneems…it shows one of the reasons I’m a little weary of ORMs and other interfaces to SQL that have a lot of magic. Very easy to shoot self in foot performance-wise.

                                                1. 11

                                                  Yay performance tag!

                                                  I’m on the fence with ORMs. On one hand they do stuff like this that doesn’t make any sense (doing the validation even when fields aren’t changed). On the other hand they help me catch a bunch of other common mistakes, like SQL injection.

                                                  Having this mistake originate from the ORM instead of my own custom written SQL actually means I can potentially fix this for everyone who uses that lib, instead of just for myself. Changing the validation code to not fire when those fields aren’t changed would be good. Better would be having the validation code assert that there is a constraint in postgres.

                                                  1. 6

                                                    Yep. Just because I’m weary of them doesn’t mean I don’t support their use where it makes sense. :)

                                                    Ecto over in Elixir seems to have struck a good balance between “magic” and “more magic”.

                                                    1. 6

                                                      On the other hand they help me catch a bunch of other common mistakes, like SQL injection.

                                                      Systems like Yesql or HugSQL also prevent SQL injections while providing a nice API for the user without having a difficult to predict ORM system under the hood. I’ve grown to like that approach quite a bit.

                                                      1. 1

                                                        I love mybatis approach which allow sql template which looks similar to hugsql

                                                      2. 5

                                                        ORMs cause these issues for sure, but they still crop up when you write raw SQL. It’s always important to monitor your query workload for slow queries. ORMs may not be perfect, but people aren’t either. Nice work actually profiling your database usage, I wish more people would!

                                                        Also, you’ve duplicated an index key. Index prefixes work just as well as individual indexes, so you don’t need (name, user_name) and (name). Removing that extra index will speed up inserts.

                                                        Also also, now that you have your new index, that Rails count validation will run much faster as long as you remove the case_sensitive: false from your validation. Since you add lowercase to before_validation, the index will still get used. Without it, you have to catch the Rails RecordNotUnique exception as described here under concurrency and integrity. Though if you read, you’ll see why you should catch it with or without the model-provided validation. If you’re feeling fancy you can add a record error like the active record uniqueness validation, which will let you use the validation error in the same you would use any other.

                                                        Unfortunately you’ll only be able to handle one attribute in this way. If you have multiple uniqueness constraints there isn’t a way to tell which constraint was violated with Rails. Postgres adds an extended error field with the constraint name, but unfortunately the Ruby PG library never uses it, or you’d see a call to PQresultErrorField with PG_DIAG_CONSTRAINT_NAME when the sqlstate indicates a unique_violation error.

                                                        Even if PG did return that extended information, Rails throws away any extra information when it converts to RecordNotUnique and just returns the normal error message text.

                                                        Adding back the validation—while keeping the unique index as a safety net and performance optimization—will show the normal pretty error message instead of throwing a uniqueness exception. In my opinion, as long as the validation isn’t slow anymore, it’s worth keeping it for the pretty error message. It also lets you have a bunch of uniqueness validations and other constraints, and Rails will display the correct error messages for each of them. Very very occasionally the validations might race and result in that RecordNotUnique exception being thrown at a user, but I personally don’t think that’s worth fixing.

                                                        1. 3

                                                          Regarding unnecessary indexes: I recommend you give my open source tool a try. active_record_doctor identify database performance issues before they hit production.

                                                          @schneems, your story inspired me to add a check for an expression index when a case-insensitive validation is used. Adding to my to-do list :-)

                                                          1. 2

                                                            I think you accidentally linked to this thread instead of your project: https://github.com/gregnavis/active_record_doctor

                                                            1. 1

                                                              Good catch. Thank you!

                                                        2. 4

                                                          You can, and at a bare minimum should, prevent SQL injection by use of parameterized queries.

                                                        3. 6

                                                          it shows one of the reasons I’m a little weary of ORMs and other interfaces to SQL that have a lot of magic. Very easy to shoot self in foot performance-wise.

                                                          The danger of not using ORMs tough, is that at some point, you will map data to domain objects and you want structure and… suddenly, you’ve got your own ORMs.

                                                          That being said, I prefer systems that have a strict boundary between the domain model layer and the query layer and a rather explicit mapping phase. Which means that I’m not a huge fan of ActiveRecord.

                                                          1. 1

                                                            I’d go so far as to say that the domain model mapping and the query interface should be entirely independent systems.

                                                            1. 1

                                                              For any larger system, yes, but for quick and dirty work, I like things that at least have some knowledge about each other to derive good defaults.

                                                          2. 1

                                                            IMHO it’s less about ORMs but more about ORMs that try to hide SQL from you.

                                                            1. 1

                                                              This is less about the weaknesses of ORMs in general, and more about a particular feature of ActiveRecord, validates :uniqueness, that frankly shouldn’t be used at all. Its weakness to race conditions is enough reason to argue for its removal from the framework. Uniqueness constraints of any sort need to be done in the DB layer.

                                                            1. 1

                                                              Please tell me there is some kind of transport encryption involved here

                                                              1. [Comment removed by author]

                                                                1. 1

                                                                  I can’t get behind shipping logfiles in plaintext over the wire. There can be sensitive information in there.

                                                                  At least on the consumption side you provide TLS and a random url.

                                                                  1. 3

                                                                    The idea was for Seashells in its current form to be used for non-sensitive information (and the random URL added a small amount of security).

                                                                    So there’s no encryption in v0.1 (well, there’s HTTPS when viewing…).

                                                                    I’m implementing encryption in v0.2. The current plan is TLS + password-based client-side encryption (encrypted by the open-source seashells tool and decrypted in Javascript in the viewer’s browser)

                                                              1. 5

                                                                I think DHH probably opened himself up to criticisms like this by choosing really terrible example use-cases. Just as with the default_scope considered harmful conventional wisdom, these points are true in the general case but there are situations where it is legitimately a good choice.

                                                                Let’s ignore DHH’s sloppy use-case presentation and look deeper.

                                                                One of the points against thread-local variables is:

                                                                Not cleaning up thread-locals might be an issue if your framework reuses threads

                                                                Let’s look at the very first sentence of the documentation:

                                                                Abstract super class that provides a thread-isolated attributes singleton, which resets automatically before and after [each] request.

                                                                Why bring up this criticism of the thread-local pattern when this class was specifically designed to solve it?

                                                                This combined with the fact that his quotation includes the Law of Demeter, which he immediately reiterates as if it weren’t there, suggests to me that perhaps this post was put together in haste without very much thought.

                                                                Now to the meat of his argument: that a per-request setting is best done within the controller.

                                                                A better implementation would be a current_user method which evaluates its find when it is called. You’ll see this pattern in a lot of Rails applications.

                                                                def current_user
                                                                  @current_user ||= User.find(cookies.signed[:user_id])
                                                                end
                                                                

                                                                The entire point of doing this is for situations where a simple helper method wouldn’t work. Ryan got sidetracked by bad examples, but failed to consider situations where this would be useful.

                                                                Here, DHH is implicitly linking the message’s creator to the Current.user by using the default option on belongs_to. I believe that this violates the MVC layer abstraction. The Current.user is just “magically” available in the model, with absolutely no context of how it got there in the first place.

                                                                Yes, explicit assignment of a relationship is preferable – except when it isn’t. Consider:

                                                                Depending on developers to remember to explicitly include this information defeats the purpose. This is where global, per-request state is necessary. And having a well-defined place to do it, that automatically takes care of clearing data after the request, is a welcome addition.

                                                                One point that Ryan fails to address is: when developers run into a situation where some form of global state is necessary, they frequently implement it in a way that is not thread-safe. In fact thread-safety is kind of tricky in Ruby. Global state should be avoided if possible, but when you need it it should be done safely. That is why this exists. In fact, this is explicitly stated in the docs:

                                                                A word of caution: It’s easy to overdo a global singleton like Current and tangle your model as a result. Current should only be used for a few, top-level globals, like account, user, and request details. The attributes stuck in Current should be used by more or less all actions on all requests. If you start sticking controller-specific attributes in there, you’re going to create a mess.

                                                                1. 2
                                                                  • An auditing framework such as paper_trail that records who initiated changes
                                                                  • A multitenancy system that isolates data through scoping

                                                                  But this is neither :)

                                                                  This is where global, per-request state is necessary

                                                                  Doesn’t that sound kind of contradictory? Global vs Request.

                                                                  Even if you make it global, we’re talking about data that’s specific to the request being handled. Why not just add it into the request object instead? I’m not familiar with Rails, but don’t web frameworks generally have something like that?

                                                                  The paper trail and multi-tenancy stuff could be handled with something like Python’s WSGI middleware, or Java’s Servlet Filters, right? Something that can modify a request before it gets handled by the application code.

                                                                  There’s no need for global state in those cases.

                                                                  And having a well-defined place to do it, that automatically takes care of clearing data after the request, is a welcome addition.

                                                                  Automatic clearing of data is only a benefit if there’s data that needs to be cleared. In other words, it’s not a real benefit when you can just not use global state.

                                                                  1. 1

                                                                    But this is neither :)

                                                                    This is a building block to aid the in development of such features.

                                                                    Doesn’t that sound kind of contradictory? Global vs Request.

                                                                    A “global” object in Ruby doesn’t seem to mean the same thing as how you are using it. In a forking server, the global environment is created specifically to service a request, and then destroyed. In a threaded server the environment survives, but you would never want state to survive between requests. The only global state that is remotely safe to use is short-lived, and destroyed after the request is finished.

                                                                    Even if you make it global, we’re talking about data that’s specific to the request being handled. Why not just add it into the request object instead? I’m not familiar with Rails, but don’t web frameworks generally have something like that?

                                                                    The request object is only accessible to code executing in the controller. Code that can access the request object has no need of global state like this, and should be using a helper method like TFA suggests.

                                                                    The paper trail and multi-tenancy stuff could be handled with something like Python’s WSGI middleware, or Java’s Servlet Filters, right? Something that can modify a request before it gets handled by the application code.

                                                                    That’s precisely how it already does work, but you still have to store that value somewhere. This is simply providing a place to put it that is safely reset before/after each request, and stores its data in a thread-safe manner.

                                                                    There’s no need for global state in those cases.

                                                                    I think this essentially exists solely because of how ActiveRecord callbacks work. They execute outside the context of the code that invokes them, and have no knowledge of the request state.

                                                                    1. 1

                                                                      I think this essentially exists solely because of how ActiveRecord callbacks work. They execute outside the context of the code that invokes them, and have no knowledge of the request state.

                                                                      That sounds like an underlying problem. But it seems I don’t know enough about Rails to really comment further, so let’s leave it at that.

                                                                1. 2

                                                                  So I think I just comprehended something about Redux/Vuex and the like: They are the front-end version of a time series (see below) database, but without persistence, and in JS rather than on server side tech, and they proxy in front of actually persistent stores. That’s why they are singletons in the vast majority of cases (because the last thing a JS frontend needs is to be running a consensus protocol between the different components).

                                                                  Is that a fair basic understanding?

                                                                  1. 2

                                                                    I don’t think so. A TSDB is all about saving the history of changes over time. Systems like Redux or Vuex are about providing a structured way to mutate state in an asynchronous system. So at the end of it all, you will only have one version of the state.

                                                                    1. 2

                                                                      Well, in order to enable time-travel debugging would require something akin to a time-series database (even if it’s just a array of functions that can be moved back/forth). Thanks for pointing that out.

                                                                      The core thing that seemed interesting is that Redux/Vuex are tackling a similar problem to a database server. In a sense, both bits of tech are tackling similar problems: managing state when talking to multiple other pieces of code.

                                                                      The reason that seems interesting to me is that it sheds light on a few things that never quite made sense. If you think of them as something akin to an in-memory SQLite/REDIS, then mutations become your API into said data store, and the state in question has a schema of sorts. And since that API is likely to be smaller than the sum total of code accessing it, that means that you have less code to look over when trying to deal with state change bugs.

                                                                      I apologize if I’m stating the blindly obvious, but the comparisons here seem to be a way that one could relate the terminology in a way this currently server side focused dev groks a bit better.

                                                                      1. 1

                                                                        Redux becomes an Event Log system with time travelling, event filtering and replaying, etc. when you plug the redux devtools to it. It is very useful in development.

                                                                        Otherwise it is (as you said) about providing a structured way to mutate state and keep a consistent view to it.

                                                                    1. 2

                                                                      If you sit down and spend 15 min you can get started using vim just as well as you’d use leafpad. The main things you need to know to get started is how to enter insert mode (i), how to get to command mode (esc), and how to save and exit. (x)

                                                                      It does take longer to do more advanced things, but most of those advanced things are not even available in other more simple editors, so its not like you are suddenly way behind a nano user.

                                                                      1. 2

                                                                        Hahaha I’ve been using vim for years and have been typing :wq all this time.

                                                                        1. 2

                                                                          ZZ is probably the fastest way, if you haven’t used that.

                                                                        2. 1

                                                                          I think you mean :x<cr> :P

                                                                        1. 1

                                                                          Enforcing no return values from a Command object is kind of ridiculous, there’s no harm in that. If you are doing an operation that changes the state of something, you’ll often want to return the updated thing.

                                                                          1. 1

                                                                            But that’s the point - you often want it but not always. So just ask for it if you want it.

                                                                            1. 2

                                                                              Those semantics can be quite confusing in a concurrent program. What if someone changes the object between me doing my thing and asking for the thing?

                                                                          1. 2

                                                                            Glenn Vanderburg gave a great talk about this at LoneStarRuby 2010

                                                                            https://www.youtube.com/watch?v=_EWUeZoyB0k

                                                                            1. 18

                                                                              It confirms what I knew all along

                                                                              “Someone agreed with me!”

                                                                              I’ve been writing web applications for over a decade and it’s utterly shocking how little JavaScript I know!

                                                                              This quote says more than I really feel like writing about this post.

                                                                              I like coding in JS and nobody had to trick me or talk me into it. Then again, I started using JS in the 90s. I’ve actually heard more trash talk about JS than any other language by far over the years, even PHP, from people of every possible background. The people who complain the most are people who don’t understand what prototypal inheritance even is, or people who think JS is not object-oriented because it does it differently than their language of choice. It’s pretty ridiculous.

                                                                              I’m not a JS evangelist. I don’t really care what you use, and I’ll use whatever the hell is around. But to say people who like using JS are somehow sheep or suffering from Stockholm Syndrome is absurd and just plain stupid.

                                                                              If you don’t like JS, don’t use it. If you like it, use it. Seems pretty simple to me.

                                                                              1. 4

                                                                                I try to be as actively ignorant of JavaScript as possible, not because I dislike the language but because everywhere I’ve worked the JS people all did frontend and I really don’t like writing CSS :(

                                                                                1. [Comment removed by author]

                                                                                  1. 3

                                                                                    Today JavaScript is essentially on-par with Python, Ruby, or any interpreted language, even better with types when using TypeScript.

                                                                                    …are you serious? Yes, JS is significantly better than where it was just a few years ago, but it has a long way to go before it’s comparable to Ruby or Python.

                                                                                    Try writing something nontrivial that relates to Timezones in JS without wishing for the sweet relief of death, for instance.

                                                                                  2. 1

                                                                                    There are only two kinds of languages: the ones people complain about and the ones nobody uses. –Bjarne Stroustrup

                                                                                    1. 1

                                                                                      Ugh, ditto. I find the hard problems in JS are actually hard problems in any language. Building a UI is my weakness, but I enjoy working with Vue.js, while I honestly can’t wrap my head around Cocoa. To each their own.

                                                                                      It’s like the real sheep thing to do is bash X and Y, and heavy handidly telling people to switch.

                                                                                      (Alluding at the Rust discussion here too, though I love Rust.)

                                                                                    1. 2

                                                                                      The only games that have ever held my attention long enough to play for an appreciable amount of time (MMO Skinner Boxes excepted) are the ones with great stories.

                                                                                      1. 5

                                                                                        I like ones with short yet emergent stories - like Faster Than Light. You start to care about your own people and want them to survive. You really feel regret when one gets eaten by a randomly generated mutant spider attack you could have avoided :)

                                                                                        1. 3

                                                                                          I tried to like FTL, but it’s too random (and capriciously so). Every star: do the thing? No -> you’ll never gather enough loot to win. Yes -> 50/50 get some loot or random crew dies. The only choice is to pick yes and hope for the best. The game basically reduces to flip a coin 30 times and win if you get heads more than 20. I ended up not caring at all about crew because the mutant spiders can’t actually be avoided.

                                                                                          1. 1

                                                                                            Side note, the only game I actually liked recently since FTL was factorio, which has essentially no story at all.

                                                                                            Debugging a factory in that game gives such a different experience to how we normally do software debugging it made me think there must be something to be take away from that and put into regular development.

                                                                                      1. 6

                                                                                        This article feels like it’s rationalizing trading window.{{library}} for context.{{library}}. In the end, we avoid both scenarios as they’re polluting a namespace without being explicitly used in the file. After 20 different dependencies, it gets unwieldy and can lead to unnecessary conflicts.

                                                                                        Instead, we prefer per-file requires/includes (which are mentioned in the article then handwavingly dismissed) as it keeps everything explicit. In the case of removing a common dependency across many files, linters will typically complain about unused dependencies and git grep/sed are our friends. In my experience, this rarely is an issue although sometimes I would wish for a custom DSL in tests (which I’ve since learned to do pre-emptively)

                                                                                        1. 1

                                                                                          This is like the “monkey-patch everything onto jQuery.prototype even if it doesn’t have anything to do with jQuery” fever that only recently broke.