Live data from Hacker News

Programming-language popularity by GitHub pull requests

lemire.me

61–70 of 73 posts

Re: Programming-language popularity by GitHub pull requests

#61

Earlier quoted context omitted.

> you can't generally mock a function With `dynamic` and `DynamicObject`/`ExpandoObject` proxies (or even lower level System.Dynamic/System.Linq.Expression fun) you can mock anything you want to in C#. Those tools go all the way back to the early days of Linq (and useful but somewhat broken DLR visions like IronPython). If you need to time travel even further back in the .NET stack, or if you are just allergic to/dea…

I'm on of those people that had no idea about all this extra functionality- thanks for opening that door. Do you have any resources on the hand writting "Fakes" patterns?

I don't have any resources directly off-hand, but the basic concept is implementing "shareable across multiple tests" versions of your dependencies that implement things relatively similar to the end product but in a way that uses fewer resources during testing and is hopefully more reproducible/unlikely to encounter transient environment bugs. (Though still overall more "fake" than "real", otherwise you are just building artisanal integration test harnesses.) Things like using in-memory or SQLite data stores instead of your production database type. Ideas like true secondary, simplified implementations of your abstractions. (There's no reason to have an interface that is only ever implemented by one class, so at least this is one reason to have a second implementation that fakes doing something useful.) In some ways I feel "the fakes pattern" really just means "the old way of writing tests before auto-mocking frameworks became popular", but testing patterns love to have names that change every couple of years.

