And I feel a kinship with current LLMs with small context sizes.
It makes me wonder if it's related to the hunter-gatherer origin hypothesis. In that scenario covering large tracks of land was beneficial and that ability can be used to mentally map code. The flop side this also leads to distractibility and boredom paying attention to monotonous details.
Surely this is a general problem and not specific to programmers with ADD? Or do you mean you are relatively worse at "needle sting debugging"?
You second paragraph is just sane things in general. I wish your mindset was more common among my colleagues ...
To some extent, everyone gets mild versions of ADHD symptoms, especially if tired/bad nutrition/no exercise, etc.
ADHD is when these symptoms harm quality of life significantly across many domains and since you were prepubescent (it's a brain malformation, not a series of bad habits)
People without ADHD have a generally-working motivation/reward system which is undergirded partially by dopamine. This neurotransmitter is relatively low in ADHD brains, which seems to lead to signal:noise issues. That’s likely a cause of having a highly distractible baseline state, but also leads to bursts of dopamine seeming more salient and arousing. You have a harder time regulating motivation and evaluating perceived rewards.
A lot of what happens in the brain is based on relative states. If your dopamine is always low, something making it spike will seem more interesting than it necessarily should. If your dopamine trends higher, you’re going to have an easier time regulating interest, motivation, and an ability to transition through things you need to do — particularly things you don’t want to do.
The inverse of a dopamine spike is a dopamine drop. This impacts the brain in important ways as well. In a person with ADHD, going from a high to a low can often cause serious declines in mood and energy. In a more typical brain, the same effects are present but less severe.
So while these are all normal challenges people face because they’re the product of the same brain mechanics, a low dopamine baseline makes these mechanics more extreme in people with ADHD. They are primed for distraction and clinging to things which increase their dopamine. This could be video games, relationships, drugs, hobbies, etc. It could even be work too. They’re also primed far harder falls from their highs. This extreme oscillation often means some aspect of life suffers due to a lack of balance. That’s why it can be a disability.
Hopefully that helps explain the quantitative aspect.
I'm almost 40 and just realizing that I probably have some version of ADHD and your description of the Dopamine roller-coaster fits perfectly with my experience, both good and bad.
It’s very diverse. It isn’t always bad, but often is, and even people with god outcomes can often benefit from the insight of understanding why they’re different.
Looking forward to when a portable EEG monitors are available at an affordable price.
An (imperfect) analogy I saw recently was it’s like talking about debt between someone in a middle class household (non-ADHD people) and someone in a poverty household. Sure a lot of the problems are similar in both word and shape, but the middle class person can’t imagine “had to take out a pay day loan to buy used tires from joes tire shack” and the poverty person can’t understand “we had to replace the AC this year so we cut back our spending, and had to skip the family reunion at the beach until the credit card was paid off”.
How do you find these teams? In my 11 years, I don't think I've ever found myself on a greenfield project.
I should perhaps disclaim that while this worked perfectly for me for close to a decade and I was never without work for more than a couple weeks at a time, I have currently been unemployed for a few months and have had a considerably more difficult time than at any point in the past.
So much this. Fuck OOP-inheritance-thinking for spreading implementations to so many files.
You have all the logic in one place, and if you forget to handle a case in most languages you're forced by the compiler to be explicit.
Tangent: ADHD is strange. I have it too, and yet when it comes to reading my symptoms appear to be the exact opposite (when I was younger I could not stop reading books until I finished them, even if I ended up skipping an entire night of sleep for it). I wouldn't be surprised if in the next decades, as we learn more about it, this diagnosis will split into multiple different comorbid disorders with overlapping symptoms.
But you've also got to consider personal taste - hyperfixation happens when it's something you're interested in. Someone else might hyperfocus on video games, or trawling ebay, or researching a topic.
Don't get me wrong, I read all the time now, but I can't burn through books like I did back then, I don't read faster than I can subvocalize, and it can be challenging to stay focused or retain what I read.
A few years ago, I spent about nine months reading a single book about Napoleon. It was pretty long, detailed, and complex, so it wasn't intended to be an easy/quick read, but it still took me a pretty long time to get through it while giving it the proper focus. But the annoying part is that a couple years later, I struggle to remember details about Napoleon. I know, memory needs to be practiced and reinforced and such, but I had hoped the length of my immersion in the subject would've done a bit more in this area on its own.
I realized that and did something about it, but I didn’t allow myself to enjoy a book for around 10 years. Not sure if that resonates with you (I hope not!) but I figured I’d mention it just in case. I was totally unaware of what I was doing at the time.
I found a hack into keeping up with my reading, which is to use a kindle with wireless page turner attached to a mechanical arm.
I’m able to fall asleep reading like I used to and slowly make my way through extended science fiction. The effort to read is very low, the last page always set.
I don’t often stay up way past bedtime from reading anymore, but it did happen this year for me reading Symphony of Secrets by Brendan Slocumb.
I can't really 'break' on the computer because that's where the work is happening. But I can push down the laptop screen for a little while and read for 10 minutes, no problem. A physical book is a different modality, different everything, and sticky enough to keep my interest but not so sticky I'll lose an hour without noticing.
Do that 2 or 3 times during your workday and you'll be finishing books in no time.
I’ve drilled it into my head that if I’m not reading or focused on quality sleep, everything else will suffer. It’s been true for decades and I’ve been disappointed by finding it out again enough times that I generally believe it now.
No phone, no late night computer/work, just reading if I’m not asleep and otherwise sleep. It’s so important.
I don’t claim to be a particularly intelligent person by any means. This change has done wonders for being less stupid, however. Reading really does stimulate your brain in such positive ways. You probably won’t notice when you’ve stopped for a while and that’s a serious shame; we’d probably all read more if it was more obvious how much better we are when we do it. And of course the sleep hygiene plays a huge role too.
Occasionally I fall off the wagon for a week or two due to family stuff. To be honest, my wife hates that I read at night, and that’s friction as well. When your brain has a tendency to work against you though, you really do need to take action to build routines that keep you sane and on a good trajectory. My wife would hate it more if I allowed myself to sleep less and indulge in other things in the evening, so this is a lesser evil that keeps my cup full so to speak and helps me stay on track.
ADHD is all about the pit of success and elimination of problematic systems or temptations, in my experience. Make it hard to fail.
I wonder if it has to do with the mental burden we start to accumulate in transitioning to adulthood. Much easier to hyperfocus on books when we don't have the weight of finances, careers, complex relationships, etc.
I do have a pet theory that many of us ADHDers develop habits to overcompensate but do so early enough that we don't realise they're learned. For example my room growing up was always super tidy, I literally never had to be asked to clean it and I'd know straight away if someone had been in while I was out. That really confused me when I got diagnosed but in hindsight it's because without everything having a consistent place I'd constantly lose things and never find anything.
The good news is that "smallness of bran buffer" doesn't matter very much if you are trying to implement anything non-trivial. Most useful software is so complex that it's impossible to keep all of it in your head in any case. But we can divide and conquer complexity without holding too much in our limited human heads at any single moment in time.
The real art is how you divide and conquer. Having a bigger "buffer" merely delays (slightly) the point at which you have no other choice but to start doing just that.
It maybe doesn’t matter for relative performance versus other developers but it does matter for the individual.
Having frequent context switches just to keep on top of your work can be really draining.
How much it matters also really depends on the languages you’re working in. Taking a couple languages I use regularly for example:
Python (or any dynamic language ), as much as I enjoy it, can be a nightmare because of how dynamic it is. You have to keep way more of any given app in your head at a time.
Rust by comparison (or any similarly static language) is much easier for me to just focus on the very local code without caring about the rest.
Type checking is analysis post facto and doesn’t account for dynamicism of classes.
The very ability to self modify an instance at any time or use __getattr__ makes it incredibly dynamic.
It also doesn’t account for every dependency having accurate type hints or any at all.
My mistake for not being clear. Obviously the python interpreter itself does not do any type checks.
It's sort if like how modern development with javascript is used with an external compiler of another language (typescript) that compiles a typed language into one without types.
An object can conform to a type in name only, but that’s not enough to tell you what methods or attributes exist on it at any given time.
In practice, your rebuttal almost never occurs. I believe these type checkers can detect monkey patching and trigger a type error or warning.
There are tons of libraries in many companies that use dynamic attribute lookups for efficiency reasons, when adapting to different data sources and the like. Or pass through lookups on child classes. Or they’re dynamically looked up on bound libraries from other languages and frameworks.
And these type checkers cannot detect it. Python’s dictionary access is not guarded by the type checkers and neither is __getattr__.
If you’re making such wide sweeping statements you need to be more familiar with the subject matter.
My experience is different from yours. I'm ascribing my experience to reality not to your experience. I think my experience is more inline with reality then yours is given the metrics.
>And these type checkers cannot detect it. Python’s dictionary access is not guarded by the type checkers and neither is __getattr__.
For this code:
from typing import Dict
x: Dict[str, int] = {2: "hello"}
print(x[3])
class Hello:
def __init__(self) -> None:
self.x = 1
b = Hello()
b.y = 2
c: str = b.x
print(b.y)
generates this: main.py:2: error: Dict entry 0 has incompatible type "int": "str"; expected "str": "int" [dict-item]
main.py:3: error: Invalid index type "int" for "dict[str, int]"; expected type "str" [index]
main.py:8: error: "Hello" has no attribute "y" [attr-defined]
main.py:9: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
main.py:10: error: "Hello" has no attribute "y" [attr-defined]
Found 5 errors in 1 file (checked 1 source file)
Monkey patching is checked. Dictionary access is checked. You are completely Wrong on these statements.__getattr__ is type checked too as long as you type the method signature, I have seen some wierdness around this area for type checkers but that's not the main problem. I understand where you are getting at with __getattr__. When you use this you're essentially creating something akin to a function with a string as a parameter. The contents of a string can't be type checked and if all methods are defined this way on a class none of it can be checked.
>If you’re making such wide sweeping statements you need to be more familiar with the subject matter.
Same for you. You made factually wrong statements. Perhaps you need to be more realistic about people and yourself in general. In life you will encounter people that disagree. It's not wise to rudely call them not "familiar" with the subject matter. All humans make mistakes and you are setting yourself up for failure when you make rude statements like that and then make a factually incorrect mistake right after.
A Python instance is effectively a dictionary. The contents of that dictionary can be mutated at runtime to disagree with the type that is specified. This is perhaps an antipattern but it’s not uncommon.
Attribute lookups can be dynamic as well without any typing. The typing can be lofted out and specified at the lookup site but that is also no guarantee of what you’ll get at runtime.
You cannot type check this dunder method access.
class A(dict):
def __getattr__(self, name):
return self[name]
You may say “oh but that’s uncommon or bad practice” but it’s unfortunately quite common in many production systems because Python has encouraged embracing its dynamicism for decades. That’s not a flaw, that’s a power. But it definitely has its pros and cons.One may also say that “well that’s just void pointer casting in C or other languages”, which is also true and equally problematic. That’s why newer compiled languages like Rust and Swift have options for sum types / enums that carry a value to design around it in a type safe manner.
———
To your other point on courtesy…
If I say you’re unfamiliar with the details, it’s because you yourself said you aren’t sure YET you claim your world view of type checking is correct and dynamicism is rare. You don’t read my comments and substitute your own.
If I am being rude it is only because your default world view appears to be “the ideal in my head is the way it is”.
Take for example when you say “your rebuttal almost never occurs” or when you say pretty much every tech company uses type checking. You ascribe your own world view with no room for greys or real world variance.
If I say: “but this is my experience” your response is “well that’s not the reality for most cases”. So if I am rude it is because you talk in absolutes and only correct yourself when pushed back upon.
Perhaps do not talk so assuredly in general. Your experiences are not that of others yet you talk as if they’re the norm.
So if I am rude, it is because you are being rude in your responses and perhaps don’t realize it. You’ve basically told everyone who’s responded to you that their experiences aren’t correct.
Anyway I shall not respond further to you because this discussion is hyper fixating on something that was only intended to be an example. It serves no purpose to continue arguing
Yes I know. but the you will see the code addresses this. Mypy caught the monkey patching. Look at it. I added a property to an instance dynamically and mypy caught it.
>You may say “oh but that’s uncommon or bad practice” but it’s unfortunately quite common in many production systems because Python has encouraged embracing its dynamicism for decades. That’s not a flaw, that’s a power. But it definitely has its pros and cons.
I addressed this in the post you replied to. I specifically stated it. Let me quote it:
"__getattr__ is type checked too as long as you type the method signature, I have seen some weirdness around this area for type checkers but that's not the main problem. I understand where you are getting at with __getattr__. When you use this you're essentially creating something akin to a function with a string as a parameter. The contents of a string can't be type checked and if all methods are defined this way on a class none of it can be checked."
You addressed a point I already addressed, and didn't address the points you were factually wrong about: Dictionary access is type checked. Monkey patching is also type checked.
>Anyway I shall not respond further to you because this discussion is hyper fixating on something that was only intended to be an example. It serves no purpose to continue arguing
Completely agreed let's move on from all the BS. But you said some things that were factually wrong about python Dicts not being type checked. You said dictionary access is not type checked. Please address those things. I am interested in your viewpoint on this matter because I can learn something if my statement is wrong.
> Yes I know.
I'm not sure…
> but the you will see the code addresses this. Mypy caught the monkey patching.
LOL. Here, what "static type checking" is worth in Python in reality:
me@box:~$ cat test.py
class A(dict[int, float]):
def __init__(self) -> None:
self.__dict__["you_are_clueless"] = "Oh boy, so clueless…"
def __getattr__(self, name: str) -> int:
result: int = self.__dict__[name+"_clueless"]
return result
some_a = A()
print(some_a.you_are_)
me@box:~$ mypy --strict test.py
Success: no issues found in 1 source file
me@box:~$ python test.py
Oh boy, so clueless…
Traceback (most recent call last):
File "/home/me/test.py", line 12, in <module>
print(some_a.you_are_)
^^^^^^^^^^^^^^^
File "/home/me/test.py", line 6, in __getattr__
result: int = self.__dict__[name+"_clueless"]
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'you_are__clueless'
Class `A` claims to be a Dict from `int` to `float`. But I can freely assign a string to a string key…The signature of `__getattr__` makes no sense in this context, but is happily accepted…
In the body of said function I'm obviously assigning a string to an `int` "typed" variable. But no issue here…
I'm returning this string in contrast to what the signature claims. But also no issue here…
I'm calling an non-existent method on the `A` instance. But that's not an issues for "type checking"…
In comparison, a language with real static type checking:
class Record(fields: (String, String)*) extends Selectable:
private val fieldMap = fields.toMap
def selectDynamic(key: String): String = fieldMap(key)
//def selectDynamic(key: String): Int = fieldMap(key)
// >> Compile error:
// Found: String
// Required: Int
type A = Record { val youAreClueless: String }
val someA = Record("youAreClueless" -> "Oh boy, so clueless…").asInstanceOf[A]
println(someA.youAreClueless)
//println(someA.youAre_Clueless)
// >> Compile error:
// value youAre_Clueless is not a member of Playground.A
//val someB = Record(123 -> 0.987).asInstanceOf[A]
// >> Compile error:
// Found: (Int, Double)
// Required: (String, String)
It's not even possible to replicate here the rest of the nonsense Mypy is doing above.[ Live Scala code at: https://scastie.scala-lang.org/eGVUZbVARMuZa36ZyLQqxQ ]
Note, this Scala demo is purely static. The field access is checked at compile time.
Caveat: The code isn't completely safe, as this construct could possibly explode at runtime when doing something like:
val someB = Record("foo" -> "0.987").asInstanceOf[A]
println(someB.youAreClueless)
This compiles but ends up in a runtime exception `NoSuchElementException: key not found: youAreClueless`.But if I wouldn't be lazy I could even get rid of the cast to A (`asInstanceOf[A]`) which is what makes the code unsafe. This would require meta-programming, though, and would be more involved (and therefore likely quite hard to follow if you don't know the language). The point is: It could be made 100% compile time safe! One "just" needs a powerful language with a proper type system.
Nonsense.
Python "generates" this:
Traceback (most recent call last):
File "/home/me/test.py", line 3, in <module>
print(x[3])
~^^^
KeyError: 3
> You are completely Wrong on these statements.You're completely wrong about almost everything you've claimed so far…
> The contents of a string can't be type checked […]
Nonsense.
This may be true for Python's type checking tools, but that's not a general limitation of type checking.
class Test:
// The annotation is unrelated to the demonstration of singleton types.
@annotation.targetName("m_foo") // This avoids double definitions at the byte-code level.
def m(p: "foo") = "I only work with 'foo'!"
def m(p: "bar") = "I only work with 'bar'!"
Test().m("foo")
Test().m("bar")
// Test().m("baz")
// >> Compile time error:
// None of the overloaded alternatives of method m in class Test with types
// (p: ("bar" : String)): String
// (p: ("foo" : String)): String
// match arguments (("baz" : String))
Static dispatch, even with overloads, works just fine for (in this case string) singleton types.[ Live Scala code at: https://scastie.scala-lang.org/5FW6EaAeQa2ybhM3XYhuyQ ]
> You made factually wrong statements. Perhaps you need to be more realistic about people and yourself in general. In life you will encounter people that disagree. It's not wise to rudely call them not "familiar" with the subject matter. All humans make mistakes and you are setting yourself up for failure when you make rude statements like that and then make a factually incorrect mistake right after.
Some people have indeed infinite egos. If there would be just anything else besides that…
I wonder every time why the most clueless are the loudest. That's so embarrassing.
So? python generates that but the point was demonstrating type checking. The output you see is not generated by python. It's generated by an external type checker. The type checker caught the python exception without running any code.
>> The contents of a string can't be type checked […] Nonsense. This may be true for Python's type checking tools, but that's not a general limitation of type checking.
The context is python. We're talking about python. I'm making a statement about python. Nobody is talking about scala. I don't know why you're getting into scala stuff.
There is literally nothing in my statement to indicate I'm making a general statement about type checking. But I will say checking for the contents of a string is rare for a type checker to do. That is a general statement that is generally true.
>Some people have indeed infinite egos. If there would be just anything else besides that… >I wonder every time why the most clueless are the loudest. That's so embarrassing.
Hey can you please stop being rude? The guy made factually incorrect statements and so did you. That's not an ego thing. It's just true that he's wrong. Everybody makes mistakes... people shouldn't get worked up about someone else identifying a mistake.
I too made a mistake. And I admitted my mistake. See my first couple of posts. I admitted I was wrong: the python interpreter doesn't do type checks. It was an error on my part for not clarifying I meant python development in general with external tools.
Obviously, as running the code generates a very different output…
> It's generated by an external type checker.
I know.
But again, you didn't say that.
You said the above code "generates" this…
Maybe you've heard that by now somewhere: Words matter… ;-)
> The context is python. We're talking about python. I'm making a statement about python.
No, you made a statement about type checking. Here the full quote once again:
> The contents of a string can't be type checked and if all methods are defined this way on a class none of it can be checked.
Nothing in this statement is about Python.
All I did was just proving your words once again to be nonsense: You can statically dispatch (which involves static type checking!) just fine on strings. My (Scala) code is prove of this fact.
> There is literally nothing in my statement to indicate I'm making a general statement about type checking.
LOL. Do you actually know what you're writing? Once more:
> The contents of a string can't be type checked and if all methods are defined this way on a class none of it can be checked.
That's a general statement… It couldn't be even more general, actually.
> But I will say checking for the contents of a string is rare for a type checker to do. That is a general statement that is generally true.
Once again complete nonsense.
There are whole libraries doing more or less nothing else than handling singleton types.
Whole software layers utilize that! But I guess you never heard of static data validation…
https://github.com/Iltotore/iron
You have so little clue, but such a big mouth… That's so embarrassing.
A helpful tip: Stop spiting out maximally general claims (because these are almost always wrong!), and think about what you're actually writing.
What's in your fantasy, or what you "may have meant" is irrelevant!
> The guy made factually incorrect statements and so did you.
That's exactly what I'm talking about: You're a severe DK victim as it seems…
> It's just true that he's wrong.
No, actually you are wrong with almost every claim, like I've proven now several times. And this nonsense still didn't stop… Oh, boy!
> people shouldn't get worked up about someone else identifying a mistake.
Think about that once again. Especially in the context that it's you who is wrong here with almost everything you say.
And no, nobody is "pedantic". It only gets quite unrealistic that someone who doesn't even get banal prose straight would be able to write any code. Because the computer is actually very pedantic. And after production is on fire you can't just come to your boss and excuse yourself with "but I've meant this differently, just the stupid computer did again not understand what I've meant".
But to be honest this would actually explain:
> I've likely worked for more companies then you in the last 5 years or so due to my personality. I don't stay at one place for long.
I have some suspicions to why you don't stay anywhere for long… And yes, that would be indeed related to personality…
OMG. Something like that form someone who claims to have worked at significant amounts of Python shops…
I obviously mean static type checks. Not runtime type checks. Please stop being pedantic.
No you didn't, as that's not what you've written.
You've written: "Obviously the python interpreter itself does not do any type checks", which is of course complete nonsense.
> Please stop being pedantic.
I'm not pedantic. I just correct all the nonsense you emit.
This wouldn't be needed if you wouldn't also spit out stuff like "I've never said something wrong! I'm always right!" and the like.
Unfortunately, I can tell you from experience that out in the real world, at fortune 500 companies, there are millions of lines of untyped Python doing critical work while being full of subtle type errors which should be compile time errors but will rear their heads as runtime errors when it's least expected.
It's def not as pervasive yet as Typescript.
Your statements are incongruent with the reality of production.
Even so where I worked is only part of the equation. You can look up which companies use python types in a google search.
Let me add more nuance, companies that use python as glue code as in scripting languages don't use types. This makes sense as python is considered not as important as the main language.
For companies that are primarily based on python... the majority use types. The ones that don't are actively migrating. This includes faang and subsidiaries. In fact type checkers for python are likely to be built by faang or companies close to that tier.
Even at companies that do use type hints, there’ll be tons of legacy code that won’t (and probably tons of new code as well if we’re being realistic).
It’s like saying every company uses bash scripts. It’s not really indicative of the prevalence in actual code bases in production use other than saying it may be used somewhere within the company.
Between this and your other comments, you’re making very widespread comments that can’t logically apply to everything and nor do they in my experience.
The first part is true, I agree with that assessment and I never made a contrary claim. Companies are migrating.
The second part in parenthesis, is less common, I don't agree that it's a generality among companies that have python as a primary language.
>It’s like saying every company uses bash scripts. It’s not really indicative of the prevalence in actual code bases in production use other than saying it may be used somewhere within the company.
I don't even know what you're getting at with this example. Tons of companies use python "somehwhere" within the company. I'm sure in those cases it's often not typed.
But for companies or teams that use python as a primary it's typically typed or in the process of getting migrated to be typed. That is the nuance I added to my claim.
>Between this and your other comments, you’re making very widespread comments that can’t logically apply to everything and nor do they in my experience.
Except you made statements that are factually wrong. I literally ran mypy on some code and your statements were categorically incorrect from your other comment. Usually these debates are anecdotal so logic doesn't apply as it's just fuzzy opinions regarding social aspects of society. But that's not the case here. You made factually incorrect statements and that has bearing on the correctness of your anecdotal statements too.
Regarding ADTs: do type checkers ensure totality (all cases covered) when pattern matching?
(I’m not casting aspersions here. It is what it is, you know?)
You have to use it in a specific way though.
https://tech.preferred.jp/en/blog/python-exhaustive-union-ma...
Of course it still is.
The type hints have no runtime semantics whatsoever.
The actual type-checking still happens at runtime in Python, and is not related to any static checks. Out of the perspective of Python's interpreter the type hints don't even exist. They're like comments…
Static type checking is not part of Python!
> Python also has ADTs which match it in power to rust.
All Turing-complete languages match each other in power…
Besides that:
Python doesn't have a static type system in the first place, so it can't compete with Rust in this regard. That's not even the same game.
I clarified my meaning in another comment. You're right, I meant to SAY modern development involves type checking with python. But not with the interpreter. My mistake for not being clear.
>All Turing-complete languages match each other in power…
I obviously mean type checking. Additionally what you're saying isn't even true. Not all turing complete languages match in power or capability.
>Python doesn't have a static type system in the first place, so it can't compete with Rust in this regard. That's not even the same game.
Modern python development is done in conjunction with a type checker. Sort of like how modern javascript development is done with typescript. That levels up the game to where python is roughly in the same class as rust when it comes to type correctness.
Depending on the type checker python matches the power of rust, roughly. There are differences, but for ADTs they are pretty similar in capability.
It's completely irrelevant what you "meant" to say. What counts it what you've written!
And that amounts to just nonsense, over and over again…
> I obviously mean type checking.
Once more: It's completely irrelevant what you "meant" to say. What counts it what you've written.
> Additionally what you're saying isn't even true. Not all turing complete languages match in power or capability.
You clearly lag any education whatsoever on CS topics.
The above statement couldn't be more wrong…
> Sort of like how modern javascript development is done with typescript.
LOL. No, "modern JavaScript development" is done with JavaScript. TypeScript development is done with TypeScript…
In case you still don't get it (which I assume): Client side web-development != "JavaScript development".
Words matter.
> That levels up the game to where python is roughly in the same class as rust when it comes to type correctness.
ROFL! See my post below…
Python is not even close. It does not even play the same game…
> Depending on the type checker python matches the power of rust, roughly. There are differences, but for ADTs they are pretty similar in capability.
Oh boy, I start to understand that you have really not the slightest clue what you're talking about…
Looks like that's not even trolling.
I have alone in this window here 4682 tabs open.
How it comes? Well, I just don't close them until I have decided whether I want to bookmark them. After month with a browser sessions quite some tabs pile up. (When it gets out of hands I bookmark whole windows… So there remains at least the theoretical possibility that I sort this out later. Even that happens only rarely.)
Before someone asks: From the technical standpoint it's quite easy to have so many open tabs. All you need is Firefox, Tree-Style-Tabs, and tab auto discard ("sleep"). It fits than in under 2.5 GB RAM even (which is less than Chrome with even a few tabs).
Notes can be as short or long as feels right. If they need to grow they can grow, sometimes they get split into sub notes.
I have notes with titles like "Cardboard furniture", "Staging patch changes in VSCode", and "Hilbert Transform".
Some are one or two sentences, some are more like essays with subheadings.
Small notes tend to have one or two links to other notes. Longer notes have more links and tend towards centralization (eg all booking info about an upcoming work trip).
Search makes it easy to find the notes that don't have links.
Collections (sometimes called 'Maps of Content') are sets of internal & external links or resources around a particular topic, e.g. 'Self Deception', 'Creativity', 'Air Quality', etc. The page names represent the topic so they're easy to name, and if I can't find a page I go to these first before search.
Streams are pages with date headers that contain small notes around a broad topic. For instance, 'Passing Thoughts' are random ideas, 'Story Prompts' are ideas for stories, and 'Inbox' are links to read and any notes I have on them. Streams do three things for me:
1. I don't know how big an idea is until I write it, and this stream pattern lets me optionally break ideas off into their own pages if they get to a certain level of size/complexity.
2. I can quickly capture without having to create a new page, since I'm at ~2000 now and each subsequent page makes search less effective.
3. I can avoid the challenge of naming pages, which is often harder than it seems. For instance, I've taken to naming certain pages like Andy M's evergreen notes style of declarative claims/statements, like 'Recognizing our influences empowers our creativity', 'The curiosity driving information addiction may be due to a sense of deprivation', and 'Good ideas deserve good stewards'. To do this clearly, concisely, and scoped correctly is its own challenge and worth the time investment because it really lets me build on strong foundations, and it prevents similar pages from proliferating in search by being easy to find.
I use the Waypoint plugin with folders to create auto-generated maps of content within folder hierarchies. Works nicely to give me an index to use as a first port of call in a subject and works well with graph view.
Whatever point you had, whatever drive was there, is just gone. The wind has calmed and the sails just drop loose on the mast.
This happens to me, both in my own work, or writing something like this, and then I just dump it.
Kind of aggravating.
If an idea flashes into my head, I quickly write it shorthand anywhere. See my other comment (https://news.ycombinator.com/item?id=36726680) on having 'Streams' pages that offer an immediate working space to write. I let the idea expand with that progress & velocity, and once I've reached the end of my writing juices, if it's important enough I copy/paste it into a better place. Organizing is one task that can be done when the winds of flow state calm.
Similarly, breaking ideas into small bite-sized parts helps because those are easier to complete with less energy. Better to make incremental forward progress than keep trying to do the same big thing over and over.
Also, I try to start with a summarized version of what the thought is. Again, shorthanding the key points is helpful. It's easy to have a big thought that has several constituent parts and immediately dive into some details on one of those parts, only to find that the big picture sort of disappears. Better to capture the TLDR first.
Finally, I'm okay with abandoning ideas, I trust that the important ones will come back, and I make sure to leave affordances for myself so I can always return to what I was doing later. Some things I do to make revisiting ideas easier include:
1. I'll review my 'Passing Thoughts' stream at least once a week to see if my new context or a new perspective allows for the ideas to come back.
2. I keep track of work-in-progress work with a #WIP tag and new pages I've made in 'What's New' stream.
3. I keep track of my thought process with occasional self notes in 'Whats New', e.g. "I dove into X by expanding Y and Z but think I have to reorganize section A to fit it in"
4. In the organizing step I think carefully about how I name pages (including using aliases)
5. I densely link all related ideas so there's many ways to find them.
What I do is: Not feel in the slightest guilty about it, because I just came off a stretch of real 10x productivity, and then go do something else for a half hour or so that exercises a different part of the brain - grab one of the many musical instruments around me, for instance.
For me the real struggle isn’t focus or “buffer”, it’s when things are boring. For almost all code work, even debugging, my hyperfocus grinds into gear, and if I’m left undisturbed I can quite literally work for 10 hours straight without eating. I don’t, because there is a bill to pay after doing so and I’ve worked on myself for decades to the point where I know to take breaks, eat and go home, but the hyperfocus is there.
Until things get boring. Luckily this is rare with code. Not so with everything related to the process of being allowed to write code. I try to work in places where the process people bother you as little as possible, and if I can avoid it, I’ll happily go through the rest of my career without ever pretending to listen in another standup meeting ever again.
I don't have ADHD, but, for different reasons, my brain seems to work in a similar manner. And, I have developed coping strategies similar to those applied with people on the ADHD spectrum [1][2].
My anxiety around coding has reduced a significantly when I learned about TDD and started writing code made of very small, composable chunks. I even use the same "small buffer" metaphor when talking about this!
I know that some people with ADHD use the writing tool I built for myself. If you have a moment, feel free to give it a shot and let me know what you think: https://enso.sonnet.io
(the web version is free, and has complete feature parity, no need to pay me)
you definitely do not have ADHD, then. I find these absolutely impossible to trace through when I want to find out what a program is actually doing, in reality.
if I have to find the actual logic used in main or whatever event handler, and it's in a function called by a function called by a function etc., then I will forever despise the developer who felt that this was anything approaching an acceptable design, or even an acceptable idea.
codebases like that are impossible for me to absorb.
put the logic where it fucking goes, inline with its use! right there! nowhere else! don't nest it behind abstractions you don't NEED.
functions that are very small and used in 100 places in the codebase should be inlined in the source code so I can read it. there is no function used this much in an application I've ever even considered working on, anyway.
I always prefer to copy and paste a little bit of logic around than to wrap 5 lines in a function and call it from everywhere.
if the function is 100 lines of complex code, put it in a function and call it ONLY if it is used in more than 2-3 places, and NEVER if it is only used once.
today's "best" practices serve only to shut me and others like me out of participation and are exclusionary.
this does mean that I have to take the time to find very good names for everything, which takes time, but always pays off in readability, for everyone, not just me.
> put the logic where it fucking goes, inline with its use! right there! nowhere else! don't nest it behind abstractions you don't NEED.
What you're talking about here looks more like over-abstracting. What I'm talking about is having understandable components with simple, easy to understand behaviour. I think we're on the same page.
I want to be able to understand what the component does at the first glance. I also want to be able to understand what a larger part of the system does at the first glance. But, overall, I'll always err on the side of _under-abstracting_ and duplication, like you.
One might argue that software development is about 1) defining a business problem, _then_ 2) communication (usually with "ghosts" i.e. another developer who is not in the room with you[1]), then writing the implementation. My philosophy on the subject is like this: https://sonnet.io/posts/code-sober-debug-drunk/
TL;DR it's always easier to write code than to read it, be kind to the next person reading it (it might be you)
[1] https://sonnet.io/posts/emotive-conjugation/#:~:text=Ghost%2...
API design, abstraction design, is a type of UX design, and like other forms of design, accessibility is a concern. Keeping the vocabulary fairly small and the abstractions well-behaved and consistent help nearly everyone, but particular ADHD folk.
I do have ADHD (clinically diagnosed), and I disagree 100% with this statement (at least the certainty of it). In my experience, TDD and writing small chunks greatly reduces my anxiety and increases my productivity by helping me to narrow the scope of the task I'm working on.
Different people have very different experiences despite having the same diagnosis. What is exclusionary for one person may be the exact opposite for someone else.
You cannot determine if people have adhd on whether they agree with you on big vs small functions. Its not how it works and all, and your preference is just a preference and not an universal truth for everyone with adhd.
I'll make my life way harder in order to optimize the view of the code.
This is the paradox of "readable" code. Each person has a different definition of it. I also prefer to write as dumb code as possible (well, these days I do, I of course tried to be extra clever in my earlier days). But for me it's the jumping around that makes me lose focus. My limit is about 3-4 jumps. This is not to say I write long meandering functions, but I personally couldn't imagine a codebase I'd be happy working in that is made up of modules that fit on a screen. Maybe it's possible! But the projects I've worked on that have a linter rule of "100 lines per file" or whatever end up being these rabbit holes. It's so hard to come up with code design guidelines everyone can agree on.
As a side note, I despise things like imports and aliases. I'd prefer that when I do jump to a function, I can read it without having to check if anything is imported or not. I always opt for fully qualified function calls, regardless of how many characters it is.
One idea might be to use an LSP (Language Server Protocol) interface. It could describe the fully qualified symbol for you when you, say, select the abbreviated symbol or press a keyboard shortcut. I've been working on a moderately large C program with Emacs and clangd[1] recently and have been amazed at how 'immersive' it feels, and that's from someone who's used to the comfort of a Lisp REPL!
Terse naming is just fine as long as the names are visually distinct from those in the same scope/namespace and as long as engineers/developers are religious about proper documentation.
i.e. members/classes/types/fn/etc getting a doxy/doc description and local variables getting a `//` comment if their meaning and use isn't easily derivable from the immediate context.
If that isn't happening however, you probably need to be pushing for more descriptive names or better docs during code review.
I'm not saying that would be true for anyone, just furthering my premise that it's different for everyone.
The Java naming is one cause of what I really have a problem with. Like that name on it's own isn't the worst because the key info is right at the start and I'm probably not going to see the type name in function bodies I'm trying to follow. It's when that naming is combined with other overly verbose naming that it gets really gets bad: `CreateUserFromUserAccountBuilderFactoryFactoryOnBackgroundThread()` By the time I've read "BackgroundThread" I'm glancing backwards to see what is happening on the background thread.
Other places where longer names make reading harder are when the names are very similar. With `textBoxXPosition` and `textBoxYPosition` the X and Y get lost too easily. You could rearrange the letters to the front to help with that, but it can still make computations harder to read: `sqrt(xTextBoxPosition * xTextBoxPosition + yTextBoxPosition * yTextBoxPosition)` vs `sqrt(x * x + y * y)` or `sqrt(tbx * tbx + tby * tby)`
I actually always write full variable names, even in narrow scopes. This is mostly because I'm used to programming in dynamic languages and it makes renaming much easier. I've also become so accustom to it that it makes scanning incredibly fast. For example:
Enum.map(operations, fn operation ->
execute(operation)
end)
I can pretty much just read the left-hand side of that if I'm scanning really quickly, ie, ignore everything after `fn`. I'm talking micro-optimizations here, but I have been tripped up before when someone did something like `optn`.Elixir allows for a shorthand notation for anonymous functions like so:
Enum.map(operations, &execute(&1))
Some people hate that but again I like it due to the refactoring advantages (it becomes very simple to read once you get used to it).I hear you on the x/y thing. You example is actually why I really prefer snake case, though I don't want to start a flame war there, haha. But ideally when you're dealing with points and dimensions you wrap them in a type or object that you can pass around and the receivers can extract simple `x` and `y` variables from them.
He does not like my ‘meter_to_mm’ and ‘mm_to_meter’ because the abbreviations are inconsistent, no verb is used and he needs to go all the way to the typehint to know the input. We both have a point, but there is not really a clear middle ground without writing a novel in function names.
Small functions aren't bad per se, especially if they are re-used a lot, but I no longer believe that they are inherently good. Especially awful are having a lot of tiny single-use private functions.
I think that developers often want an easy way to say "we must do this" and have a tool tell them to do so. Tools can get us pretty far but at some point writing good code is going to come down to taste. This is of course very hard in many large project situations where its every team for themselves, and often every developer for themselves within a team.
Application modules can be aliased, but not library modules. This is so that we don’t need to keep repeating the name of the application throughout the codebase while preserving clarity as much as possible.
How did you do it? I wasn't diagnosed until my early adulthood, but even with medication, I feel like I can barely keep my head above water.
Everyone is different, but the key things for me were 1) never settling medication-wise until I found something that truly worked well for me (a process that took years but well-worth it) and 2) utilizing my newfound focus to put systems in place to help me be productive while working around my particular weaknesses. (By this I mean how I handle todos, calendars, notes, workflow processes, etc.) #1 was absolutely crucial and is when I started "feeling good" but #2 is what took me from "feeling good" to "reaching goals".
Regarding the medication, I had a very good doctor. In the beginning, medication would either not work for me, or it would, but for a limited period of time. I was very used to switching things frequently. So later when I would land on something that was okay-ish but not great (a point where many people consider themselves lucky and stop experimenting) I would note that it was helpful in case I wanted to return to it later, but we would move on and try something else, hoping for something better than "okay". And eventually we landed on something lesser-prescribed but that worked quite well for me and continues to work to this day. #2 was still a multi-year battle that I haven't fully won, but I've made enormous strides and I so badly wish I had gotten myself to this point a decade earlier.
Diving into the detail, what medication have you tried and how did it work/not work for you?
It is for this reason that I try to write what I feel is very obvious or self-explanatory code, why I try to keep functions/modules as simple as possible and ideally not longer in length than I can see on my screen at once (when possible), and why I almost exclusively join small/new teams who don't yet have an enormous codebase that I'll have to wrap my head around. I am never done tweaking the UIs of the editors I use to maximize my ability to work around these things.