1. 5

    Unlike SMTP I never really bothered to look how IMAP works and simply assumed it’s quite ok, since it was much better (from my end-user experience) than pop. A few years back I read My email made me miserable. So I decided to build my own email app from scratch and was really surprised.

    I also remember friends from emclient talking about really crappy implementations of many servers (like giving you dates in really weird formats and many other quirks).

    I guess some new protocol would be really nice then.

    As for other proposed functionalities like contacts, calendars, todos… it’s not that easy either. Yes, more efficient syncing would be nice, but there are more pressing problems. Have you ever tried syncing contacts across platforms and get consistent results? Every platform has slightly different data models for these things and not always reliably compatible. I’m not sure new protocol itself will fix this.

    1. 6

      I think the faulty assumption is that the happiness of users and developers is more important to the corporate bottom line than full control over the ecosystem.

      Linux distributions have shown for a decade that providing a system for reliable software distribution while retaining full user control works very well.

      Both Microsoft and Apple kept the first part, but dropped the second part. Allowing users to install software not sanctioned by them is a legacy feature that is removed – slowly to not cause too much uproar from users.

      Compare it to the time when Windows started “phoning home” with XP … today it’s completely accepted that it happens. The same thing will happen with software distributed outside of Microsoft’s/Apple’s sanctioned channels. (It indeed has already happened on their mobile OSes.)

      1. 8

        As a long-time Linux user and believer in the four freedoms, I find it hard to accept that Linux distributions demonstrate “providing a system for reliable software distribution while retaining full user control works very well”. Linux distros seems to work well for enthusiasts and places with dedicated support staff, but we are still at least a century away from the year of Linux on the desktop. Even many developers (who probably have some overlap with the enthusiast community) have chosen Macs with unreliable software distribution like Homebrew and incomplete user control.

        1. 2

          I agree with you that Linux is still far away from the year of Linux on the desktop, but I think it is not related to the way Linux deals with software distribution.

          There are other, bigger issues with Linux that need to be addressed.

          In the end, the biggest impact on adoption would be some game studios releasing their AAA title as a Linux-exclusive. That’s highly unlikely, but I think it illustrates well that many of the factors of Linux’ success on the desktop hinge on external factors which are outside of the control of users and contributors.

          1. 2

            All the devs I know that use mac use linux in some virtualisation options instead of homebrew for work. Obviously thats not scientific study by any means.

            1. 8

              I’ll be your counter example. Homebrew is a great system, it’s not unreliable at all. I run everything on my Mac when I can, which is pretty much everything except commercial Linux-only vendor software. It all works just as well, and sometimes better, so why bother with the overhead and inconvenience of a VM? Seriously, why would you do that? It’s nonsense.

              1. 4

                Maybe a VM makes sense if you have very specific wishes. But really, macOS is an excellent UNIX and for most development you won’t notice much difference. Think Go, Java, Python, Ruby work. Millions of developers probably write on macOS and deploy on Linux. I’ve been doing this for a long time and ‘oh this needs a Linux specific exception’ is a rarity.

                1. 4

                  you won’t notice much difference.

                  Some time ago I was very surprised that hfs is not case sensitive (by default). Due to a bad letter-case in an import my script would fail on linux (production), but worked on mac. Took me about 30 minutes to figure this out :)

                  1. 3

                    You can make a case sensitive code partition. And now with APFS, partitions are continuously variable size so you won’t have to deal with choosing how much goes to code vs system.

                    1. 1

                      A case sensitive HFS+ slice on a disk image file is a good solution too.

                    2. 2

                      Have fun checking out a git repo that has Foo and foo in it :)

                      1. 2

                        It was bad when microsoft did it in VB, and it’s bad when apple does it in their filesystem lol.

                    3. 2

                      Yeah definitely. And I’ve found that accommodating two platforms where necessary makes my projects more robust and forces me to hard code less stuff. E.g. using pkg-config instead of yolocoding path literals into the build. When we switched Linux distros at work, all the packages that worked on MacOS and Linux worked great, and the Linux only ones all had to be fixed for the new distro. 🙄

                    4. 2

                      I did it for awhile because I dislike the Mac UI a lot but needed to run it for some work things. Running in a full screen VM wasn’t that bad. Running native is better, but virtualization is pretty first class at this point. It was actually convenient in a few ways too. I had to give my mac in for repair at one point, so I just copied the VM to a new machine and I was ready to run in minutes.

                      1. 3

                        I use an Apple computer as my home machine, and the native Mac app I use is Terminal. That’s it. All other apps are non-Apple and cross-platform.

                        That said, MacOS does a lot of nice things. For example, if you try to unmount a drive, it will tell you what application is still using it so you can unmount it. Windows (10) still can’t do that, you have to look in the Event viewer(!) to find the error message.

                        1. 3

                          In case it’s unclear, non-Native means webapps, not software that doesn’t come preinstalled on your Mac.

                          1. 3

                            It is actually pretty unclear what non-Native here really means. The original HN post is about sandboxed apps (distributed through the App Store) vs non-sandboxed apps distributed via a developer’s own website.

                            Even Gruber doesn’t mention actual non-Native apps until the very last sentence. He just talks/quotes about sandboxing.

                            1. 3

                              The second sentence of the quoted paragraph says:

                              Cocoa-based Mac apps are rapidly being eaten by web apps and Electron pseudo-desktop apps.

                        2. 1

                          full-screen VM high-five

                        3. 1

                          To have environment closer to production I guess (or maybe ease of installation, dunno never used homebrew). I don’t have to use mac anymore so I run pure distro, but everyone else I know uses virtualisation or containers on their macs.

                          1. 3

                            Homebrew is really really really easy. I actually like it over a lot of Linux package managers because it first class supports building the software with different flags. And it has binaries for the default flag set for fast installs. Installing a package on Linux with alternate build flags sucks hard in anything except portage (Gentoo), and portage is way less usable than brew. It also supports having multiple versions of packages installed, kind of half way to what nix does. And unlike Debian/CentOS it doesn’t have opinions about what should be “in the distro,” it just has up to date packages for everything and lets you pick your own philosophy.

                            The only thing that sucks is OpenSSL ever since Apple removed it from MacOS. Brew packages handle it just fine, but the python package system is blatantly garbage and doesn’t handle it well at all. You sometimes have to pip install with CFLAGS set, or with a package specific env var because python is trash and doesn’t standardize any of this.

                            But even on Linux using python sucks ass, so it’s not a huge disadvantage.

                            1. 1

                              Installing a package on Linux with alternate build flags sucks hard in anything except portage

                              You mention nix in the following sentence, but installing packages with different flags is also something nix does well!

                              1. 1

                                Yes true, but I don’t want to use NixOS even a little bit. I’m thinking more vs mainstream distro package managers.

                              2. 1

                                For all its ease, homebrew only works properly if used by a single user who is also an administrator who only ever installs software through homebrew. And then “works properly” means “install software in a global location as the current user”.

                                1. 1

                                  by a single user who is also an administrator

                                  So like a laptop owner?

                                  1. 1

                                    A laptop owner who hasn’t heard that it’s good practice to not have admin privileges on their regular account, maybe.

                                2. 1

                                  But even on Linux using python sucks ass, so it’s not a huge disadvantage.

                                  Can you elaborate more on this? You create a virtualenv and go from there, everything works.

                                  1. 2

                                    It used to be worse, when mainstream distros would have either 2.4 or 2.6/2.7 and there wasn’t a lot you could do about it. Now if you’re on python 2, pretty much everyone is 2.6/2.7. Because python 2 isn’t being updated. Joy. Ruby has rvm and other tools to install different ruby versions. Java has a tarball distribution that’s easy to run in place. But with python you’re stuck with whatever your distro has pretty much.

                                    And virtualenvs suck ass. Bundler, maven / gradle, etc. all install packages globally and let you exec against arbitrary environments directly (bundle exec, mvn exec, gradle run), without messing with activating and deactivating virtualenvs. Node installs all it’s modules locally to a directory by default but at least it automatically picks those up. I know there are janky shell hacks to make virtualenvs automatically activate and deactivate with your current working directory, but come on. Janky shell hacks.

                                    That and pip just sucks. Whenever I have python dependency issues, I just blow away my venv and rebuild it from scratch. The virtualenv melting pot of files that pip dumps into one directory just blatantly breaks a lot of the time. They’re basically write once. Meanwhile every gem version has it’s own directory so you can cleanly add, update, and remove gems.

                                    Basically the ruby, java, node, etc. all have tooling actually designed to author and deploy real applications. Python never got there for some reason, and still has a ton of second rate trash. The scientific community doesn’t even bother, they use distributions like Anaconda. And Linux distros that depend on python packages handle the dependencies independently in their native package formats. Ruby gets that too, but the native packages are just… gems. And again, since gems are version binned, you can still install different versions of that gem for your own use without breaking anything. Python there is no way to avoid fucking up the system packages without using virtualenvs exclusively.

                                    1. 1

                                      But with python you’re stuck with whatever your distro has pretty much.

                                      I’m afraid you are mistaken, not only distros ship with 2.7 and 3.5 at same time (for years now) it is usually trivial to install newer version.

                                      let you exec against arbitrary environments directly (bundle exec, mvn exec, gradle run), without messing with activating and deactivating virtualenvs

                                      You can also execute from virtualenvs directly.

                                      Whenever I have python dependency issues, I just blow away my venv and rebuild it from scratch.

                                      I’m not sure how to comment on that :-)

                                      1. 1

                                        it is usually trivial to install newer version

                                        Not my experience? How?

                                        1. 1

                                          Usually you have packages for all python versions available in some repository.

                          2. 2

                            Have they chosen Macs or have they been issued Macs? If I were setting up my development environment today I’d love to go back to Linux, but my employers keep giving me Macs.

                            1. 3

                              Ask for a Linux laptop. We provide both.

                              I personally keep going Mac because I want things like wifi, decent power management, and not having to carefully construct a house of cards special snowflake desktop environment to get a useable workspace.

                              If I used a desktop computer with statically affixed monitors and an Ethernet connection, I’d consider Linux. But Macs are still the premier Linux laptop.

                              1. 1

                                At my work place every employee is given a Linux desktop and they have to do a special request to get a Mac or Windows laptop (Which would be in addition to their Linux desktop).

                            2. 3

                              Let’s be clear though, what this author is advocating is much much worse from an individual liberty perspective than what Microsoft does today.

                              1. 4

                                Do you remember when we all thought Microsoft were evil for bundling their browser and media player? Those were good times.

                            1. 5

                              I used to run bind on a small and cheap (~$5 USD/month) VPS. Then I got lazy and switched to Google cloud DNS. It’s simple and costs me fraction of a dollar per month.

                              These things are great fun when learning the subject, but once it becomes routine, you simply lose interest (in maintaining it).

                              1. 2

                                In what other languages would it be possible?

                                I guess everything with properties (functions disguised as fields) so D, C#, etc.

                                Afaik not with C, C++, or Java.

                                1. 26
                                  #define a (++i)
                                  int i = 0;
                                  
                                  if (a == 1 && a == 2 && a == 3)
                                      ....
                                  
                                  1. 1

                                    Isn’t that undefined behavior? Or is && a sequence point?

                                    1. 3

                                      && and || are sequence points. The right expression may never happen depending on the result of the left, so it would make things interesting if they weren’t.

                                  2. 10

                                    This is very easy to do in C++.

                                    1. 5

                                      You can also do it with Haskell.

                                      1. 3

                                        Doable with Java (override the equals method), and as an extension, with Clojure too:

                                        (deftype Anything []
                                          Object
                                          (equals [a b] true))
                                        
                                        (let [a (Anything.)]
                                          (when (and (= a 1) (= a 2) (= a 3))
                                            (println "Hello world!")))
                                        

                                        Try it!

                                        Or, inspired by @zge above:

                                        (let [== (fn [& _] true)
                                              a 1]
                                          (and (== a 1) (== a 2) (== a 3)))
                                        
                                        1. 3

                                          Sort of. In Java, == doesn’t call the equals method, it just does a comparison for identity. So

                                           a.equals(1) && a.equals(2) && a.equals(3); 
                                          

                                          can be true, but never

                                           a == 1 && a == 2 && a == 3;
                                          
                                        2. 3

                                          perl can do it very simply

                                          my $i = 0;
                                          sub a {
                                          	return ++$i;
                                          }
                                          
                                          if (a == 1 && a == 2 && a == 3) {
                                          	print("true\n");
                                          }
                                          
                                          1. 2

                                            Here is a C# version.

                                            using System;
                                            
                                            namespace ContrivedExample
                                            {
                                                public sealed class Miscreant
                                                {
                                                    public static implicit operator Miscreant(int i) => new Miscreant();
                                            
                                                    public static bool operator ==(Miscreant left, Miscreant right) => true;
                                            
                                                    public static bool operator !=(Miscreant left, Miscreant right) => false;
                                                }
                                            
                                                internal static class Program
                                                {
                                                    private static void Main(string[] args)
                                                    {
                                                        var a = new Miscreant();
                                                        bool broken = a == 1 && a == 2 && a == 3;
                                                        Console.WriteLine(broken);
                                                    }
                                                }
                                            }
                                            
                                            1. 2

                                              One of the ‘tricks’ where all a’s are different Unicode characters is possible with Python and Ruby. Probably in Golang too.

                                              1. 7

                                                In python, you can simply create class with __eq__ method and do whatever you want.

                                                1. 4

                                                  Likewise in ruby, trivial to implement

                                                  a = Class.new do
                                                    def ==(*)
                                                      true
                                                    end
                                                  end.new
                                                  
                                                  a == 1 # => true
                                                  a == 2 # => true
                                                  a == 3 # => true
                                                  
                                              2. 2

                                                In Scheme you could either take the lazy route and do (note the invariance of the order or ammount of the operations):

                                                (let ((= (lambda (a b) #t))
                                                       (a 1))
                                                  (if (or (= 1 a) (= 2 a) (= 3 a))
                                                      "take that Aristotle!"))
                                                

                                                Or be more creative, and say

                                                (let ((= (lambda (x _) (or (map (lambda (n) (= x n)) '(1 2 3)))))
                                                        (a 1))
                                                    (if (or (= 1 a) (= 2 a) (= 3 a))
                                                        "take that Aristotle!"))
                                                

                                                if you would want = to only mean “is equal to one, two or three”, instead of everything is “everything is equal”, of course only within this let block. The same could also be done with eq?, obviously.

                                                1. 1

                                                  Here is a Swift version that uses side effects in the definition of the == operator.

                                                  import Foundation
                                                  
                                                  internal final class Miscreant {
                                                      private var value = 0
                                                      public static func ==(lhs: Miscreant, rhs: Int) -> Bool {
                                                          lhs.value += 1
                                                          return lhs.value == rhs
                                                      }
                                                  }
                                                  
                                                  let a = Miscreant()
                                                  print(a == 1 && a == 2 && a == 3)
                                                  
                                                1. 5

                                                  In the simplest of terms, it blocks most of the elements which causes the web to load slower on mobile, like large amounts of JavaScript, third-party tracking scripts and bloated CSS.

                                                  For all that I’ve read about AMP, I still haven’t understood why AMP is the only way to avoid bloating a page with large amounts of JavaScript and tracking scripts.

                                                  1. 6

                                                    I still haven’t understood why AMP is the only way to avoid bloating a page with large amounts of JavaScript and tracking scripts.

                                                    The problem with this approach is it isn’t new, doesn’t get you conference talks and Medium posts, and it isn’t pioneered by Google. Therefore, can it really be any good?

                                                    1. 4

                                                      My guess is that it’s easier to promote this in some companies, exactly because “it’s the new hot thing from Google”. Otherwise you might get “Yes, we certainly want our site faster, but we definitely need those two ad networks, seven tracking systems and all the social widgets”.

                                                      1. 3

                                                        Excellent point. I was presuming malevolence, but groupthink can also be weaponized to get people to do the right thing!

                                                  1. 3

                                                    E-ink is a cool tech I’d like to see used in more products.

                                                    1. 1

                                                      E-ink is one of many cool techs I’d love to fiddle with, but can’t think of anything useful (for me).

                                                      1. 8

                                                        The ultra fine granularity and relative low quality of the NPM packages make ideal circumstances for abuse, as the article eloquently shows. It’s a good case for the “batteries included” environments, which would be less prone to that type of attack. At the end of the day, the root cause is more social and organizational than technical – and that’s a fascinating aspect of computer security.

                                                        1. 1

                                                          Counter-point: the fine granularity allows for not pulling much dead code in. With all the jokes about left-pad, it is easier to audit then activesupport.

                                                          I don’t think a good case for any of these environments can be made. I’d say the question of how to audit artifacts that literally include code from all over the world properly is unsolved.

                                                          1. 1

                                                            I don’t have to audit activesupport, I have to trust the people with commit access. That’s a much smaller group than the set of package authors in my npm dependancies

                                                        2. 4

                                                          This is not npm problem. More like third-party code can be malicious problem.

                                                          1. 6

                                                            Yes, but 3rd-party code which can effectively be published by everyone without oversight by any more trusted parties and where it’s accepted to ship minified code and/or compiler output in packages; such ecosystems are especially vulnerable to the scenario described in the post. And then there’s this cultural norm to put every few lines in its own packages so that you end up with implicit trust to literally hundreds of people in many projects.

                                                            I mean Debian for example has got it’s own fair share of criticism and lacks in people to audit changes, but: You need to earn community trust before you can push anything in to the main repositories and minified code is not accepted.

                                                            1. 2

                                                              Also, package signing is mandatory in Debian and unsupported in npm; it’s ordinary for npm users to import code from hundreds or thousands of authors, any of whom can be hacked.

                                                        1. 12

                                                          > is there an InkJet printer that isn’t an abomination?

                                                          No.

                                                          1. 7

                                                            I think this could be generalized into

                                                            is there a printer that isn’t an abomination

                                                            No.

                                                            All printers are evil. Every single atom a printer is made out of is pure and condensed evil.

                                                            1. 2

                                                              What the hell is PC Loadletter?

                                                            1. 5

                                                              I was using one of the older versions (version 2 maybe) and it’s nice software. One of the nice things is you can use yum repository to install/upgrade.

                                                              Currently when I need this kind of software, I use mitmproxy, which is open source, doesn’t require Java and is terminal app, which I prefer.

                                                              1. 1

                                                                Is there any advantage using this compared to simple inline function?

                                                                1. 2

                                                                  Flutter / Dart’s hot reload functionality is kind of amazing.

                                                                  1. 1

                                                                    Could you elaborate a bit on why (when compared to literally any other framework that supports it, such as Ember, React, Vue, or Mithril)? This is something I’ve honestly just come to expect at this point from a decent SPA framework.

                                                                    1. 1

                                                                      I’m not aware of JS engines being able to hot-patch live objects with new versions of methods. With Dart’s hot reload as you modify and add methods the new code is deployed to object instances that keep their data. It makes for a pretty smooth iteration flow.

                                                                      1. 1

                                                                        I think it’s that it provides it in a mobile context. React Native does too, if I’m reading right, but default iOS and Android toolchains don’t, so mobile devs are a lot less used to seeing their code live in seconds on-device than Web devs.

                                                                        1. 3

                                                                          Android does support this since Android studio 2.3, it’s called instant run.

                                                                          https://developer.android.com/studio/run/index.html#instant-run

                                                                    1. 4

                                                                      Nice. I also recommend to look at advanced phone number input methods

                                                                      1. 1

                                                                        Many years ago when we implemented our CMS, we decided to use urls like example.com/aaaa/bbbb/cccc/dddd (content is structured like a tree). This was terrible idea (obviously). After we let the users in, not only were they easily creating structures ten levels deep, but also constantly moving and renaming items.

                                                                        At first we tried some clever tricks to navigate users where necessary even after items were moved/renamed, but it was still terrible pain and had to be rewritten.

                                                                        Now the content is still a tree, but urls are like example.com/language-code/id-name where only id is important (similar to SO), name can be whatever (but we redirect you to proper one, if not present/wrong). This has worked very well for many years.

                                                                        1. 1

                                                                          The tree structure is nice, but it definitely has limits. Could your system have handled that issue by tracking URL changes so that users could be automatically redirected?

                                                                          1. 2

                                                                            Probably could, but as I said people went crazy with moving and renaming items. Tracking all these changes wouldn’t be impossible, but still at least tidyous. The main issue was still super long urls with like ten levels. Actually I was ashamed when sending link to someone :) We kept tree structure, but it is mainly for organizing items now.

                                                                        1. 2

                                                                          Is there some less resource hungry / more OS integrated electron alternative? Alternatively is there a way to write electron apps better optimized?

                                                                          1. 1

                                                                            The Office of the Ohio Inspector General also found that MCI staffers were also at fault. First for failing to supervise inmates, and second for failure to force employees to change passwords every 90 days. [taken from different article]

                                                                            Well, they should have totally been supervised. Also, having non-secure switch physically available to inmates is pretty bad idea. But blaming someone for not forcing password changes is quite sad.

                                                                            1. 4

                                                                              Back before the internet, and when dialup was still expensive, magazines would publish source code listings and the only way to get it into your computer was to type it in.

                                                                              From which era is this? In the 80s we had tv show about computers in Czechoslovakia. During the final credits, instead of music they “played” zx spectrum program you could record to a tape and run. There was also a radio programme.

                                                                              I find this technique really neat. Did you have something similar?

                                                                              1. 1

                                                                                Wow, neat! I grew up in South Africa and we didn’t have anything similar, unfortunately (well, that I know of!). Source code listings in magazines and books were popular though (most of the books and magazines were imported from the UK/US, however).

                                                                                Heck, in the early-mid 80s even PC Magazine used to print source cost listings - when I got into x86 assembly language and C some years later I used to devour those all issues from the local university library (they had them all neatly bound). Reading those old issues today is a fascinating time capsule of a bygone era of home computing.

                                                                                1. 1

                                                                                  I lived in the US in the 80s, and typing things in from magazines was how I learned to program. I think I might have heard about the audio recording thing, but I was “lucky” as a child to have access to an IBM - one of the most expensive microcomputers of that era - which didn’t have consumer-oriented features like tape storage.

                                                                                  1. 2

                                                                                    didn’t have consumer-oriented features like tape storage

                                                                                    If by “IBM” you mean an original IBM PC (aka 5150), it did have a tape storage option, although it wasn’t very popular.

                                                                                    1. 1

                                                                                      Hah! It was the PC XT (5160), but I’m sure the tape storage would have worked. I didn’t even know about it. :) It had this new thing called a hard drive, which game manuals would always describe as this very rare case. :)

                                                                                1. 5

                                                                                  What is this black magic?

                                                                                  1. 10

                                                                                    It’s jpeg image with html content in comment section, which is not encoded in any way. When you try to load this in img tag, it’s normal image (comment are ignored) and displayed. Browsers are trying really hard to make some sense of content (even with lots of bugs) for historical and compatibility reasons. In this case when they find tags, the parse them and show content. The rest of it (jpeg headers at the beginning, actual img content after comment section) is still there, hidden with css. Starting comment also ends with <!– to comment out image data. Check the source and then developer console to see what browser actually thinks about the content.