ByteCode.NewsSubmit
Use quotes for an exact word.

Subscribe

RSSPodcast
Log in

Chat Logs

  1. nevet[ByteCode.News] Where Does The Experience Come From? - https://bytecode.news/posts/2026/11/where-does-the-experience-come-from
  2. bluedreamreal: 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
  3. blue(this is slightly related to the above article)
  4. blue(re knuth "read like essay")
  5. dreamrealIt 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
  6. bluecit 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
  7. dreamrealI'm actually kinda neutral on var
  8. dreamrealI use it but eh
  9. bluedreamreal: it doesn't in YOUR example. but it does when right is NOT a `new`
  10. bluethe invariant isn't universally held
  11. blueex: `var foo = bar.subList(0, 1);`
  12. * dreamreal nods. I am not a pedant when it comes to var. Use it when it helps, ignore it when it does not.
  13. dreamrealIt is not rocket science.
  14. dreamrealif that means no var ever, well, there you are: you have to be able to read your own codebase.
  15. bluenothing 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
  16. blue`var` feels to much javascripty to me: in a bad way, for a statically typed language
  17. bluetoo much*
  18. dreamrealIf you're using concrete types in your lvalue without that being significant, you're doing it wrong!
  19. dreamrealvar comes from languages like JS, scala, kotlin
  20. blueya hence List
  21. blueI'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
  22. blueanyway, good article
  23. dreamrealThank you.
  24. bluedreamreal: 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
  25. blueit doesn't affirm universally, all the time, everywhen
  26. blueIn my experience*
  27. bluepush back*
  28. blueauthoritative*, oof, my typing is terrible
  29. bluedreamreal: anthropic IPO nov 20 or thereabouts
  30. bluehi phaleth
  31. phalethhi blue
  32. blue0.45 expected this week, god willing
  33. bluealso known as the Trump #1 release
  34. blue:P
  35. blueI hope 0.46 won't be slow...
  36. blue^ dreamreal
  37. phalethrepopack is already updated to 0.44
  38. blueyes
  39. phalethmobile perf of primate website is still very good https://pagespeed.web.dev/analysis/https-primate-run/wyxa3mh0bb?form_factor=mobile
  40. phalethis the website expected to become slower?
  41. jreicherblue: I use var wherever it's possible, partly because finding where it's not possible is sometimes useful information.
  42. jreicherDitto with <>
  43. jreicherI'm aware of (respectable) arguments against var though
  44. bluejreicher: 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
  45. bluerecommended*
  46. blueas 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
  47. blueit 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
  48. blueI think those three arguments satisfy the threshold of "not worth to use"
  49. bluedreamreal: 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`
  50. bluenote that it formats in an opinionated way, much like prettier does; 2-spaces, double quotes, 80 columns
  51. bluethe main adventures is that it is very fast and that it spares you from dealing with a formatting policy in your project
  52. blueit will format .ts and .js files for starts, probably .tsx/.jsx later (irrelevant in your case, you use marko)
  53. dreamrealblue: not a matter of wishes on my part, if it's useful, USE IT
  54. bluedreamreal: primate 0.45 is getting transactions, and it is absolute amaze sauce!
  55. jreicherblue: 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.
  56. blueawait using tx = await db.transaction(); /* await OtherStoreINeedLocked.lock(); await Store.update(); await tx.commit();`
  57. bluea 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
  58. bluerelatively new*
  59. blueit 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
  60. blueI 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
  61. blueit's a bit of magic, but I think it's good magic (tm) there
  62. bluehm, I botched up the example, should have not written /* there
  63. bluejreicher: 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
  64. blueexample: 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
  65. bluethem tuples
  66. bluethe 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
  67. bluemanner, in another strongly typed language
  68. blueas it stands, they made the more confusing choice
  69. blueand it's 100% on them and on no one else
  70. bluehistorically 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
  71. jreicherWhy 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.
  72. bluebecause 'right' means nothing when the choices you made serve to confuse rather than elucidate
  73. jreicherWhat if the Java designers believe they are elucidating, and it's worth the cost?
  74. jreicherI should perhaps add this is not theoretical for me. I'm working on a language design that does exactly this.
  75. bluethen 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
  76. jreicherWell 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.
  77. jreicher^can't^can
  78. bluein 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
  79. jreicherAnd I don't feel the same way, because my exposure to JS is much less than my exposure to other languages.
  80. bluein your language, you might not have much or any history with JS, which is ok, in that case that term would work for you
  81. bluebut for most people it wouldn't. js is extremely ubiquitous
  82. blues/in your language/in your case/
  83. jreicherAh, now we come to the truth of it. You believe JS has special status.
  84. blueI don't. What special status should it have?
  85. dreamrealare we still yapping about var?
  86. jreicherYou believe it's special in its ubiquity. If a relatively "unpopular" language loaded a term I don't think you would be bothered.
  87. bluethis 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
  88. jreicherdreamreal: kind of. Not the concept of it (LVTI) but now just the name.
  89. dreamrealI mean, var was requested: it's relatively safe in that it can infer its type from the use; people wanted var; they got var.
  90. jreicherblue: I understand your point, but I don't believe JS has the status you think it does.
  91. bluedreamreal, 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
  92. dreamrealscala and kotlin, other popular JVM languages, used var (and val), so there you were
  93. jreicherWhere "heavily encumbered" means "in use by a language of exceptional popularity according to the person making the criticism"
  94. blueit's not according to me, it's a quasi-universal truth
  95. jreicherAccording to you. :)
  96. blue"JavaScript is the most widely used language among professional developers, utilized by approximately 68.9% of them in 2025"
  97. bluethis is factual, you can look it up yourself, in countless surveys and reports
  98. jreicherI understand your point. I still don't think the popularity has the special status you think it does.
  99. jreicherIt'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"
  100. jreicherStatistically true, stylistically false.
  101. blueyou still haven't answered the question of why java couldn't have chosen a more appropriate identifier
  102. blueauto and others come to mind
  103. jreicherI don't know the answer. There might have been something compelling the choice of "var".
  104. blueheck, even scala's `val` would have been better. it's *way* less encumbered
  105. jreicherCheck the original JEP perhaps?
  106. blue" - While it was not the most popular choice in the survey, it was
  107. blueclearly the choice that the most people were OK with. Many hated
  108. bluevar/val; others hated var/let. Almost no one hated var-only."
  109. blueso basically, it was vibe-designed. great.
  110. bluehttps://openjdk.org/jeps/286 and https://mail.openjdk.org/pipermail/platform-jep-discuss/2016-December/000066.html (SYNTAX)
  111. nevethttps://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)"
  112. bluenote that javascript isn't even mentioned as prior, whilst much more obscure languages (groovy???) are mentioned as reference
  113. bluethis is ridiculous
  114. jreicherAccording to you
  115. blueof course it's according to me
  116. bluethis is my opinion
  117. jreicherAnd I'm OK with you having that opinion. :)
  118. blueI understand that clearly
  119. bluebut people "hating" stuff is a good way to design a language
  120. blueisn't*
  121. bluethere are other considerations
  122. bluethe email mentioned `var` wasn't even the most popular choice
  123. jreicheryes, 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.
  124. blueI 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
  125. blueprior art, and how real people might perceive the feature, is way more important than some commitee's aesthetic prefs
  126. bluethis 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
  127. bluemaybe 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
  128. bluebut 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
  129. blueI use many features of JS that I don't like...
  130. blueugh, this reminds, TS using private members for type comparison is an abomination...
  131. blue"Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform."
  132. blueTIL...
  133. bluepeople *use* that?
  134. bluedreamreal: ^
  135. bluedef myGroovyBean = new AGroovyBean()
  136. bluedef monthMap = [ 'January' : 31, 'February' : 28, 'March' : 31 ]
  137. bluethis is really nice. bit weird for map syntax, but nice
  138. dreamrealpeople use groovy, yes
  139. dreamrealwhy, I could not tell you
  140. blueI like that def keyword
  141. blueI don't like the missing semicolons
  142. bluebut it looks kinda nice
  143. dreamrealgroovy is a giant chunk of crap that managed to work
  144. blueLOL
  145. dreamrealthe most common usage is in gradle, and it's going away there day after day
  146. bluegradle?
  147. dreamrealgradle
  148. nevetgradle 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
  149. dreamrealgroovy
  150. dreamrealpffft, need a groovy factoid
  151. bluethat shows you how popular it is :P
  152. dreamrealIt's relatively limited in scope, most people learn enough groovy to use gradle and that's it, and even there kotlin is taking over
  153. dreamrealkotlin, incidentally, uses val and var
  154. bluelike scala?
  155. blueMein Gott dreamreal.
  156. blueanything that reminds me of that dumpster fire language is terrible
  157. dreamrealScala is a beautiful language
  158. dreamrealscala
  159. dreamrealit needs a factoid, too
  160. dreamrealbut I don't have one because of javabot :D
  161. blueI thought you hated scala like brimstone.
  162. blueActually, I *know* you do.
  163. blueI also know why, and it's not necessarily the language, though it should be :P
  164. dreamrealI refuse to use it.
  165. dreamrealThe language is great. Everything around it is awful.
  166. blueCommunity makes the language, I guess?
  167. dreamrealCommunity makes the ecosystem.
  168. blueThis is kind of the reason I like Java, btw. The people are so much better than other communities I know.
  169. dreamrealThe language is quite capable, quite usable, quite nice, really. The community ruins it.
  170. blueI *really* don't like Java as a language (this is no secret).
  171. blueBut I love the community.
  172. dreamrealTake 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.
  173. blueCompared to basically any community I know... first and foremost JS, the Java community is a dream. The people feel mature and no toddlers.
  174. dreamrealI can point out toddlers if you like :D
  175. blueThe JS community is full of ego-laden toddlers.
  176. dreamreallombok
  177. bluelol
  178. dreamrealgrrr, no lombok factoid either
  179. blueWhat on god's green earth is lombok?
  180. dreamrealjavabot's factoid database sucks compared to nevet's features, but it's far more developed
  181. blueyo ucould migrate the data..
  182. dreamrealhttps://projectlombok.org/
  183. nevetProject Lombok
  184. dreamrealI could, yes, but I don't want to, nevet is not intended to compete with javabot and it's less "#java-owned"
  185. blueanyway: I truly love the Java community in terms of people.
  186. blueI dislike the language very much indeed, but the people/culture make it worthwhile
  187. dreamrealA language is what it does
  188. dreamrealI find java usually pretty verbose myself, I prefer writing kotlin
  189. bluethe JS situation is reserved: I *love* the language, the community... MUCH less
  190. bluereversed*
  191. bluethe TS community is somewhat more mature
  192. * dreamreal still resents hasOwnProperty()
  193. blueyes, you shouldn't be using that
  194. dreamrealI don't know if JS has made that more palatable
  195. dreamrealit's been a while
  196. * blue points to Object.hasOwn
  197. dreamrealSo you can't override that?
  198. blueoverride what?
  199. dreamrealThat was always the problem with hasOwnProperty
  200. blueyou wouldn't be using it
  201. dreamrealYou ended up having to use something like Object.prototype.hasOwnProperty()
  202. blueyes. and the short sytnax today is Object.hasOwn(obj, prop)
  203. dreamrealAh, right, so you're calling it directly via Object
  204. bluethe reason people using the prototype directly doesn't have much to do with this particular method
  205. blueit's just js objects can overwrite anything
  206. blueobj = { hasOwnProperty() { console.log("nope"); return -1; } };
  207. blueand Object.hasOwn doesn't really fix it, either
  208. bluebecause you can do Object.hasOwn = () => {}
  209. dreamrealI thought that's why you use the prototype
  210. bluealso I believe Object.hasOwn deals with null and what not better
  211. systemfaultPeople use objects as dictionaries. Nobody use Object as a dictionary
  212. bluesorry, I mean null-prototype objects
  213. systemfaultAhh, most people don't even know they exist.
  214. blueconst obj = Object.create(null);
  215. bluethis is the 'clean' way to create a dictionary in JS, because it doesn't carry all the Object.prototype baggage
  216. dreamrealaight, off