@jitterted@sfba.social
@jitterted@sfba.social avatar

jitterted

@jitterted@sfba.social

He/Him. Technical coach. All about Making #Java Code More Testable. #TDD #Refactoring #HexagonalArchitecture #JUnit #AssertJ

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jitterted, to random
@jitterted@sfba.social avatar

Hey #TDD Game fans!

If you were thinking of ordering your own copy of JitterTed's TDD Game, I recommend ordering soon, as I'm running low on inventory (and won't get more for another month or so).

Get your copy (or multiple copies—saves on shipping) today at https://tdd.cards

jitterted, to random
@jitterted@sfba.social avatar

This is how you should be asking for name information!

(From the We Review conference submission system:)

jitterted, to random
@jitterted@sfba.social avatar

I continue to find ChatGPT and the like to not be very helpful for writing more than a little bit of code, and even there, it's mostly helpful in areas where it's with APIs that I'm familiar with, but don't use enough to be fluent in. I also find it useful in suggesting alternatives for solutions I already have, but even there it's still pretty limited (e.g., my attempts to get it to write better ArchUnit tests that don't include my test code that didn't include the "obvious" solution).

I find it much more useful in clarifying my understanding (and therefore my explanations) of concepts. For example, I've been thinking a lot about Mental Models vs. Heuristics and where the line is. For example, are "DRY" and "SOLID" mental models or heuristics? How about "OOP"? Or, more specifically: do I model my countdown timer with pause support as a "bag of seconds that get consumed" or as "end time gets postponed by amount of pause time".

jitterted,
@jitterted@sfba.social avatar

@gdinwiddie Apparently it's in the name. A mental model is a model: a simplification and view of a reality that allows us to reason about that reality, such as by making predictions or decisions in line with the model.

e.g.: this CountdownTimer class is modeled like a sand clock or hourglass, reducing the "amount" of time at each tick. (Allows me to predict its behavior and know what will happen when it "runs out of time")

A heuristic is a prescriptive guideline, sometimes generic and without much context.

e.g.: pass the current time as a parameter to a method, instead of injecting a clock as a dependency, to make it easier to test.

(I'm sure @rebeccawb would have much more to say on this!)

jitterted, to running
@jitterted@sfba.social avatar

Finished my Half-Marathon race today in a better-than-expected time of about 2h25m. Was able to keep a pretty consistent pace, until the last mile where I ran the fastest mile of the whole event!

(Mile 12 was slow because I had to stop and fix the cushioning in my shoe.)

#Running #HalfMarathon

jitterted, to random
@jitterted@sfba.social avatar

Took me almost 2 hours to finally wrangle some HTML into what I wanted. It's frustrating only because I don't do CSS from scratch very often and there's so many tiny little things one has to know separately and how they work together.

Luckily the browser tools have gotten good enough to provide quick feedback along with help for grid and flex layouts. Juggling align-content and justify-content and so on is so much easier with immediate feedback.

jitterted,
@jitterted@sfba.social avatar

@itsjoshbruce It's the new UI for my Ensemble Timer. (I'll be showing it on my next live coding stream in 30 minutes!)

jitterted, to Java
@jitterted@sfba.social avatar

Today (on my live coding stream) I found that the best way to get ChatGPT 4 to give you a good answer is to give it an already working answer, ask it to simplify it, and then correct its wrong answer with information provided by a viewer.

Otherwise it was over an hour of trying (and failing) to get it to create a working ArchUnit test that would compile, let alone test the right thing.

#Java #ChatGPT #ArchUnit

https://www.twitch.tv/videos/2102181288

jitterted, to Java
@jitterted@sfba.social avatar

Using JetBrains tools on Mac, but upgraded to macOS 14.4? The OS update introduced a bug (see https://blogs.oracle.com/java/post/java-on-macos-14-4) affecting applications like IntelliJ IDEA, WebStorm, etc.

JetBrains has some potential workarounds while Apple and the Java community figure things out:

"If this is affecting you from running our IDEs, please consider using the workaround (https://jb.gg/workaround) we have provided. Should you encounter any other issues, please report them to us (https://jb.gg/JBR-6802)"

jitterted, to Java
@jitterted@sfba.social avatar

"Writing the #SpringBoot, #HTMX, WebSocket, etc. Tutorial"

Starts at 1pm PST | 9pm UTC

#LiveStreaming helps me focus, so this'll be a "boring" stream where you get to watch me struggle writing this darned tutorial.

Twitch: https://jitterted.stream/ and YouTube: https://youtube.com/live/NRaLOImk-aw

#Java #htmx #LiveWriting

jitterted, to Java
@jitterted@sfba.social avatar

On today's Solo stream, I'll be working on the and WebSocket portion of my Ensemble Rotation Timer.

Join me in about 25 minutes (11:30am PST | 7:30pm UTC) on Twitch: https://jitterted.stream

jitterted,
@jitterted@sfba.social avatar

🚨 Live Now 🚨

Had to restart my machine, all is good now. Join me at https://jitterted.stream

jitterted,
@jitterted@sfba.social avatar

Once again, and meant that when I hooked up the "real" timer broadcaster (using WebSockets), everything just worked.

Only took 35 lines of WebSocket code and 10 lines of configuration code and a few attributes on the HTML page. (Not counting the separate transformer code that generated the HTML.)

jitterted, to random
@jitterted@sfba.social avatar

I don't understand why folks using an LLM assistant simply accept what it proposes as a comment for a method or a class.

If it's that easy for the LLM to figure it out, then let the reader of the code ask the LLM to explain it on-demand. That way it's never out of date.

jitterted,
@jitterted@sfba.social avatar

p.s. If you need an LLM to explain some code, that's a hint that it might need some refactoring.

Having code that requires an LLM to explain it: it happens. Leaving the code that way: not great.

jitterted, to random
@jitterted@sfba.social avatar

Accidentally pushed a failing test (because I'm in the middle of changing the behavior), but it didn't go live because I have an action set to run all the tests before going to production.

How did the code get pushed with a failing test? I thought the failing test was in a file that I hadn't yet committed, instead of a file that hadn't been updated for the new behavior.

Oopsie. Lesson learned (again): I was a bit careless in starting on a new feature without making sure I was always in a shippable state. Took 2 minutes to repair and now production is updated and still working.

But also, this is why we have tests running upon push, too!

jitterted, to random
@jitterted@sfba.social avatar

Upgrading my main machine, an iMac (2020), to Sonoma. Wish me luck...

jitterted,
@jitterted@sfba.social avatar

@gdinwiddie was on Monterey, which was starting to cause some problems because I wanted to use features (Continuity Camera) and having issues syncing with my MacBook Pro (which is on Ventura), so I figured I'd jump to Sonoma, since it's been out for a while.

jitterted,
@jitterted@sfba.social avatar

@mlevison @gdinwiddie Yes, of course it depends on your expected usage.

I guess I should've clarified that when I said "I don't think" I meant "in the context of a coder/coach not doing CPU-heavy stuff" etc.

jitterted,
@jitterted@sfba.social avatar

@mlevison @gdinwiddie Good point. I personally wouldn't get anything less than an M2/3 Pro for that reason.

jitterted,
@jitterted@sfba.social avatar

@gdinwiddie @mlevison I decided on a 1TB internal SSD and 32GB RAM, as an external high-quality SSD (Samsung or Crucial) is a LOT cheaper and extremely fast.

I figured that I'd never be working on a project where I'd need more than 100GB (let alone 500GB) online. I offload the video files once I'm done with the project

I've even done editing with the files still on the external SSD and it's almost as fast (or equivalent with proxies turned on).

jitterted, to random
@jitterted@sfba.social avatar

Getting used to the #HTMX mental model of "every request returns an HTML response" can be difficult if you're used to just getting pure data back.

Amazingly, getting an HTML response makes it SO much easier to implement my rotation timer, because I can "calculate" the precise HTML that I want on the back-end, where I have the current state readily at hand. Which is, after all, the entire point of HATEOAS.

jitterted, to random
@jitterted@sfba.social avatar

I keep hearing/seeing things like this when justifying not writing a lot of automated tests: "tests often end up needing to be rewritten because the implementation changed."

And that's just not my experience at all. Though it does depend on how the word "rewritten" is interpreted. Do I have to restructure tests? Sure, if, for example, I wrap a long inside of a PlayerId class, then I'm going to have to change any test that uses/expects a long [to now use a PlayerId].

However, refactoring techniques (at least in Java with IntelliJ IDEA) can make this straightforward, often with no manual code changes.

Does anyone have concrete examples of where tests had to be rewritten because of implementation changes?

jitterted, to random
@jitterted@sfba.social avatar

On this morning's #LiveCoding stream, Mike and I ran into a situation where we couldn't figure out why a test was passing, when it should have been failing.

I was puzzled why the String.lines() method seemed to be "magically" skipping blanks lines, instead of failing the test.

Hindsight tells us we should have double-checked that the test we thought was passing was indeed being run (we later learned it wasn't).

Instead, we got sidetracked onto how the String.split() method works in the face of a blank (zero-length, non-null) string. We wrote tests that clarified our understanding of how it should handle an empty row of data, and then, being confident of that lower-level behavior, went back to the mysteriously passing test.

It turned out the test was failing, and failing for the right reason, and String.lines() was not magical at all (though the JavaDocs were not as precise as we could have used).

(And we never did end up in the debugger!)

https://youtube.com/live/uNSnRObAwHE

jitterted, to random
@jitterted@sfba.social avatar

Really liked @jessitron's article on "Being the Best"

Reminds me of "Be Useful" (to which I mentally add "to at least one person").

https://jessitron.com/2024/01/23/being-the-best/

On days when I'm live coding and there's not much chatter, or the number of viewers is low (I really try not to look!), it can be demoralizing. But I have folks tell me that a certain stream was useful to them (in some way), so that keeps me going.

Am I the best live coder? Well, my numbers certainly aren't the biggest, and it can be hard not to pay attention to them. Anyway, as Jess says: "best" in what situation?. Am I the best live coder for my regular viewers? Possibly.

I know I'm useful (if to nobody else but me), so that's enough.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • Leos
  • provamag3
  • cisconetworking
  • lostlight
  • All magazines