Not OP, and not sure about OCaml and Haskell, but one example where Java's type system is unhelpful/incorrect is mutable subtyping.
E.g. Java assumes Cat[] is a subtype of Animal[]. But this only holds when reading from the array. The correct behavior would be:
- `readonly Cat[]` is a subtype of `Animal[]`
- `writeonly Cat[]` is a supertype of `Animal[]`
- `readwrite Cat[]` has no relationship with `Animal[]`
But Java doesn't track whether a reference is readable or writable. The runtime makes every reference read-write, but the type checker assumes every reference is read-only.
This results in both
- incorrect programs passing the type checker, e.g. when you try to write an Animal to an Animal[] (which, unbeknown to you, is actually a Cat[]), you get a runtime exception
- correct programs not passing the type checker, e.g. passing a Animal[] into an writeCatIntoArray(Cat[] output) function is a type error, even though it would be safe.
(Although all that is assuming you're actually following the Liskov substitution principle, or in other words, writing your custom subtypes to follow the subtyping laws that the type checker assumes. You could always override a method to throw UnsupportedOperationException, in which case the type checker is thrown out of the window.)
Interestingly, AFAIK Typescript makes these types both subtypes and supertypes at the same time, in the interest of not rejecting any correct programs. But that also allows even more incorrect programs.
Did you mean arrays instead of lists? Arrays behave as you describe (with ArrayStoreException when you write a wrong value to an array). List<> is invariant WRT its type parameter.
I can't make a Mappable interface, and have my classes implement map(f). Because map(f) will necessarily return Mappable, not my class itself. So no method chaining for me.
Also null. Yeah I know it's contentious. People don't want to let go of it. Since learning to hate null, I've also lost any nuance in my ability to explain why it's bad. Because I know longer see it as 'subtly-bad' or 'might lead to bugs'. It's just plain, on-the-surface-wrong. One might as well have named it 'wrong' rather than 'null'.
'Null' is the thing which it isn't. I can write business logic that says every Person has a Name. Once you admit null into the mix, I can no longer make that simplest of statements. My autocomplete now lies to me, because person may or may not implement the method .name().
"But how will I half-arse instantiate a Person? I don't have a Name, yet I want to tell the computer I have a Person?" It makes me happy that you can't.
"I wrote a function that promises to return a Person. I was unable to return a Person. How can I tell the computer I'm returning a Person even though I'm not?" Glad that you can't.
Avoiding null is one of those things the FA complains about — you'll make your language three times as complicated to avoid it, and that might not be a good trade-off.
It's not really about the implementation of Java (might be bad, I don't know).
It is the specification.
- People talked about null being an issues and that is a big one.
- The entire idea of OOP extremism Java implemented was a mistake - though just a consequence of the time it was born in. Much has been written about this topic by many people.
- Lacking facilities and really design for generic programming (also related to the OOP extremism and null issue
So much more more you can find out with Google or any LLM
I’m an adult with combined type ADHD.
I feel very strongly that any device which has other apps is a terrible tool for ADHD management and organization. No matter how well intentioned, and I know that you are.
One needs to spend less time on devices. Go analogue. Pen and paper.
The best tool that I have found is the Bullet Journal Method. It takes time, effort, and there is a learning curve. The ROI is higher than from any app. No other tool has impacted my life and productivity more.
That said, I have found some tertiary apps to be helpful, though my BuJo is my compass. Endel for time boxing/Pomodoro, and sleep.
Headspace for guided meditation.
No, it doesn’t have to be aesthetic, with pretty lettering and doodles (as seen in social media).
> I feel very strongly that any device which has other apps is a terrible tool for ADHD management and organization.
I strongly disagree. While that approach may work for you, it did not work for me. I do not believe there is a one size fits all approach in this regard. My limitation is far more on the executive side than it is with distractibility or addiction, my devices present no sigificant negative impact in that regard.
> One needs to spend less time on devices. Go analogue. Pen and paper. The best tool that I have found is the Bullet Journal Method.
That may be true for you, but device usage itself is not a problem for me. I spent significant time attempting bullet journaling and found it ineffective, it increased cognitive overhead and time spent managing the system rather than executing tasks. Additionally, handwriting based systems are not well suited to me due to motor limitations from an incomplete spinal cord injury.
I use a single Kanban board in Trello to manage my entire life. It works precisely because it is digital. Always accessible, frictionless, and available wherever I am. For me, that constant availability is essential.
> The ROI is higher than from any app.
For you, perhaps. For me, adopting a Kanban based digital system was life changing. As you suggested of your own system, no other tool has had a greater positive impact on my organisation or productivity than Trello. The only thing which has had even remotely the same level of impact is medication.
For Trello itself (kanban) I think the reason it worked when nothing else did is due to its visual/spacial nature, combined with WIP limits and low friction capture. But it didnt truly click until I could have it with me at all times. Whenever I notice I've gotten distracted or drifted, no matter where I am I know i'm one "click" away effectively from re-orienting myself on what I was supposed to be doing and what matters.
Glad you found the system that works for you! Not an easy feat and not many folks have gotten there. And thanks for sharing your exact system, no doubt it'll help people here.
The doodles you're seeing is probably for our other product and social media. The new Indy app has a celestial theme in dark mode, and we'll likely make other modes later! For a lot of our members, they've noted that the calming nature of it helps them settle into a reflective state (vs. our coaching app is more bright and uplifting!).
No. Analogue is the worst for ADHD. Physical notes are the easiest thing to neglect and forget about. It becomes another brick in the massive stack of unopened letters and random papers.
Exactly. I've long held the sentiment, that pure functional programming is easier than imperative programming. The only hard part, is switching from an imperative mindset.