There are obviously good reasons auto-mocking frameworks became popular as it can be too easy to fall into performance traps or to try to maintain two separate dependency stacks (and get dangerously close to all of your units tests as just baroquely complex integration tests), one of which may easily get out of date/diverge and is extremely fragile, especially if you don't have good abstractions up front. It's too easy for how easy you can build your "fake" data sources to accidentally create a lower common denominator of what you can safely test, either limiting the types of queries that you feel like you can add to production code (forcing you to avoid things that your production DB supports, but an SQLite or In Memory storage can't easily fake) or create growing missing coverage boundaries between "testable" and "production" code.

On the flip side though, the benefits of hand-written fakes should be that you better prove out your abstractions and how they are factored (if it is too hard to manually fake a dependency, then maybe that becomes a sign that the dependency needs to be refactored and/or a better abstraction found for it), and the tests overall more resemble your production code and how it operates in the wild. (Versus how I feel excessively mocked code starts to resemble "stage plays" that don't necessarily approach or model real world usage and behavior and it often remains too easy to "stage play" even when your abstractions are wrong/not helping you enough.)

Re: Programming-language popularity by GitHub pull requests

#63
post #3

Clicking through to the underlying data, it seems that 2% of all code is written in Nix. I doubt that is the current state of the industry. For example, I doubt that 2% of programming jobs are for Nix codebases. For that reason, I am consuming a very large salt crystal alongside this information.

I'm guessing that Nix's 2% is nearly entirely driven by pull requests to the NixOS/nixpkgs repository, which has 4,053 open PRs and 190,167 closed ones at time of writing.

That makes sense and that was exactly what was going through my mind.

I guess, PR data shows you what needs to be updated frequently. Personally, I like getting code right and shipping it and never thinking about it again. But for "here's how to reproducibly install the newest possible version of foobarbaz" yeah, a lot of updates are going to be needed, simply because "the latest version of foobarbaz" is likely a moving target.

Re: Programming-language popularity by GitHub pull requests

#64

I wonder why JavaScript fell from 19% to 9% in 2022? According to the graph here: https://madnight.github.io/githut/

Author here. I started to filter pull requests from bots like dependapot, because dependabot massively inflates the number of pull requests, especially for JavaScript, in recent years.

Unfortunately, I don't have enough BigQuery Credits ($) to re-run the bot filter for the entire history, that's why you see the down spike.

Re: Programming-language popularity by GitHub pull requests

#65
post #3

Clicking through to the underlying data, it seems that 2% of all code is written in Nix. I doubt that is the current state of the industry. For example, I doubt that 2% of programming jobs are for Nix codebases. For that reason, I am consuming a very large salt crystal alongside this information.

Better than TIOBE at least, which seems to have gathered a huge amount of popularity for no good reason. Their metric is just to search for "$LANG programming" in various engines, then assign arbitrary weights depending on the search engine used. It doesn't really measure anything, and has already been gamed intentionally, since it's so simple. Every metric is going to have its pitfalls, but at least this one seems t…

I think job listings are the least biased statistics on language popularity, as there is no too significant difference in productivity between high level languages, so the number of people required will be roughly linear to the jobs.

According to that the top 3 are js, python and java, in some order. I think it’s a good Litmus-test to fail statistics that have a different top ranking (TIOBE being beyond useless, having listed Visual Basic as 6th some time ago?!)

Re: Programming-language popularity by GitHub pull requests

#66

JS is in a different league because it solved the distribution problem. The one that everyone tried to solve, and spent big on it. Turned out you just needed a working interpreter on every device that can speak to the screen and to the internet (the browser), and the labor will appear to shape it into whatever it needs to be. This, to me, is a lesson worth hearing: sometimes the feature you think is most important, t…

It solved the run anywhere part, not the distribution one — funnily enough js-based builds can trivially fail between even major OSs.

Java is much better in that regard.

Re: Programming-language popularity by GitHub pull requests

#67
post #65

Earlier quoted context omitted.

Better than TIOBE at least, which seems to have gathered a huge amount of popularity for no good reason. Their metric is just to search for "$LANG programming" in various engines, then assign arbitrary weights depending on the search engine used. It doesn't really measure anything, and has already been gamed intentionally, since it's so simple. Every metric is going to have its pitfalls, but at least this one seems t…

I think job listings are the least biased statistics on language popularity, as there is no too significant difference in productivity between high level languages, so the number of people required will be roughly linear to the jobs. According to that the top 3 are js, python and java, in some order. I think it’s a good Litmus-test to fail statistics that have a different top ranking (TIOBE being beyond useless, havi…

having listed Visual Basic as 6th some time ago?!

That actually does not surprise me. It's considered a step up from (and often used with) Excel, which is also everywhere.

Re: Programming-language popularity by GitHub pull requests

#68
post #13
post #8

Lovely last sentence: believing c# being an underrated language. Very true, also public pull request are not friendly to dark matter enterprise software :)

I recently got into c# and it seems really nice, but the "customs and traditions" of the dotNet world horrify me (eg: never write a function when you can write three classes instead)

That culture is largely shared with Java.

Re: Programming-language popularity by GitHub pull requests

#69
post #65

Earlier quoted context omitted.

I think job listings are the least biased statistics on language popularity, as there is no too significant difference in productivity between high level languages, so the number of people required will be roughly linear to the jobs. According to that the top 3 are js, python and java, in some order. I think it’s a good Litmus-test to fail statistics that have a different top ranking (TIOBE being beyond useless, havi…

having listed Visual Basic as 6th some time ago?! That actually does not surprise me. It's considered a step up from (and often used with) Excel, which is also everywhere.

My memory is hazy, but it was ahead of goddamn javascript.

Also, the 3 lines of scripts it is used for is hardly a big amount. Excel is big, but when companies grow out of it they go for integration with “proper” applications instead.

Re: Programming-language popularity by GitHub pull requests

#70

You're all wrong. FORTH is the best language ever. You kids get off my lawn! (just kidding) JavaScript has warts, but if you drink enough, you can pretend it's Scheme. Python isn't a language but a family of languages. Guido thought it was a good idea to change the semantics AND syntax between minor revs, so... no... having to re-code my apps every two years is a deal-killer for me. Sadly, the same applies to rust. I…

Clojure has had pretty remarkable stability over the years. Maybe Common Lisp even more so, since it's based on a standard that hasn't been updated.
Post reply on HN