1. 1

      What software do you use for that?

      1. 2

        MediaWiki, the software that Wikipedia uses and provides free to anyone. All you need is LAMP. https://www.mediawiki.org/wiki/MediaWiki

    1. 3

      Typed languages are better when you’re working on a team of people with various experience levels

      Funnily enough, the opposite is true for me. I used to be strongly in favor of typed languages, but now I simply don’t care that much. I’d say that I have less trouble navigating the project I’m currently working on (Ruby on Rails) than I had navigating previous projects written in C# and/or Java. In the end, I guess it all depends on many other factors, not just the language itself.

      1. 8

        Having recently (past year) learned Rails as well as Haskell I’ve found that the style of types and amount of enforced structure is a significant factor. The type systems of Haskell, Elm, etc help me a lot more than those of C# or Java. Lack of types in Rails isn’t as much of an issue because everyone writes roughly the same way. So without an expressive type system like Elm then I’d argue you need a very rigid structure like Rails.

        1. 2

          My view on typed languages has both changed a lot and stayed exactly the same. I’ve always thought that most of the interesting properties that I care about and don’t want people to get wrong are not ones that type systems typically express. I’ve more recently learned about some type systems that can express those properties in a useable way, so now I’m massively in favour of strong type systems, just not the ones that most languages have.

          1. 1

            For me it kind of depends on how much turnover your team has and how much of your time is dedicated to teaching a code base or an entire language, for that matter. Sometimes newbies are competent in a codebase relatively fast, others can make dangerous mistakes without the “training wheels” typed languages tend to provide.

            1. 4

              I find no interesting codebase is small enough for all that bollocks to stay in my head, why on earth should it when we can make the computers remember it all for us?

              1. 1

                I’m not talking about memorizing a code base. I’m talking about teaching new teammates about an enterprise code base. I think knowing at least a portion of how things work is necessary before making a change. Sometimes new teammates don’t even know the language that a code base was written in, so you need to teach them about the language itself.

                1. 2

                  Yikes, I’ve never been there thankfully.

          1. 2

            at a $999 price point

            Or $1340 for Europeans.

            1. 6

              This is largely because the 20% VAT is included in the price and because the EU mandates twice the mandatory warranty of the US on all purchased electronics. So no, the price isn’t really that different.

              1. 4

                Thanks for the reply! So Americans actually pay $1100 for what they call a $1000 product.

                Still a difference of $240.

                (BTW, this is not meant as negative criticism of your review – I actually like it a lot)

                1. 5

                  Not in all states. When I was in Oregon (not sure if this is still true), they didn’t have sales tax.

                  1. 2

                    Still true. No state wide sales tax in Oregon.

              2. 6

                Or $2430 for Brazilians :) (I’m actually crying)

                1. 2

                  You mean 835 EUR right?

                  1. 3

                    No. Apple’s listed prices are more expensive in Europe as discussed above, due to higher VAT.

                    On top of that, over here (Europe) the advertised price almost always includes those taxes; unlike in the US where they are added at the time of purchase.

                    1. 2

                      The reason I posted this, is because I think these price comparisons between difference currencies have no meaning. Why post a dollar amount for europeans who can only buy in euros. If you want to compare prices, compare to something like the big mac index or a cost of living index.

                      1. 1

                        Ah. That’s a pretty good point to make, and I completely agree. But I don’t think that’s clear from your original comment.

                        Why post a dollar amount for europeans who can only buy in euros. If you want to compare prices, compare to something like the big mac index or a cost of living index.

                        For an accurate comparison, I think you’d have to compare the price to your chosen index across various US states as well.

                        1. 1

                          And then, there are countries in Europe that are not a part of the Euro zone yet and still have their own currencies, and that dosn’t make the situation any better.

                1. 4

                  Can someone explain to me what Tailwind CSS is? I couldn’t figure it out from their website. If it is a CSS style, why does one need npm or PostCSS? I’m really curious how I could use it for my home projects/personal website, and what it would bring me.

                  1. 2

                    If it is a CSS style, why does one need npm or PostCSS?

                    The CSS style itself is called “Utility-first CSS”. Tailwind is just one of its implementations (perhaps the first widely known). The idea is that you create CSS classes based on small utilities instead of components, so <h1 class="text-large text-blue underline">My Header</h1> instead of <h1 class="main-header">My Header</h1>. It is more verbose on the HTML side, yes, but it makes easier to refactor things on the CSS side.

                    I know that seems weird. The first time I read about utility-first CSS I wasn’t sold on it either, but I really think you should try it for yourself. Once I’ve started working with it, I enjoyed it way more than I thought I would.

                    As for the second part of your question: Tailwind is a bunch of utility CSS classes. So, for instance, you have text-black for setting the text color, border-black for setting the border color, etc. If you were to add a new color to your design system, you would need to manually create lots of these small CSS classes (say, text-fuchsia, border-fuchsia, and so on). With the preprocessor, you can just define that new color on a JSON file and Tailwind generates them all for you. Same thing for different sizes or whatelse you want to change.

                    Another useful feature that PostCSS allows you to do without much trouble is adding a prefix to all Tailwind classes. For example, instead of text-black, you can have tw-text-black, so if you’re adding Tailwind to an existing website, it doesn’t conflict with things that you already have.

                    1. 2

                      I did not know about that tailwind prefix stuff!! This means I can start using tailwind on a bootstrap project right now, without having to port the whole app over to tailwind!! Thanks!

                    2. 2

                      It’s better to watch some videos on YouTube in my opinion. Really hard to understand how it’s useful until you use it.

                      Basically it’s a utility first CSS library.

                      You need postcss to trim out the unused CSS classes, which means you end up with a very tiny amount of CSS in production.

                      1. 1

                        My explanation might is not complete or precise… but hope it is of some help.

                        Tailwind allows low-granularity composable declarations of styles mixed within your HTML.

                        Here is a weird analogy…. imagine in the future – you would be able to go to a pharmacy and get medication that’s ‘pre-designed’ and ’manufactured on the fly, at the time of order – for your genome, your medical history, your current condition. Certainly, manufactures of those medications, are not going to pre-manufacture the meds for all possible combinations of people. Otherwise we would have unsolvable combinatorial explosion, of sorts. We would solve it by creating ‘utility’ chemicals that are combined in smart ways, given the input of your specific needs, at the time of your order.

                        So tailwind allows to define a combination of say ‘fonts’, ‘font-sizes’, angles’, ‘colors’, etc – just by typing in the things you need within your HTML (or JSX ).

                        And then during build time , by means of npm packages – it essentially creates a ‘css framework’ for your site, based on what it detected you had used in your html.

                      1. 5

                        What’s missing is a place that aggregates all these page patterns in the style of well-known URLs.

                        1. 3

                          These things should start becoming a standard.

                          1. 2

                            Just a heads up that the document you linked has been updated by RFC 8615.

                          2. 1

                            how bout a /urls page

                          1. 5

                            I guess this is a bit off-topic, but here we go:

                            This isn’t the first time Mozilla has gone over its users and overrode settings without asking. This makes me uncomfortable, so I’m considering alternatives. Which browser have you been using?

                            1. 7

                              The problem is that Firefox is the best browser, but the best isn’t good enough.

                            1. 24

                              Copy paste is still horribly ‘broken’. I guess <Cmd>C isn’t a thing on Linux and <Ctrl>C has a different meaning in terminals, so I can get with that. And I guess there are tricky/valid historical reasons for having two different clipboards, but for the end user, it’s just shit not being able to copy in one app and paste in the next if you closed the former.

                              I’ve moved between Windows, Linux, and macOS in my career with enough time to really get used to each, and the mac approach of using cmd for UI shortcuts is just a superior choice for this reason. It pains me that this isn’t possible in Linux.

                              1. 6

                                Haiku (and, I suppose, BeOS back in the days when I did not even have a computer) went in the right-ish direction of using Alt for everything GUI. It’s sad to see Linux GUIs to be influenced by Windows so much.

                                1. 7

                                  Another added benefit of using cmd for UI shortcuts is that it frees up the control key for Emacs style shortcuts. The fact that macOS supports these out of the box is one of my favorite features.

                                  1. 11

                                    MacOS also makes it easy to remap Control to the correct key position (aka the so-called “caps lock” key, which has inexplicable prominence on most modern keyboards).

                                    1. 2

                                      The same goes for Linux (console) and ‘Linux’ (X11 etc). Keys can be remapped more or less at will, if you want to use AltGr or Alt as a ‘command’ key you’re free to do so. The main problem here is that everyone and his dog will end up using a different strategy, e.g. I use a lot of Shift-Left_Alt-X combinations for launching sessions on different hosts while those same combinations might do something totally different on your systems.

                                      1. 1

                                        It’s not impossible on Windows either but there’s no built-in way, instead you have to hack the registry or use 3rd party tools.

                                    2. 5

                                      Even if I do say so myself, since I wrote it, I use appmodmap to dynamically remap the keyboard depending on the application. Then I can still use my Mac muscle memory on a Mac keyboard with my Talos II.

                                      https://github.com/classilla/appmodmap

                                      1. 1

                                        How’re you finding the Talos II? I laugh when I see “a price that won’t break the bank” on their site, but I still desperately covet one.

                                        1. 2

                                          Well, yes, the sticker shock, but I like it a lot. Very little is missing of what I need a computer to do, performance is well within the Intel ballpark, and it satisfies my personal goals of more owner control and materially supporting viable alternatives to x86.

                                    3. 3

                                      It pains me that this isn’t possible in Linux.

                                      This is possible, the WM I use (i3, and now sway) supports setting a modifier key. IIRC the default is the ‘windows’ key.

                                      Linux is the kernel, and there are a lot of desktop environments and window managers that run on Linux…

                                      1. 0

                                        People say “Linux” to mean much more than the kernel. Don’t be That Guy.

                                        I’ve been using Linux for 20 years, trust me it ain’t that simple. Yes you can set some nonzero percentage of UI shortcuts to use another modifier, but it will not be comprehensive. There will always be one more thing that doesn’t behave correctly, death by a thousand papercuts. Linux is simply not capable of making a sweeping change like this in a comprehensive way.

                                        1. 3

                                          What you refer to as “That Guy” is, in fact, “GNU/That Guy”…

                                          1. 2

                                            People say “Linux” to mean much more than the kernel. Don’t be That Guy.

                                            Sure, but if you make ridiculous generalizations like “Linux cannot do XYZ”, then you need to be more specific about the userspace you used… because most of the time XYZ can be accomplished on a Linux-based userspace.

                                            Linux is simply not capable of making a sweeping change like this in a comprehensive way.

                                            I disagree. This is a userspace problem, and if the right person were motivated to solve it, it could be solved in some UI toolkit, etc. Will all distros adopt it? Who cares, there are different distros that are all different for a reason.

                                            1. 1

                                              you need to be more specific about the userspace you used

                                              No, I don’t because it literally doesn’t matter. The fact that there are a multitude of UI systems to choose from, that don’t share a unified system of configuration, is the crux of the problem. There is no way to enforce any HIG standard in a Linux UI.

                                              I disagree. This is a userspace problem, and if the right person were motivated to solve it, it could be solved in some UI toolkit, etc.

                                              Great, what about all the other toolkits? How are you going to generalize this solution to work with all graphical programs?

                                              You don’t. It’s fundamentally impossible on Linux.

                                        2. 2

                                          Select with left mouse button, paste by clicking the mouse wheel. No keyboard needed.

                                          1. 3

                                            The point OP is making is not that it’s easy to copy and paste, but that in macOS you have two “layers” of keyboard shortcuts. Most application shortcuts will use Command (Cmd+C to copy, Cmd+C to paste, Cmd+T to open a new tab, Cmd+A to select all, etc), leaving Control to give text commands (Ctrl+A to go to the beginning of the line, Ctrl+E to go to the end, etc, just like in Emacs).

                                            In theory, this should also be possible on Windows and Linux by using Control and Alt, but in these OS almost all shortcuts use Control, reducing the amount of key combinations that an application can use as shortcuts.

                                            1. 1

                                              Many window manager allow defining and using extra modifier keys.

                                              On a side note, modifier keys are proven to be slower than sequential keypress sequences and also more difficult to remember.

                                            2. 2

                                              A keyboard is very often much faster and accurate than a mouse.

                                              1. 1

                                                Not necessarily, with the obvious exception that literally typing is certainly faster with a real keyboard than an on-screen keyboard, but the task of choosing an option is probably always faster on a mouse.

                                                1. 1

                                                  We’ve done a cool $50 million of R & D on the Apple Human Interface.

                                                  The original Ask Tog piece was published on 1989, and the quoted study may have been done some time before that. It needs to be asked how relevant that study is, especially when that study can’t be either found or replicated.

                                                  Further, it is unclear whether the quoted study address the improvement when user performs the same action multiple times as to make it a finger memory.

                                                  Here is a more recent study (2014), which shows that keyboards are fastest for often used commands while toolbars are better for infrequently used ones.

                                            3. 1

                                              FWIW I think it will be. With Canonical & Redhat saying “Gnome is THE desktop” I think you’ll see better across the board integration of things like this.

                                              I don’t love that they chose Gnome (KDE fan :) but I AM happy they chose a horse. Maybe if they can make Gnome better enough, I’ll stop caring :)

                                              1. 1

                                                I hope you’re right, but I’ve been using GNOME since the 1.x days and I’m not holding my breath.

                                                1. 1

                                                  It’s a matter of money and man hours, that’s why I think things will change for the better. Open source is not free. It takes go juice to evolve in positive ways.

                                              2. 1

                                                The USB HID standard actually provides (see https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf, search for “Keyboard Copy”) for a usage code that means copy (and friends). So you could in theory create a keyboard that has shortcuts for copy/cut/paste, universally.

                                                I say in theory because I have no idea if all operating systems handle it properly.

                                                1. 1

                                                  I actually have an old Sun Microsystems keyboard that has separate keys for cut, copy, paste etc.

                                                  here’s a picture of a similar one (though not identical to mine close enough) https://duckduckgo.com/?q=sun+microsostems+keyboard&t=ffab&iax=images&ia=images&iai=http%3A%2F%2Fxahlee.info%2Fkbd%2Fi%2Fkb%2Fsun_keyboard_left.jpg )

                                                  doesn’t work great on Windows though. it works, just not amazingly.

                                                  1. 3

                                                    Wow, that’s wild. It even has a button for giving folks props on forums. Sweet!

                                                    1. 1

                                                      wait, how can it work less than completely? Does it copy and not paste? copy only sometimes?

                                                      1. 2

                                                        I worded that poorly, the extra keys require a separate driver install on Windows or they will do absolutely nothing. On Linux at least the key presses are forwarded to programs, even if they don’t know how to interpret them.

                                                1. 11

                                                  It’s kinda like they rediscover language design problems as they go. Hopefully they will manage to also rediscover the well-known solutions, instead of NIHing their own, too.

                                                  1. 5

                                                    I do get a lot of Java 1.4 flashbacks when working in Go. I wonder how long until those become Java 5.0 flashbacks.

                                                    1. 2

                                                      I do get a lot of Java 1.4 flashbacks when working in Go.

                                                      That’s interesting, can you give some examples?

                                                      1. 5

                                                        Just some little things like iterating over collections, codegen, and marshalling i/o. I’m coming back to static typing after many years in Ruby so it’s not exactly Go’s fault. Though it’s a bit surprising when a Go binary has a similar file size to a WAR file from back in the day!

                                                        Overall I think Go is still way ahead of Java 1.4, both as a language and an ecosystem. The stdlib and dependency management are great. I’m very happy to never have to maintain a pile of ant+ivy config again. I know error management is a pain for many in Go but it was a pain back in the day for Java too. So many wars over checked vs unchecked exceptions. The only thing you can be sure of as a language designer is that you can’t please everyone.

                                                        1. 1

                                                          In Java 1.4 you had to use an explicit index counter to iterate. Go started out with range-based iteration. So not sure what you meant here.

                                                          The marshalling does feel similar. I haven’t seen better approaches though. Do you know of any? [I haven’t used Ruby so am not familiar with how it handles marshalling.]

                                                    2. 8

                                                      I think that characterization is somewhat unfair. Given the backgrounds of Go’s designers, they were probably aware of most language design problems. They just opted to make Go simple (for some definition of simple).

                                                      What I find interesting to see is how they will manage to add generics to the language (since apparently they want to add generics now), without breaking backwards compatibility and while simultaneously avoiding making it a bolted-on thing (such as Java generics).

                                                      1. 2

                                                        I think that characterization is somewhat unfair. Given the backgrounds of Go’s designers, they were probably aware of most language design problems. They just opted to make Go simple (for some definition of simple).

                                                        I wonder where this allocation of undeserved credit comes from … why not judge people by their actions, instead of appealing to authority? I think it’s pretty obvious that they are blissfully unaware and uninterested in anything that they didn’t invent themselves at Bell Labs 30 years ago.

                                                        What I find interesting to see is how they will manage to add generics to the language (since apparently they want to add generics now), without breaking backwards compatibility and while simultaneously avoiding making it a bolted-on thing (such as Java generics).

                                                        They won’t? :-)

                                                        1. 18

                                                          I think it’s pretty obvious that they are blissfully unaware and uninterested in anything that they didn’t invent themselves at Bell Labs 30 years ago.

                                                          Go language design proposals mention feature-relevant PLT and explain in some detail why various approaches or solutions are or are not relevant. This analysis isn’t hidden from view. Consequently it’s hard to take this kind of grumpy sniping as anything other than blissfully uninformed sour grapes.

                                                          1. 2

                                                            I’ve seen public discussions regarding Generics, yes, but not about other topics. Still, it seems to me that most discussions regarding that revolve around “well, we screwed up during language design. How do we fix it now without breaking backwards compability?”

                                                            But I’m still curious, anyway. Can you point me to a text describing why they decided to standardize on such lackluster error handling approach? Or even why they decided to not implement enums as a language construct and went with iota instead.

                                                            1. 4

                                                              Or even why they decided to not implement enums as a language construct and went with iota instead.

                                                              You might not agree with it, but it’s been in the FAQ for ages: https://golang.org/doc/faq#variant_types

                                                              If you search gonuts, I recall there being more discussion about it.

                                                              My take is that they don’t assign a lot of value to exhaustiveness checks, or at least, value other things over it.

                                                              1. 1

                                                                I meant enums as variant types (like in Rust), but as grouped constants (like in C#).

                                                                Thanks for the FAQ and gonuts suggestions, though. I’ll see what I can find there.

                                                          2. 3

                                                            I wonder where this allocation of undeserved credit comes from … why not judge people by their actions, instead of appealing to authority?

                                                            Previous languages that they have been involved in designing – Alef, for example– have had generics and exceptions.

                                                            1. 1

                                                              Interestingly, genericity was already gone three years later in Limbo. So I guess parameterized ADTs were indeed not seen as a redeeming feature of Alef.

                                                      1. 4

                                                        Rust gets similar complaints about compile times and complexity, but its adoption seems to be on the S-curve:

                                                        https://www.openhub.net/languages/compare?language_name[]=rust&language_name[]=scala&measure=contributors

                                                        1. 5

                                                          Rust has some unique selling points, Scala doesn’t.

                                                          1. 2

                                                            This has been my general feeling with Scala. I have worked through some Scala books 2008-2012 and wrote some Scala programs for internal use. I also encountered quite a lot of student-submitted Scala code in one of my courses a few years back, because a colleague had taught a Scala seminar. To me Scala resembled C++: a lot of accidental complexity, trying to be everything to everybody, and long build times without the main benefit of C++, namely performance. I think the only minor benefit was that gives access to JVM ecosystem (if you need that), but for the people who just wanted a better Java there is Kotlin and Java >= 8 now.

                                                            1. 3

                                                              True.

                                                              The only sad thing is that – when only looking at the common language subset shared between Kotlin and Scala – Scala is substantially better than Kotlin.

                                                              I’m back to Java, and simply stopped hoping for a high-quality language on the JVM.

                                                              1. 2

                                                                I definitely agree about Kotlin. I think the most appealing part is the when keyword, which is almost what you would expect from pattern matching, except it isn’t.

                                                                What other languages have you tried on the JVM? I’m curious about you experience with Clojure, if any.

                                                          2. 4

                                                            Scala can’t match Rust’s speed, though.

                                                            1. 21

                                                              That and Rust’s core team are deliberately trying to avoid the biggest problems this blog post mentioned:

                                                              Rust will never have a breaking migration like Dotty or Python 3 (or, $DIETY forbid, Perl 6). Rather than fixing soundness holes by releasing an entirely new language, Rust just ships both verification passes and issues warnings if their results differ, until eventually the red line is drawn and NLL is permanently shipped. And rather than fixing papercuts by releasing a whole new language, they just use “edition numbers,” basically the same thing as use strict.

                                                              Also, the thing where Scala is supposed to “hand over the improvement process to the industry” is exactly what Mozilla already did. I only counted two Mozilla employees on the core team, with a lot of others employed by random companies like NPM, CloudFlare, Pingcap, Integers32 (which, being a Rust consultancy, really isn’t “random”). Other teams have members from Microsoft, Parity, Chef, Ferros systems (the other Rust consultancy), Diffeo, Wayfair, RMS… While Mozilla seems to have more employees than anyone else still, I’m pretty sure they’re less than half (it’s hard to be sure, because some team members don’t list their employer at all, so it’s hard to tell if they’re unemployed, academically employed, or employees of a company that didn’t fill it in on their GitHub profile).

                                                              1. 4

                                                                Thanks for the writeup! I haven’t counted recently, but already at RustFest Kyiv 2017, the quoted number of contribution Mozilla vs. non-Mozilla was <25% Mozilla. I’m sure that stayed the same.

                                                                BTW, there’s also members of Ferrous Systems in core (me), but not by virtue of being employed at Ferrous. Core team is picked by involvement in parts of the project and willingness to do meta things (like legal, phew), Carol from integer is also one of the core maintainers of crates.io, Ashley is very active in the WASM side, Steve is docs team, etc.

                                                            2. 0

                                                              That graph is irrelevant, it appears to be tracking changes to the language itself

                                                            1. 3

                                                              We started using Kotlin for some microservices, along with Spring. So far, it’s a nice language, but I miss some of Rails niceties. Whenever we want to add a library and/or do something we haven’t done before, it feels there’s way more settings to configure and manual steps to make it work than it would require in Rails.

                                                              1. 29

                                                                It’s what I’d do even if I weren’t getting paid. It’s my primary hobby, my profession, and what I’ve wanted to do since I can remember.

                                                                1. 6

                                                                  This is exactly my feeling. I love solving problems using software I write, I love knowing people are using what I make, and I love reducing the amount of boring and error-prone repetition in my life using my own software.

                                                                  I think people who don’t enjoy coding belong in the industry just as much as anyone else. At that level, it’s a job, and we don’t expect people in any other field to love it, necessarily. But it’s a very odd, specialized job which is definitely not for everyone, and anyone smart enough to be a programmer is probably smart enough to make a living in some other field which doesn’t involve the obscure pains programming can expose you to.

                                                                  1. 4

                                                                    That’s awesome that your hobby and profession aligns 🙂

                                                                    Do you have any advice for people who currently don’t enjoy doing what they do for a profession and how to get there?

                                                                    1. 11

                                                                      Well, I guess my first advice would be to ask, what do you love? There’s absolutely nothing wrong with coding to pay the bills and doing what you love with your free time. My other hobby is Western religious history, which definitely is not a moneymaking industry. :)

                                                                      I’d also say, coding is a huge field, like “talking”. There are a million languages, a million techniques. You might find that you like the theoretical side more (math, complexity theory, category theory, etc). You might find out that you really like writing parsers. Maybe you hate Java but you end up loving Erlang. There’s a lot out there.

                                                                      But, again, there’s nothing wrong with just having a day job. Life is meant to be enjoyed so don’t worry about what you “should” like, do what you do like however you can.

                                                                      1. 1

                                                                        I like to ice skate and tinker, mostly with keyboards and other input devices, but the skies the limit really.

                                                                        Unfortunately neither pay well so here I am 🙂

                                                                        1. 5

                                                                          Has it always been the case or in the beginning you used to enjoy programming?

                                                                          If you used to like it, but not anymore, it’s worth trying to investigate why. This is something that has also happened to me, and it took me a while to finally find an answer. At first, I thought this was a matter of abstract vs concrete activities and I tried to find concrete activities that I could find interesting. Though I did start cooking (and discovered I enjoy it), this still wasn’t the real issue. You said you like ice skating and tinkering, so maybe this is a good place to start thinking about it.

                                                                          Later, I realized that what I really miss from the early days is having everything under control: relatively small code bases that I understand well, none or just a few third party libraries, etc. In contrast, most professional projects I have taken are the complete opposite: large code bases that no one really understands with lots of external libraries. I still don’t know what exactly I can do about this, but just from knowing where my discomfort comes from, I already feel a bit better about programming overall.

                                                                          This has been my quest so far to try to start enjoying coding as much as used to. You’ll probably find other topics that I haven’t mentioned, but that are important to you. This is an introspective exercise I think you should do if you also wish to get back to programming with a refreshed feeling.

                                                                          1. 4

                                                                            I used to like it. I had a really good job at the start of my career with an amazing mentor. However, since that job, I haven’t liked it much.

                                                                            I’ll try to reflect on exactly why, but I have a suspicion that it’s when I realized that agile and startups are irrevocably intertwined with coding. Both I can’t stand.

                                                                            This is an introspective exercise I think you should do if you also wish to get back to programming with a refreshed feeling.

                                                                            That sounds amazing. Hopefully, I can get there. 🙂

                                                                      2. 4

                                                                        Not the parent commenter, but how about looking into other programming paradigms? e.g. if you only do OOP right now, try looking into functional programming, there’s a lot of interesting and beautiful stuff there that might appeal to you.

                                                                        Or perhaps have a look at formal methods, either “lightweight” ones like TLA, or the more heavy weight ones like Coq and Lean. I’ve found writing specifications above the level of abstraction that most programming languages provide and model checking them or writing proofs for them quite an interesting/enlightening experience for me and it’s one of my favourite things to do.

                                                                        Lastly, I think generally identifying pain points in your workflows and writing little programs to automate them and scratch your itch could be another way to find joy in programming. For me that’s writing little Haskell scripts or elisp (Emacs Lisp) tidbits here and there.

                                                                        1. 2

                                                                          Thanks for the reply! I know this is a “me problem” but when I have to learn new technologies I find it very frustrating. Recently I’ve been on a Scala project and FP hasn’t done anything for me.

                                                                          It wasn’t always that way though, I used to get excited about new technologies but after a while it just notice it for the revolving door it is.

                                                                          1. 2

                                                                            […] but when I have to learn new technologies I find it very frustrating.

                                                                            I can relate to that :)

                                                                            Recently I’ve been on a Scala project and FP hasn’t done anything for me.

                                                                            Interesting. I’d say in that specific case, the language and the machinery it offers probably influence that as well. Like, for instance I’d take writing Haskell over Scala any day. But oh well, that’s me.

                                                                            It wasn’t always that way though, I used to get excited about new technologies but after a while it just notice it for the revolving door it is.

                                                                            Right. Same here actually. I don’t go looking for shiny new things to use just because they’re shiny and new. But I would still gladly consider things that could help improve the quality and correctness of programs that I write, and see if they’d be worth the investment of time for learning/integrating them into my workflow. And that bar has certainly increased over the last couple years.

                                                                    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;
                                                                                
                                                                                1. 1

                                                                                  But wouldn’t you have

                                                                              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. 2

                                                                                        Can anyone give me some examples of the sort of things you write on a personal wiki? I’ve always enjoyed the idea of having one, but at the same time I can’t maintain one for a long time. I feel like it’s too much effort, and that I can find whatever I want using Google anyway.