logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git

Enough-to-decide.md (6280B)


  1. ---
  2. date: 2019-09-08
  3. layout: post
  4. title: How I decide between many programming languages
  5. tags: [languages]
  6. ---
  7. I have a few old standards in my toolbelt that I find myself calling upon most
  8. often, but I try to learn enough about many programming languages to reason
  9. about whether or not they're suitable to any use-case I'm thinking about. The
  10. best way is to learn by doing, so getting a general impression of the utility of
  11. many languages helps equip you with the knowledge of whether or not they'd be
  12. useful for a particular problem even if you don't know them yet.
  13. Only included are languages which I feel knowledgable enough about to comment
  14. on, there are many that aren't here and which I encourage you to research.
  15. ## C
  16. Pros: good performance, access to low-level tooling, useful in systems
  17. programming, statically typed, standardized and venerable, the lingua franca,
  18. universal support on all platforms.[^1]
  19. [^1]: Except one, and it can go suck an egg for all I care.
  20. Cons: string munging, extensible programming, poor availability of ergonomic
  21. libraries in certain domains, has footguns, some programmers in the wild think
  22. the footguns are useful.
  23. <style>
  24. .bullshit {
  25. color: white;
  26. font-style: italic;
  27. font-weight: bold;
  28. text-shadow: -1px -1px 0 #000,
  29. 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  30. }
  31. </style>
  32. ## Go
  33. Pros: fast, conservative, good package manager and a healthy ecosystem, standard
  34. library is well designed, best in class for many problems, has a spec and
  35. multiple useful implementations, easy interop with C.
  36. Cons: the runtime is too complicated, no distinction between green threads and
  37. real threads (meaning all programs deal with the problems of the latter).
  38. ## Rust
  39. Pros: it's <em class="bullshit">SAFE</em>, useful for systems programming,
  40. better than C++, ecosystem which is diverse but just short of the npm disease,
  41. easy interop with C.
  42. Cons: far too big, non-standardized, only one meaningful implementation.
  43. ## Python
  44. Pros: easy and fast to get things done, diverse package ecosystem of reasonably
  45. well designed packages, deeply extensible, useful for server-side web software.
  46. Cons: bloated, poor performance, dynamically typed, cpython internals being
  47. available to programmers has led to an implementation monoculture.
  48. ## JavaScript
  49. *\* and all of its derivatives, which ultimately inherit its problems.*
  50. Pros: functional but with an expressive and C-like syntax, ES6 improved on many
  51. fronts, async/await/promises are well designed, no threading.
  52. Cons: dynamic types, package ecosystem is a flaming pile, many JS programmers
  53. aren't very good at it and they make ecosystem-defining libraries anyway, born
  54. in web browsers and inherited their many flaws.
  55. ## Java
  56. *\* and all of its derivatives, which ultimately inherit its problems.*
  57. Pros: has had enough long-term investment to be well understood and reasonably
  58. fast.
  59. Cons: hella boilerplate, missing lots of useful things, package management, XML
  60. is everywhere, not useful for low-level programming (this applies to all
  61. Java-family languages).
  62. ## C#
  63. Pros: less boilerplate than Java, reasonably healthy package ecosystem, good
  64. access to low level tools for interop with C, async/await started here.
  65. Cons: ecosystem is in turmoil because Microsoft cannot hold a singular vision,
  66. they became open-source too late and screwed over Mono.
  67. ## Haskell
  68. *\* and every other functional-oriented programming language in its class, such
  69. as elixir, erlang, most lisps, even if they resent being lumped together*
  70. Pros: it's <em class="bullshit">FUNCTIONAL</em>, reasonably fast, useful
  71. when the answer to your problem is more important than the means by which you
  72. find it, good for research-grade[^2] compilers.
  73. Cons: it's <em class="bullshit">FUNCTIONAL</em>, somewhat inscrutable, awful
  74. package management, does not fit well into its environment, written by people
  75. who wish the world could be described with a pure function and design software
  76. as if it could.
  77. [^2]: but not production-grade.
  78. ## Perl
  79. Pros: [entertaining][perl-configure], best in class at regexes/string munging,
  80. useful for making hacky kludges when such solutions are appropriate.
  81. [perl-configure]: https://github.com/Perl/perl5/blob/blead/Configure
  82. Cons: inscrutable, too extensible, too much junk/jank.
  83. ## Lua
  84. Pros: embeddable & easily plugged into its host, fairly simple, portable.
  85. Cons: 1-based indexing is objectively bad, the upstream maintainers are kind of
  86. doing their own thing and no one really likes it.
  87. ## POSIX Shell scripts
  88. Pros: nothing can string together commands better, if you learn 90% of it then
  89. you can make pretty nice and expressive programs with it for a certain class of
  90. problem, standardized (I do not use bash).
  91. Cons: most people learn only 10% of it and therefore make pretty bad and
  92. unintuitive programs with it, not useful for most complex tasks.
  93. ---
  94. Disclaimer: I don't like the rest of these programming languages and would not
  95. use them to solve any problem. If you don't want your sacred cow gored, leave
  96. here.
  97. ## C++
  98. Pros: none
  99. Cons: ill-defined, far too big, <em class="bullshit">
  100. Object Oriented Programming</em>, loads of baggage, ecosystem that buys into
  101. its crap, enjoyed by bad programmers.
  102. ## PHP
  103. Pros: none
  104. Cons: every PHP programmer is bad at programming, the language is designed to
  105. accommodate them with convenient footguns (or faceguns) at every step, and the
  106. ecosystem is accordingly bad. No, PHP7 doesn't fix this. Use a real programming
  107. language, jerk.
  108. ## Ruby
  109. Pros: It's both <em class="bullshit">ENTERPRISE</em> and <em
  110. class="bullshit">HIP</em> at the same time, and therefore effective at herding a
  111. group of junior to mid-level programmers in a certain direction, namely towards
  112. your startup's exit.
  113. Cons: bloated, awful performance, before Node.js took off this is what all of
  114. those programmers used.
  115. ## Scala
  116. Pros: more expressive than Java, useful for <em class="bullshit">Big
  117. Data</em> problems.
  118. Cons: Java derivative, type system requires a PhD to comprehend, too siloed from
  119. Java, meaning it gets all of the disadvantages of being a Java ecosystem member
  120. but few of the advantages. The type system is so needlessly complicated that it
  121. basically cripples the language on its own merits alone.