Submit

Back to the channels

#primate

  1. * jreicher quit (Quit: In transit)
  2. * skillnews quit (Remote host closed the connection)
  3. * skillbot quit (Read error: Connection reset by peer)
  4. * skillbot joined #primate
  5. * skillnews joined #primate
  6. * jreicher joined #primate
  7. * jreicher quit (Quit: In transit)
  8. * jreicher joined #primate
  9. nevet [ByteCode.News] Where Does The Experience Come From? - https://bytecode.news/posts/2026/11/where-does-the-experience-come-from
  10. blue dreamreal: thoughts on `var` in java? after we moved to java 21 at work, my boss signalled being against it. I largely agree, in that. a strongly typed language that hides its types is.. weird. That being said, the verbosity of potentially declaring the same type left and right is weird. a language should provide good abstractions for it
  11. blue (this is slightly related to the above article)
  12. blue (re knuth "read like essay")
  13. dreamreal It doesn't hide the types, though: var foo=new ArrayList<String>() <-- the type is right there, why would you NEED it redeclared? var isn't appropriate outside of tightly scoped functions
  14. blue cit approach: enforce left, be nice on right; Point point = { x: 1, y: 2 }; where Point is a struct with fields x and y, both i32
  15. dreamreal I'm actually kinda neutral on var
  16. dreamreal I use it but eh
  17. blue dreamreal: it doesn't in YOUR example. but it does when right is NOT a `new`
  18. blue the invariant isn't universally held
  19. blue ex: `var foo = bar.subList(0, 1);`
  20. * dreamreal nods. I am not a pedant when it comes to var. Use it when it helps, ignore it when it does not.
  21. dreamreal It is not rocket science.
  22. dreamreal if that means no var ever, well, there you are: you have to be able to read your own codebase.
  23. blue nothing is rocket science, except rocket science. however, communicating intent, and being transparent, are invaluable, I think. it's nice to know this is a List or an ArrayList *without* hovering over it
  24. blue `var` feels to much javascripty to me: in a bad way, for a statically typed language
  25. blue too much*
  26. dreamreal If you're using concrete types in your lvalue without that being significant, you're doing it wrong!
  27. dreamreal var comes from languages like JS, scala, kotlin
  28. blue ya hence List
  29. blue I'm just not very comfortable with var; or auto in c++, for that matter. I fear the gains aren't significant, and the payment is dear
  30. blue anyway, good article
  31. dreamreal Thank you.
  32. blue dreamreal: btw, another thought: "The LLM affirms" is generally, but not *universally* true. In my example, "the clanker is servile" is the more accurate observation. It will generally pushback first, if it can; especially if the conversation has little charted ground yet (your tone is less authorative). Generally speaking, it will try to accomodate a niche between its general knowledge and your wishes. But
  33. blue it doesn't affirm universally, all the time, everywhen
  34. blue In my experience*
  35. blue push back*
  36. blue authoritative*, oof, my typing is terrible
  37. * skillbot quit (Remote host closed the connection)
  38. * skillnews quit (Remote host closed the connection)
  39. * skillbot joined #primate
  40. * skillnews joined #primate
  41. blue dreamreal: anthropic IPO nov 20 or thereabouts
  42. * phaleth joined #primate
  43. blue hi phaleth
  44. phaleth hi blue
  45. blue 0.45 expected this week, god willing
  46. blue also known as the Trump #1 release
  47. blue :P
  48. blue I hope 0.46 won't be slow...
  49. blue ^ dreamreal
  50. phaleth repopack is already updated to 0.44
  51. blue yes
  52. phaleth mobile perf of primate website is still very good https://pagespeed.web.dev/analysis/https-primate-run/wyxa3mh0bb?form_factor=mobile
  53. phaleth is the website expected to become slower?
  54. * phaleth quit (Quit: phaleth)
  55. jreicher blue: I use var wherever it's possible, partly because finding where it's not possible is sometimes useful information.
  56. jreicher Ditto with <>
  57. jreicher I'm aware of (respectable) arguments against var though
  58. blue jreicher: I do use <>; also recommend by my boss. but var I do not use at all; I wouldn't use it even had he blest it
  59. blue recommended*
  60. blue as I laid out above, there are scenarios where using var obscures the type, when you read it. this isn't a big deal statically, but it makes overviewing code harder, for no good reason other than terseness
  61. blue it also violates a certain principle wherein Java is different than JS; a JS var/let/const can bind to any type; this is not the case in java; but `var` seems to suggest that. And last but not least, the name is preencumbered by other programming languages
  62. blue I think those three arguments satisfy the threshold of "not worth to use"
  63. blue dreamreal: flog is edging closer to being able to format the rcompat project; after that, primate. if you wish, I can also train it on `ui-primate`
  64. blue note that it formats in an opinionated way, much like prettier does; 2-spaces, double quotes, 80 columns
  65. blue the main adventures is that it is very fast and that it spares you from dealing with a formatting policy in your project
  66. blue it will format .ts and .js files for starts, probably .tsx/.jsx later (irrelevant in your case, you use marko)
  67. dreamreal blue: not a matter of wishes on my part, if it's useful, USE IT
  68. blue dreamreal: primate 0.45 is getting transactions, and it is absolute amaze sauce!
  69. jreicher blue: your last two points aren't relevant to Java because, quite literally, they are not about Java. It's not really a valid argument to criticise a language for confusions suffered by people proficient in other languages.
  70. blue await using tx = await db.transaction(); /* await OtherStoreINeedLocked.lock(); await Store.update(); await tx.commit();`
  71. blue a few notes about `await using` in JS: it's relatively; it uses known global symbols to allow you to clean up automatically upon leaving context; in this case, the transaction will automatically roll back if the route handler throws
  72. blue relatively new*
  73. blue it also uses async context, which is another, not new, but relatively lesser known feature of JS. it basically allows you to 'serialise' (I'm oversimplifying it) callbacks
  74. blue I learnt about it a year or two ago from systemfault, and it's really cool. this is how we 'connect' the stores to the transaction
  75. blue it's a bit of magic, but I think it's good magic (tm) there
  76. blue hm, I botched up the example, should have not written /* there
  77. blue jreicher: I disagree. language designers do not live in a vacuum. they look at prior art, and it's a perfectly valid argument to criticise them for confusings they have created, by overloading known terms
  78. blue example: TS people refer to arrays like this: [string, number] as tuples. the term is misleading: tuples are NOT arrays of a fixed length and fixed types. I suppose they borrowed the tuple term because in this case, the order of the types matters, but they are not tuples. it would have been better to call them bounded arrays or something that expresses better what they are, but the decision was made to call
  79. blue them tuples
  80. blue the java designers have choices; they could come up with a new keyword, they could choose to not introduce `var` because on how ubiquitous it is already, the fact it exists in js, is highly associated with it, and even in js itself, has very confusing semantics (hoisting). the java designers would have been better served with `auto`, which would have been just as overloaded, but at least in a very similar
  81. blue manner, in another strongly typed language
  82. blue as it stands, they made the more confusing choice
  83. blue and it's 100% on them and on no one else
  84. blue historically java already shared many confusing similarities with js; js' Date was modelled after java's. this is, of course, not java's fault, but as said, the designers do not exist in a vacuum
  85. jreicher Why is it not a valid complaint to say Java is right and the other languages are wrong? You seem to place a high value on tradition.
  86. blue because 'right' means nothing when the choices you made serve to confuse rather than elucidate
  87. jreicher What if the Java designers believe they are elucidating, and it's worth the cost?
  88. jreicher I should perhaps add this is not theoretical for me. I'm working on a language design that does exactly this.
  89. blue then they are gravely mistaken, in my eyes, in that instance. I do not know who they wanted to elucidate with such a poor choice of an historically heavily burdened term
  90. jreicher Well I can't take myself as an example. The term they chose has worked excellently for me. That's one of the reasons i use it every chance I get.
  91. jreicher ^can't^can
  92. blue in my eyes, `var` is eternally burnt by js. I might not like it, but any other language I come across, it confuses me. scala has the same situation
  93. jreicher And I don't feel the same way, because my exposure to JS is much less than my exposure to other languages.
  94. blue in your language, you might not have much or any history with JS, which is ok, in that case that term would work for you
  95. blue but for most people it wouldn't. js is extremely ubiquitous
  96. blue s/in your language/in your case/
  97. jreicher Ah, now we come to the truth of it. You believe JS has special status.
  98. blue I don't. What special status should it have?
  99. dreamreal are we still yapping about var?
  100. jreicher You believe it's special in its ubiquity. If a relatively "unpopular" language loaded a term I don't think you would be bothered.
  101. blue this works both ways: it was a mistake by JS to replicate Java Date. They are paying for this until today. Temporal is a dumpster fire whose only existence is on account of the fact Date is so terrible
  102. jreicher dreamreal: kind of. Not the concept of it (LVTI) but now just the name.
  103. dreamreal I mean, var was requested: it's relatively safe in that it can infer its type from the use; people wanted var; they got var.
  104. jreicher blue: I understand your point, but I don't believe JS has the status you think it does.
  105. blue dreamreal, that isn't the discussion at all. the discussion is whether language designers exist in a vacuum, and shouldn't look around when introducing new constructs, and using terms that are heavily encumbered
  106. dreamreal scala and kotlin, other popular JVM languages, used var (and val), so there you were
  107. jreicher Where "heavily encumbered" means "in use by a language of exceptional popularity according to the person making the criticism"
  108. blue it's not according to me, it's a quasi-universal truth
  109. jreicher According to you. :)
  110. blue "JavaScript is the most widely used language among professional developers, utilized by approximately 68.9% of them in 2025"
  111. blue this is factual, you can look it up yourself, in countless surveys and reports
  112. jreicher I understand your point. I still don't think the popularity has the special status you think it does.
  113. jreicher It's a bit like saying "most happy songs are written in a major key, so you can't use a major key for an unhappy song"
  114. jreicher Statistically true, stylistically false.
  115. blue you still haven't answered the question of why java couldn't have chosen a more appropriate identifier
  116. blue auto and others come to mind
  117. jreicher I don't know the answer. There might have been something compelling the choice of "var".
  118. blue heck, even scala's `val` would have been better. it's *way* less encumbered
  119. jreicher Check the original JEP perhaps?
  120. blue " - While it was not the most popular choice in the survey, it was
  121. blue clearly the choice that the most people were OK with. Many hated
  122. blue var/val; others hated var/let. Almost no one hated var-only."
  123. blue so basically, it was vibe-designed. great.
  124. blue https://openjdk.org/jeps/286 and https://mail.openjdk.org/pipermail/platform-jep-discuss/2016-December/000066.html (SYNTAX)
  125. nevet https://openjdk.org/jeps/286 "JEP 286: Local-Variable Type Inference" || https://mail.openjdk.org/pipermail/platform-jep-discuss/2016-December/000066.html "Update on JEP-286 (Local Variable Type Inference)"
  126. blue note that javascript isn't even mentioned as prior, whilst much more obscure languages (groovy???) are mentioned as reference
  127. blue this is ridiculous
  128. jreicher According to you
  129. blue of course it's according to me
  130. blue this is my opinion
  131. jreicher And I'm OK with you having that opinion. :)
  132. blue I understand that clearly
  133. blue but people "hating" stuff is a good way to design a language
  134. blue isn't*
  135. blue there are other considerations
  136. blue the email mentioned `var` wasn't even the most popular choice
  137. jreicher yes, but it also describes the designers' reasoning based on statistical fact. So in their opinion they had a compelling reason for "var", and it's not obvious your reasoning is superior.
  138. blue I don't care for `var` or `auto`, in this case. the way they look doesn't play a significant role for me, and honestly, nor should it for the language's designers, I would imagine
  139. blue prior art, and how real people might perceive the feature, is way more important than some commitee's aesthetic prefs
  140. blue this isn't somewhere in the aether; my boss said he rejected `var` partially on account of how javascripty it feels. this isn't evidence for a general pattern, but I can imagine other people out there in the big wide world feel the same
  141. blue maybe they're a minority. maybe java users are perfectly content with var, and there's no confusion, and wide adoption; I wouldn't know really
  142. blue but one thing you cannot argue: you cannot argue a "should" from an "is" (Ist->Soll). the fact this is already decided and out there, and people, you amongst them, use it (even happily), doesn't make it good
  143. blue I use many features of JS that I don't like...
  144. blue ugh, this reminds, TS using private members for type comparison is an abomination...
  145. blue "Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform."
  146. blue TIL...
  147. blue people *use* that?
  148. blue dreamreal: ^
  149. blue def myGroovyBean = new AGroovyBean()
  150. blue def monthMap = [ 'January' : 31, 'February' : 28, 'March' : 31 ]
  151. blue this is really nice. bit weird for map syntax, but nice
  152. dreamreal people use groovy, yes
  153. dreamreal why, I could not tell you
  154. blue I like that def keyword
  155. blue I don't like the missing semicolons
  156. blue but it looks kinda nice
  157. dreamreal groovy is a giant chunk of crap that managed to work
  158. blue LOL
  159. dreamreal the most common usage is in gradle, and it's going away there day after day
  160. blue gradle?
  161. dreamreal gradle
  162. nevet gradle is a build tool for many languages; it uses a Groovy or Kotlin DSL, and provides a configurable as well as a conventional build model. It's very terse but can be absolutely maddening if you color outside the lines at all. URL: https://gradle.org Tags: build tool, groovy, kotlin, and jvm
  163. dreamreal groovy
  164. dreamreal pffft, need a groovy factoid
  165. blue that shows you how popular it is :P
  166. dreamreal It's relatively limited in scope, most people learn enough groovy to use gradle and that's it, and even there kotlin is taking over
  167. dreamreal kotlin, incidentally, uses val and var
  168. blue like scala?
  169. blue Mein Gott dreamreal.
  170. blue anything that reminds me of that dumpster fire language is terrible
  171. dreamreal Scala is a beautiful language
  172. dreamreal scala
  173. dreamreal it needs a factoid, too
  174. dreamreal but I don't have one because of javabot :D
  175. blue I thought you hated scala like brimstone.
  176. blue Actually, I *know* you do.
  177. blue I also know why, and it's not necessarily the language, though it should be :P
  178. dreamreal I refuse to use it.
  179. dreamreal The language is great. Everything around it is awful.
  180. blue Community makes the language, I guess?
  181. dreamreal Community makes the ecosystem.
  182. blue This is kind of the reason I like Java, btw. The people are so much better than other communities I know.
  183. dreamreal The language is quite capable, quite usable, quite nice, really. The community ruins it.
  184. blue I *really* don't like Java as a language (this is no secret).
  185. blue But I love the community.
  186. dreamreal Take every negative trope about argumentative Jews, amplify it by 700, add in toddler-level emotional tantrums and add knives. You'll have a gentle approximation.
  187. blue Compared to basically any community I know... first and foremost JS, the Java community is a dream. The people feel mature and no toddlers.
  188. dreamreal I can point out toddlers if you like :D
  189. blue The JS community is full of ego-laden toddlers.
  190. dreamreal lombok
  191. blue lol
  192. dreamreal grrr, no lombok factoid either
  193. blue What on god's green earth is lombok?
  194. dreamreal javabot's factoid database sucks compared to nevet's features, but it's far more developed
  195. blue yo ucould migrate the data..
  196. dreamreal https://projectlombok.org/
  197. nevet Project Lombok
  198. dreamreal I could, yes, but I don't want to, nevet is not intended to compete with javabot and it's less "#java-owned"
  199. blue anyway: I truly love the Java community in terms of people.
  200. blue I dislike the language very much indeed, but the people/culture make it worthwhile
  201. dreamreal A language is what it does
  202. dreamreal I find java usually pretty verbose myself, I prefer writing kotlin
  203. blue the JS situation is reserved: I *love* the language, the community... MUCH less
  204. blue reversed*
  205. blue the TS community is somewhat more mature
  206. * dreamreal still resents hasOwnProperty()
  207. blue yes, you shouldn't be using that
  208. dreamreal I don't know if JS has made that more palatable
  209. dreamreal it's been a while
  210. * blue points to Object.hasOwn
  211. dreamreal So you can't override that?
  212. blue override what?
  213. dreamreal That was always the problem with hasOwnProperty
  214. blue you wouldn't be using it
  215. dreamreal You ended up having to use something like Object.prototype.hasOwnProperty()
  216. blue yes. and the short sytnax today is Object.hasOwn(obj, prop)
  217. dreamreal Ah, right, so you're calling it directly via Object
  218. blue the reason people using the prototype directly doesn't have much to do with this particular method
  219. blue it's just js objects can overwrite anything
  220. blue obj = { hasOwnProperty() { console.log("nope"); return -1; } };
  221. blue and Object.hasOwn doesn't really fix it, either
  222. blue because you can do Object.hasOwn = () => {}
  223. dreamreal I thought that's why you use the prototype
  224. blue also I believe Object.hasOwn deals with null and what not better
  225. systemfault People use objects as dictionaries. Nobody use Object as a dictionary
  226. blue sorry, I mean null-prototype objects
  227. systemfault Ahh, most people don't even know they exist.
  228. blue const obj = Object.create(null);
  229. blue this is the 'clean' way to create a dictionary in JS, because it doesn't carry all the Object.prototype baggage
  230. dreamreal aight, off

Search posts