1. 10

    No one does “no testing”. Everyone has tests. No testing is writing hello world, shipping it and then dusting off your hands and saying “another job well done!” and going home. You don’t observe it running. People who think they have no tests but they do have manual tests are using their fragile, tired, human eyes to parse the output and think “pass!”. No one does “no testing”, there’s manual testing and automated testing.

    Some people won’t call them manual tests but once we identify it as manual, it is easier to see that automated tests just save you from running ./main (or whatever) for the rest of your life. You can add types, functions, tricks, anything novel in Blubb 2.0 … but you could have a business logic bug so you need to run it at least once. No one does “no testing” but they think they do. And so the explosion of permutation paths is too much to manually test, so you don’t do it. So then you regress or ship a bug. “Whoops!” And if you do find something, it’s back to manual testing. “That shouldn’t happen again!”. Nothing grows.

    Tests are critical and related to the entire lifecycle. But they especially pay off late in the project. Projects rarely shrink in complexity, they just pile on the features and then you declare bankruptcy. This can happen even with testing, I just think it’s a powerful ally/tool along the way.

    OP’s example of testing race conditions might resist testing. So maybe the coverage is 90%. That’s not a reason to have 0% coverage. I want to automate the things. My fragile, tired human eyes don’t want to see ./main run again.

    1. 1

      I think a lot of people confusing “testing” with complex testing frameworks and unit testing, rather than “a program to automate running ./main in different ways”.

      I like testing but care little for the whole TDD/unit testing approach. I think TDD-purists and the like have done more to turn people off from testing than anyone else, because their “one true correct way” to do things is often hard for people to implement, understand, and maintain.

    1. 33

      I’m not a huge fan of the article, but I do see the point they try to make. I’d say most tech content is badly contextualized and motivated.

      I’ll give my favourite example: Docker scale talks. The worst one (and I’ve seen a couple) was a very good talk by a Google developer on how they allocate and run seven-figure numbers of docker containers in their ecosystem. Super interesting talk, given at a conference that wanted to be “the first conference for beginner developers”. The amount of time I’ve spend in the pause to talk to people that absolutely wanted to try all that out and telling them that they are not Google was terrible. Good content though. But none of the audience would ever need to apply it, unless they are working at GCE, AWS or Azure.

      Similarly, I’ve seen a talk by Google SRE “for all audiences” that started with setting up an SRE team of at least 3 people in all major timezones. PHEW.

      My takeaway from my years in this industry is how bad this industry is at evaluating solutions and budgeting how many solutions you want to have in a product. There’s value in restraint.

      Still, all effective developers I know first reach to the internet for inspiration and are incredibly good at establishing that context by themselves.

      1. 13

        My takeaway from my years in this industry is how bad this industry is at evaluating solutions and budgeting how many solutions you want to have in a product. There’s value in restraint.

        I think this is because most of the industry never needed to manage spendings in a company. In addition, most of us didn’t get trainings or classes on this.

        You mention it’s hard to know which technologies are matching a company’s needs, but that’s also true for finance. Sometimes, spending 200k$ on prototyping is a drop in the ocean compared to the expected ROI, whereas sometimes 50$ of EC2 per day is a lot, and it’s not always easy to grasp if you never studied economics.

        Maybe that’s something that’s missing in the space, like “finance for IT teams”, that goes beyond the basic of direct ROI and depreciation.

        1. 4

          I fully agree with you there! That’s also why I don’t want to put that on individual engineers or even teams. This behaviour is rarely asked for, therefore the skill is low.

        2. 4

          As far as I can tell, the problem “at scale” is much worse (and considerably deeper) than the article can tell. It’s not just that industry is ridden with superstitious gossip; the “science” that it supposedly rests on is too. Logic, empiricism, skepticism, statistical literacy, and historical awareness all can help… but ultimately there’s no easy way out of this bad situation, because the objects of our study are themselves almost entirely artificial. Lies repeated often enough and loudly enough can indeed become truths. So can less deliberate falsehoods, and of course the many kinds of claims and assumptions which cannot easily be assigned a truth-value. It’s not a special problem unique to our special field, either; brave people in economics and the social sciences have had to face this lack of foundations for longer than “computer science” has even existed.

          Here’s a practical book and a much more theoretical one. Both are well worth reading. Good luck out there!

          1. 4

            The amount of time I’ve spend in the pause to talk to people that absolutely wanted to try all that out and telling them that they are not Google was terrible. Good content though. But none of the audience would ever need to apply it, unless they are working at GCE, AWS or Azure.

            I will never ever need to excavate the side of a mountain but I would still attend a talk about how someone built this monster:


            I feel playing thought police at a conference fits in the “ego driven content creation” we’re discussing here. Just relax and let other folks enjoy what they like.

            1. 10

              The amount of time I’ve spend in the pause to talk to people that absolutely wanted to try all that out and telling them that they are not Google was terrible. Good content though. But none of the audience would ever need to apply it, unless they are working at GCE, AWS or Azure.

              I feel playing thought police at a conference fits in the “ego driven content creation” we’re discussing here.

              You are misusing (and watering down) the term “thought police”. (You aren’t alone.)

              In George Orwell’s 1949 dystopian novel Nineteen Eighty-Four, the Thought Police (Thinkpol) are the secret police of the superstate Oceania, who discover and punish thoughtcrime, personal and political thoughts unapproved by the government. The Thinkpol use criminal psychology and omnipresent surveillance via informers, telescreens, cameras, and microphones, to search for and find, monitor and arrest all citizens of Oceania who would commit thoughtcrime in challenge to the status quo authority of the Party and the regime of Big Brother. - Wikipedia

              Engaging in open discussion – even if challenging or critical – with others at a conference is nothing close to being the “thought police”. It doesn’t match any aspect of the description above.

              1. 2

                I’d like to redub some enterprise software tutorial audio over this digging video. https://www.youtube.com/watch?v=PH-2FfFD2PU

            1. 3

              Most music on soundcloud is crap. Most art is crap. Most movies are crap. Making good stuff is hard and rare because it’s hard. There’s the hobby side of things “I made pong in vimscript” which behaves more like art. Then there’s the $job side which is more bound to the business than to the art. The point is to reduce cost or produce more (which is cost). We don’t have a ton of fundamentals (like steel or atoms) so it’s very abstract. We have benchmarks and maybe some mathematical proofs (which are usually reduced or theory). It’s very hard to tell better from worse.

              When the rules don’t work for you anymore, you’ve ascended. This isn’t a superior position. You’ve gotten off the training wheels and now you have to be more independent which is more work. You don’t need the rules. The rules have holes. Great. You still need rules and they are going to come from you I guess. Or you need to keep looking. You needed the rules as a beginner, otherwise you would repeat all of history as self discovery. I threw away an actionscript 2.0 book after hitting some really horrible code and had a similar revelation as the article. “The teacher doesn’t know everything”.

              1. 2

                I had a physical reaction to the title and then in the post, the model number of the NIC “NE2000”. “Oh no”. This blog summoned ancient memories from synapses not fired in decades, causing a stomach churn response. Some memories of being shut in a networking closet from early career days. Some memories of trying to get a Duke Nukem game to run at home. Ancient memories of worrying about future Y2K problems and now the blog shows 1920. I guess it was bound to happen. Someone put this stuff back in the box please. :D

                1. 6

                  Exclamation Points! Get them cheap here!

                  1. 3

                    Sorry! We just ran out!

                    1. 3

                      I found some half-price, they’re upside-down but for this price that shouldn’t matter¡¡¡¡¡¡¡¡¡¡¡ƖƖ¡¡¡¡Ɩ¡¡¡¡¡

                  1. 9

                    though some of my friends argue that it’s a bit of a relic of past at this point

                    LDAP is tried and true technology. It works, it’s functional and malleable and has stood the test of time.

                    It surely needs some investment to learn it, but it’s well deserved.

                    1. 3

                      Yeah. It’s old (from the 80s?). It’s well established. It’s boring. It works. It’s misunderstood. It’s niche. It’s not exciting, people don’t seek it out … it runs into you at work.

                      The tools are text based and archaic. Seems like it could be disrupted with a bit of JSON but then what’s the point? Human readable? Web technology? Oauth and others are kind of already in this space but then they are solving a different problem. What’s really interesting is the tree and how other tools try to do what it does natively. Try to make an org chart with groups and delegated access areas in a flat database (not just authentication but roles permissions (authorization). :| Pretty difficult!

                      Apache Directory Studio is a nice GUI to learn LDAP (with reinforcing success). 389 was a good server from Redhat. It’s been a long time since I’ve been submerged in it. Like anything else, it’s frustrating and stupid until it’s not.

                      I still think it could be reinvented. But then adoption. A few projects exist (virtual directories) that maybe abstract and solve it enough to make it modern-ish. Trees are pretty cool but almost unexplainable to the masses with users in their flat user table. “Why would I need that?” Hmm, maybe you don’t. Let me explain what it can do and see what you think.

                    1. 20

                      So I am in kind of a similar situation, just in regards to Python. With all the virtualenv and pip stuff, I usually give up. This is especially annoying when I want to contribute to a larger Python project, but it assumes this or that workflow. A site or a wiki that collects this frequently assumed answers would be really nice.

                      1. 7

                        +1. It seems like the preferred method for packaging software in Python changes monthly – and, of course, each open source project has their own way of doing things. Pipenv? Poetry? Good ’ol requirements.txt? Very frustrating.

                        1. 5

                          This, not just in python, is probably one of the reasons that LSP is gaining popularity. Not that I am a fan of it, but I understand that one big chunk of black-box code handling whatever environment one lands is in attractive.

                        2. 2

                          I feel like Python is high-DIY culture. There’s one way to do things but low conventions. Pretty weird. Add in a mix of domains (now with machine learning and data science), the background and needs of authors is changing. I’ve tried to bring in a minimum of quality-of-life tooling from Ruby/Go/Elixir times and found only a few laterals. Poetry for dependencies. ipdb for a REPL. Pytest for tests. asdf for switching language versions. These have worked for me but they aren’t universal answers (and they needed bespoke config and hackery to me). Every project is different. This is the problem with an older language like python who had to add in some modern tooling after the popularity explosion.

                          1. 1

                            Have you tried in Python 3? It’s got virtualenv baked in, and many projects already have their packaging decisions made.

                            That said, no doubt packaging is Python’s achilles heel.

                            However I’ve yet to encounter any sufficiently rich ecosystem that doesn’t have packaging foibles. I seem to recall Perl having a fair number of hoops to jump through to get something into CPAN, and ditto for Ruby and gems.

                          1. 2

                            This is the feeling, his journal of the learning burn. A stranger in a strange land. No one like feeling dumb. Adults hate it so much that we aren’t like kids, sponges. Adults hate it so much we can’t learn new skills unless we get past it. And with computers already making us feel dumb (yes, computer you are correct, I see, my bad [fix]) on an hourly basis, how can you even take on more toopid points?

                            I think it’s at least an energy thing. You have to find some downtime between projects. Extra energy. I don’t know how that happens personally. For me, recently, it was having time between jobs. I mean, it’s rare to just “have time” and not “make time”.

                            Or another way to look at it. The Seven Stages of the Blub Paradox.

                            1. Shock - Python 2 is EOL?!
                            2. Denial - Surely they will do an extension for security updates.
                            3. Anger - Ugh. I have to change all this stuff!
                            4. Bargaining - Maybe I can just 2to3.
                            5. Depression - Maybe I’m too old to learn Python 3. I should go into management.
                            6. Testing - What if I just start a py3 branch …
                            7. Acceptance - Hmm, f strings are pretty neat.

                            Hmm, metaphor is very strained and this is not really what burning in a new ecosystem is like. But you can imagine anything you could do in python 3 would be possible in python 2. Turning complete vs neat tricks. All languages are the same but that’s not the point. Each language has taught me something and then diminishing returns like @arp242 said. End of history illusion. This won’t be the last time you face a new ecosystem. I try to understand the world view and reason for existing. Then play around. Then look at that reason for existing again.

                            1. 12

                              I enjoyed reading this. NixOS is still surprising to me, I don’t know how to summarize my experience but I think I still need to internalize NixOS a bit. I’ve chunked it as “grub labeling” which is reductive. My distracting thought while learning about NixOS was that rolling back a database with all of its state would require downtime because “select a grub label”. Is zero downtime with a production database possible with NixOS? How can you rollback something like that? If some external volume is exempt from Nix somehow, this still breaks the use case where a postgres major version bump horks everything.

                              Anyway, my own Nix learning aside, my only distracting thought while reading this article was similar: “another example of the database killing all good ideas”. How many ideas have a footnote about the database?

                              ‡ Does not apply to database - abandon all hope

                              Random good ideas that are killed:

                              • Containers - volumes are too tricky for a business outage
                              • Backups - you didn’t do a full realistic restore / flip because your hardware is too big
                              • Configuration Management - it’s the same as backups, you rarely exercise it fully
                              • Load Balancing - the middle tier scales and deploys with grace

                              Of course I mean a relational database like mysql/postgres/etc. I know there are exceptions and shops that mitigate these things that resist. I’m not trying to enumerate the things that don’t match. My point is, the database kills good ideas. I don’t like state, this post is about not having darling state. But then we can’t easily apply it to a state server - which is what a database is.

                              1. 11

                                If I understand the article correctly, then you can just use /persist directory to store your database data and it will be safe between restarts. About updates, as you can have multiple versions of the same software running at ease in the same OS (and all managed by the package manager) then I do not see much problem there. You spawn new server, copy data from one to another and then swap the listening daemon.

                                1. 5

                                  Is zero downtime with a production database possible with NixOS?

                                  Absolutely. In fact, it’s probably easier (based on my anecdotal experience) to deploy NixOS systems that maintain zero downtime than many other distros.

                                  If NixOS made statefulness impossible, it’d be unusable for hosting most things that required a database. Instead, NixOS removes the direct ability to mutate system configuration - as opposed to user and application data. So, on a NixOS deployment, you still have your runbooks for things like database migrations and such, but those would be just baked into your system or package config as systemd units or what have you.

                                  A good example of this is how NixOS handles certbot/Let’s Encrypt - it deploys a systemd timer that takes care of managing private key generation and getting certificates - i.e. that service’s whole state in /var/lib - for you. If you change the configuration, then the deployed systemd timer changes too, but the certs and privkeys remain. Since the difference between config and data is enforced at a filesystem level, this lets you, as a sysadmin, make useful assumptions about what’s actually mutable data and what’s not.

                                1. 3

                                  I know what OP is getting at but I don’t like this. Config formats are usually a lib. Installing python is something else. They say “and then you’re done” but you aren’t done. Interpreted languages make you install a dev environment every time. Unless you are sharing on the web (no local files). Given that python’s easy_install / pip / pipenv / poetry / virtualenv / asdf / .tool-version / unresolved PEP specs … is a jungle of opinions and bit-rotting usability, how is this done? Let me ask you this: how do you install python? A cartoon fight cloud appears ;)

                                  Ruby has no better answer (although reduced) and JS has many options for installing a node runtime of a particular version and managing libraries. It’s because of a hidden cost. Interpreted languages ask you to set up a dev environment, pretend to be a developer every time. It’s why so many READMEs don’t even want to get into it. Don’t say docker. :) You could say pypy. :) But then that’s not a config file? I liked HCL the last time I used it as a library in a program.

                                  1. 3

                                    I have zero experience writing GUIs, but it seems to me that declarative UI like SwiftUI or the upcoming Jetpack Compose is the wave of the future and perhaps the best way to approach creating cross-platform GUI frameworks. It’s unfortunate that the two examples that I just mentioned are tied to macOS/iOS and Android, but perhaps they could be ported to other platforms like Mono did with C#?

                                    1. 3

                                      Jetpack looks interesting. Yeah, I hope whatever sane approach cross pollinates out to everyone. I feel like we went full web and overshot some things. If I had to make Winamp right now, I’d probably use Electron and that’s kind of crazy? It’s not really on the web but I’m using web tech.

                                      1. 1

                                        I have a lot of experience writing Windows GUIs, mostly in C# WinForms and WPF, and have tried C++/MFC a bit. The C# ones are quite nice IMO, and MFC is kind of manageable in comparison. I don’t know how much support there is on other OSes - it does seem to be more than “none” with Mono. But that kind of just confirms the author’s point. Windows and OS X both have perfectly fine GUI app development languages and environments, and they don’t really support any other OS right.

                                      1. 3

                                        I don’t think we’ve figured out the view layer yet. The view layer (for me) is when all my good habits go out the window. My view code is completely different than the “plain old code”. Components are a nice move but it doesn’t tidy up nicely for me. There’s code in the view and it’s weird. Maybe view code is not code at all. Maybe it’s a document, a result. It’s something we haven’t found the right paradigm for. Maybe it’s a database. Maybe it’s a blob. Maybe it’s a frizzlewuzzle.

                                        1. 1

                                          I quite like the approach popularised by winforms and react, where only essential-local state (like text cursor location) is held in a component, while everything else is derived from externally-set properties.

                                        1. 14

                                          It’s probably the biggest platform there is. There’s 3 billion people on Facebook, how many people online? How much force is behind web tech? A lot! Y’all already know this. :) It’s just crazy to think about.

                                          Most GUIs aren’t even called GUIs, they’re just “webapps” or “a site”. But I’m bringing this up because I think there was an interesting split. If you built a GUI before the .com boom (or whatever boom early web), you probably did it with some GUI toolkit tied to a language. Now, you can write in almost any backend language and the details are hidden from the user except for maybe a rogue /cgi-bin or .aspx in the URL. The web has many backend languages, fat GUIs have fewer. But the point is, we kind of stopped building fat desktop apps.

                                          There’s a few things we lost. We lost a layout tool like how Xcode has now, something that has alignment and quick feedback instead of save/refresh. There’s maybe some tools that have tried to get this back (rapid mockers or markup generators). But if you look at VB or iOS dev, you see that the native walled garden lets you flip back and forth. That was nice to me but of course it’s not required because if you look in the world people are building complex GUIs in web tech no problem.

                                          There’s another thing I think we lost which goes even farther back. If you wanted a GUI for a “backend thing”, say git splits. Git just punts this to the $EDITOR or an interactive prompt. The TUI. Or a curses window for other programs. I’m hoping one day we have tooling that is so good and powerful that backend people don’t feel unable to start in the ecosystem and a TUI wouldn’t even be an option, much like a mainframe screen (F1/F2..) app wouldn’t be created. I think the problem here is complexity and specialization. I don’t know if the entire problem can be simplified or generalized to even approach without dealing with the DOM or switching toolsets.

                                          Will we always have TUIs? Is text-mode always usable? Can web tech become universally useful or simple? Can we put a wall between unix CLI composition and something like curses (flags and pipes and the unix way continue to be proved)? What would this even look like? You have a CLI that takes flags and args but if you invoke without these things, it runs in interactive mode but it stays in the terminal using some magic future tech and the programmer didn’t have to step outside their backend expertise or ecosystem to get this done? I have no idea. I can’t even imagine it.

                                          1. 3

                                            If you design things carefully and minimally, you can still have that experience.

                                            Writing HTML markup isn’t quite as straightforward as VB, but it’s close enough, in my opinion.

                                            The w3m browser lets you switch to vim for editing textareas.

                                            1. 1

                                              I 100% agree with everything except for the TUI. Text is awesome, being a web developer myself, I really enjoy using git in the terminal for instance. Far more powerful than any GUI I’ve been able to use. Long live the web and the TUI.

                                            1. 7

                                              I have a youtube list called “mind blowing dev” and on the top of that list (in my mind) is a 2013 talk entitled Magic Tricks of Testing by Sandi Metz. The examples are in Ruby but it hardly has anything to do with Ruby. I’ve taken this idea from team to team from project to project and had nothing but success with it. It’s no silver bullet but oh my. I even internalized its lessons at some point but still did not completely grok it. I think I’m on my second internalizing of what she was teaching in this talk.

                                              The spaceship. Man. This changed my life. I was just thinking about this today, minutes before reading this thread.


                                              Other bits:

                                              1. Controller tests just test HTTP
                                              2. The testing pyramid by Martin Fowler
                                              3. Testing CLIs is super easy if you separate your core app from a class that handles args and invokes your core app
                                              4. Selenium is slow because it’s the wrong kind of thing. It will never be fast because it’s the wrong kind of thing.

                                              I had typed a massive response to this but I’m going to make it a blog post later.

                                              1. 1

                                                Somewhat tangential: a lot of Sandi’s talks are great. Would you mind sharing this youtube list with us?

                                                1. 2

                                                  Sure thing. https://www.youtube.com/playlist?list=PLlP6fPfZXKAZyfb0X2ZmJIBWkTLzV3mdn

                                                  I wish I could annotate each one. I think the only one I want to point out is the Google tech talk on Git where Linus asks Googlers about their subversion habits. I found this telling because the assumption that everyone in that room is probably very smart / talented and even they didn’t svn branch/merge. :)

                                                  So, not all these videos are equal in mind-blowing-ness. And a lot of them are well-known. But hopefully it’s interesting.

                                              1. 4

                                                It’s amazing how often rewrites for fun happen in our industry. If this was any other industry than programming people would be shocked.

                                                1. 30

                                                  Reading the article, it does look like they hit some performance issue, due to how the Go GC works, and they tried Rust because it was already seeing adoption at Discord. I would not call that “just for fun”.

                                                  On the other hand, a lot of things change (improve?) in our industry because we hack stuff just for fun. :)

                                                  1. 6

                                                    This happens in other industries too. Youtube is full of metalworkers/MechE’s, EE’s, chemists, woodworkers, and so on hacking their tools, twiddling with silly ideas just for fun, breaking stuff, trying out old ideas in new ways or vice versa, and so on. The only thing special about software is you can do it sitting in front a computer instead of needing a whole workshop or lab.

                                                    1. 4

                                                      It’s even codified, the car industry has time frames in which a whole car is essentially completely replaced.

                                                    2. 3

                                                      Even though rather expensive, doing a rewrite is usually not so bad in our industry than it would be in many others. Imagine replacing a bridge with a new one just because you got slightly better steel now than last year.

                                                      1. 11

                                                        Imagine building a new bridge because there was more traffic than would fit on the bridge you already have, and deciding you might as well use the new steel while you’re at it.

                                                      2. 1

                                                        What’s the equivalent of rewrites in other industries?

                                                        1. 5

                                                          Remodeling the kitchen.

                                                          1. 1

                                                            My own perspective: if software engineering is like writing then it’s a rewrite or a reimagining. If it’s math then it’s something like string theory or where a trail leads nowhere so you go back and start over from a new fundamental. I think software is mostly writing with a bit of the math in my analogies. I don’t think it’s like physical construction but sometimes I use those analogies.

                                                        1. 4

                                                          Great stuff. These are forever skills to me. You’ll learn them once and use them for life. It’d be cool to have a super, really basic overview of networking in here too. DNS, what routing is. Going into SQL might be too rabbit-hole-y. OP: Great topic! Great idea! :)

                                                          1. 3

                                                            Around 2000-2001 I was self hosting everything. I had fiber, static IP. Linux NAT router with, I think it was, ipchains? It was fun/cool and I dogfooded Linux hard which was great. And then my spinning disk died on my router box and all my roommates were mad because the internet broke. :) I continued in this pattern for a while, hosting 8-ish PHP based websites and domains. I had authoritative DNS in my house (neat). It was everything, there was no cloud, only VPSs.

                                                            I moved to small form factor PCs like the Shuttle XPC. Recently I’ve downsized quite a bit and have a preference for the Intel NUC. I run much less (custom minecraft modpacks) but still have echoes of those days around (caching DNS, DHCP as a daemon). The biggest change was the router. I went through so many commodity and even non-Best Buy SOHO routers and thought I’d say something about this. I’ve settled on an appliance directly from pfsense and it has been fantastic. I don’t run a managed switch or VLANs. I’ve just changed job roles over time and I’ve found context switching between network/sysadmin (now called ops, heh)/dev is quite a lot to deal with. I’m not sure aligning home and work is great either – leaving VLAN and network problems to come home to VLAN and network problems? Eh.

                                                            Doing a vm based lab is fun too. If you have enough memory, you can wire together long lived things to experiment. You could do the same with docker but you don’t get the install experience. I’ve blogged about how I messed around with ipv6. I don’t think there’s a docker way to do that. You can create a mini network that only a few machines can connect to. Make dns/dhcp/auth … have things connect and use that. Then just tear it down. It’s way cheaper than buying a switch or boxes. Of course you could do the same in the cloud (is this not self hosting?) but you have to watch charges, not a big deal. I remember when estimates were hard to figure out (they still are?).

                                                            There’s a lot of ideas and discussion on reddit’s homelab subreddit. I don’t really self identify as purely ops these days

                                                            1. 1

                                                              I’m running Nextcloud, Plex, mpd, Transmission, Samba and some Apache pages off a Raspberry Pi 4. I have some shell scripts I run in cron to transfer Transmission downloads to my Plex and Nextcloud directories.

                                                              1. 2

                                                                Transmission as a server? Hmm, never thought about that! So, you have some config for that client that is set up and you can just remote into it (using some auth) and then you wouldn’t have to do that config for each client. Is this correct/close? If so, neat!

                                                                1. 1

                                                                  Yeah, the transmission-daemon package can be configured to expose a browser-based interface to remotely add and manage your torrents, behind a simple HTTP auth dialog. When I’m sitting on my couch with friends and someone wants to watch something, I’ll search a torrent tracker, grab a magnet link, log into the Transmission interface and queue up the download from my phone. When the download completes, a script pushes the files to the directory Plex looks at, so the whole process is very quick. I’m working on a way to make this system redistributable because I think it’s a great use case for low-power toy computers like the Raspberry Pi.

                                                                  1. 1

                                                                    Think its always a client/server model, just depends on what client you use, gui or browser.

                                                                    From their website - web client

                                                                1. 4

                                                                  Revealing intentions. Enum, a module, a namespace, something. In Ruby, I’ve abused modules for this and it’s not super great but I’d still do it because it reads really nice.

                                                                  class User
                                                                    module Enabled; end
                                                                    module Disabled; end
                                                                    attr_reader :account_state
                                                                    def initialize
                                                                      @account_state = Enabled
                                                                    def enable!
                                                                      @account_state = Enabled
                                                                    def disable!
                                                                      @account_state = Disabled
                                                                  # main - but write tests in real world  ;)
                                                                  user = User.new
                                                                  if user.account_state == User::Enabled
                                                                    puts "User is active."
                                                                  puts user.account_state

                                                                  When you run it:

                                                                  User is active.

                                                                  You can use enums, namespaces in other languages to do the same thing. Like I said, I don’t super love this and don’t do this as a rule. But instead of using true/false when I have states, sometimes I do it like this (in non-Ruby too). And it’s dynamically typed so you need to test it which is neither a pro/con. I just don’t like the namespace ;end bit. Note that this isn’t constants because there’s no value being stored. It’s purely namespace and intention revealing. I think that’s kind of neat.

                                                                  1. 2

                                                                    Rather than module Enabled; end you could also use Enabled = Module.new.

                                                                    1. 2

                                                                      Wouldn’t :enabled and :disabled be more idiomatic Ruby?

                                                                      1. 2

                                                                        I’d say so. You could still expose the User::Enabled and User::Disabled constants with those as the values.

                                                                        The use of “sentinel modules” for values is an odd choice and I can’t see any real benefits (comparisons might even be marginally more expensive with this implementation?).

                                                                        Also worth noting that you should always consider looking at things like ActsAsStateMachine rather than hand-rolling your own, of course.

                                                                        1. 1

                                                                          Yes, that’s more common. But there’s no safety of symbols scattered everywhere (of course there’s no safety with modules scattered either). With symbols, you’d have to go find the possible/expected values but I think having the namespace has a chance of getting some editor autocomplete to work outside the file. There’s really not a guarantee which is why testing is so valued/polished. I don’t always do this module trick. I think it just reveals intention because :disabled becomes a module with a namespace like User::Disabled.

                                                                          Other languages have this stuff more formalized and checked. Pattern matching with enums is pretty great (to me).

                                                                      1. 5

                                                                        Just add “to me” to anything not measured by a sensor.

                                                                        I’m glad people have personal experiences that are ok with computers. Flask and pipenv are so close but so far away. If python succeeds in academic machine learning code, get ready to experience a singular success and culture like Rails did with Ruby. People are still trying to sell “Ruby is more than Rails”. Yeah. I mean it is but culture man. Culture. PHP isn’t wordpress. Ok, I get what you are saying but it might turn out to be a pejorative.

                                                                        Keep trying out new languages. Don’t be mono lingual. Don’t be mono culture. Python has a great stdlib, fine. I’ve had that same feeling in many other languages so it becomes less blinding. I have good and bad things to say about Python but I’ll make $0 by stating something or fighting about something so I just don’t want to deal with that right now. I’m going back to trying to get pipenv to work in Docker and CI. I had zero effort and issue getting a Go binary to ship in Docker. Them’s the trade-offs.

                                                                        1. 2

                                                                          The thing is, Python was popular before all of the ML boom happened. Ruby on the other hand, got popular mostly because of Rails. I honestly know only one Ruby project that isn’t Rails, while with Python I know a big bunch of projects in a variety of different fields.

                                                                          1. 2

                                                                            Python has been through several waves of success in particular domains. When I first learned it lo these many years ago, Python was big mostly as the “readable” scripting language for sysadmin types. Then web stuff took off and that became the biggest part of the Python community. Then scientific computing took off and became a huge thing in the Python world. Then ML/AI stuff took off and is now the hot reason everyone wants to learn Python.

                                                                            I wonder what thing will be the hot reason to learn/use Python five years from now.