Trying out Twitter 2: The Twittening. Follow @ bsky.app/profile/searyanc.de…
2
3
9,297
"Do senior devs still have to look up stuff on StackOverflow?" Gentle reader, I have gone to StackOverflow to read answers that I wrote about behavior that I myself designed and implemented.
164
2,594
23,050
"X is a compiler" alignment chart
37
886
3,544
Replying to @garybernhardt
I'm excited to stop writing code and start writing machine-readable specifications of precise intended behavior
40
380
3,033
136,471
JavaScript performance is bananas, a thread. Let's write a function to sum the values from a the 'val' property of each element in an array: function sum(arr) { let acc = 0; for (let i = 0; i < arr.length; i++) { acc += arr[i].val; } return acc; } 1/10
26
344
1,754
"I can't believe *none* of the things I'm trying are working here" - guy who keeps running a different file than the one he is editing
48
75
1,357
"Not sure why you don't have this yet. It's very simple code; I'll send a PR"
9
207
1,201
Us: Can barely get usefully stable perf numbers from our CI machine Other people: Doing timing attacks on the branch predictor from JavaScript code
4
369
993
Today someone told me that String#split can NEVER return an empty array, which is wrong, but I can see how one might arrive at that conclusion. Every day I learn something worse about JavaScript
38
126
1,018
If "Do you *really* know JS?" quizzes were applied to other domains: * What's the towing capacity of an ambulance? * Will putting 600 kV backwards through a standard LED cause an explosion, a fire, or both? * T / F: pine sawdust tastes worse in a martini than oak sawdust
17
172
763
My wife used to work on the caching team at Amazon and every few months someone would pop in to say "I wrote a simple cache (with no eviction policy yet) and it's 30x faster than memcached when pulling on the same key 50,000 times in a row, maybe you can use it instead?"
15
33
771
Telling someone you're vaccinated? HIPAA violation. Straight to jail. Asking someone how their day is going? HIPAA violation. Wishing someone a happy birthday on Facebook when you only know it's their birthday because Facebook told you? Believe it or not, HIPAA violation.
15
70
531
Roses are red Violets are blue Use triple equals Because "1" == true
5
106
494
JKR 5 days ago: There's a single immutable unambiguous biological definition of who is a man JKR today: Man is when man vibes
1
10
382
9,220
C++ still doesn't have automatic garbage collection after like 30 years. I guess the devs just don't care. Anyone know where I can send a PR to fix it?
41
14
410
TypeScript: *powers JavaScript JSDoc-based Intellisense in VS family; gets better every release* JS Devs: "Wow, JS Intellisense is so good these days you hardly even need TypeScript at all" TypeScript:
13
91
407
If you say a 10x engineer's name backwards, they will owe you three wishes. One of them will backfire terribly
10x engineers Founders if you ever come across this rare breed of engineers, grab them. If you have a 10x engineer as part of your first few engineers, you increase the odds of your startup success significantly. OK, here is a tough question. How do you spot a 10x engineer?
6
63
352
C#: No abstract static methods C++: No abstract static methods Java: No abstract static methods Swift: No abstract static methods Obj.C: No abstract static methods Ruby: No abstract static methods Devs on GitHub: Why is TypeScript still missing abstract static methods? Sad.
14
39
346
Got a PR from a bot to make the following changes * hello -> theyllo * cowboy -> cowchild * this -> ttheir
13
12
339
Love the approach
4
45
339
34,707
The number of things I've said are "out of batteries"...
6
2
280
STOP DOING JAVASCRIPT STRING ITERATION
7
35
293
If you find two 10x engineers engaged in an argument, you're in for quite a sight. They will argue until one is declared victor, who will entirely devour the other, gaining the defeated engineer's stock options in the process.
4
39
272
People will really stay in the same location all day tapping at their keyboards then say they don't like static typing
7
43
248
I spend all day every day telling people on GitHub that we're not doing features because it'd infringe on the TC39 committee's areas of ownership. "Taking over an open standard" is completely the opposite of what's happening. 1/?
Replying to @seldo
Microsoft is smart enough to know that a huge body of developers still remember how it behaved in the 90s and so it puts in lots of effort to avoid appearing to take over an open standard and replace it but, well, that's what's happening.
7
38
253
Replying to @molly0xFFF
Excuse me Mr Astronomer but according to this star registry certificate I bought on SkyMall, this star is mine
1
10
205
JS perf is extremely hard to reason about: algorithmic improvements that halve the number of calls to a function can still be worse on net if those calls make the function megamorphic. Code that runs "fast" now might run "slow" later if other inputs go through that codepath 9/10
2
9
243
lol
5
35
243
Replying to @yhdistyminen
Can you imagine the discourse if we tried to ban smoking in bars today?
3
1
204
14,841
Avoiding polymorphic calls is another thread entirely, but the takeaway I want you to get is taht moreso than in other systems, you need to measure measure measure measure, and make sure your measurements are as near as possible to the real thing you're trying to build. 10/10
11
9
227
BlackRock should open up a flailing candle shop in every suburban strip mall just to be sporting
1
210
5,983
I feel like signing a contract that stipulates a late fee while simultaneously responding to these messages with "we don't pay late fees" is tantamount to fraud
3
1
185
Humblebrag: Today I was accused of overestimating the complexity of a software feature, a feat previously unaccomplished in the history of our industry
6
10
203
Replying to @JTrea81
If it's a fixed object then it's not in a vehicle's path. You're talking about out of control vehicles.
2
164
2,348
Web devs, what do you call this?
119
15
177
Let's dig in. Gary's discovery is thankfully easy to reproduce let b: 1 | 2 = 3; This indeed produces the error (under --target ES5) Type '3' is not assignable to type '1 | 2'. and with --target ES6: Type '3' is not assignable to type '2 | 1'. Cool, what the heck?
4
61
178
Replying to @RichmondRCMP
Who did the pedestrian hit and kill?
2
161
4,149
Multiple replies pointing out this example is V8 behavior (true ty), but all fast JS interpreters have unintuitive performance characteristics in some cases. The point is, measure measure measure, using the realest benchmark you can. Never say "this *should* be faster", measure!
8
3
171
Advanced #TypeScript concepts: Study and memorize the type alignment chart
4
45
172
Replying to @seldo
A proposal to do the same with Girl Scout Cookies was met with considerably more resistance
4
2
156
Me, writing a webpage for cat pictures: * Is the result in the server's L3 cache? * Will the user's ambient lighting affect perceived color temperature? * Is latency harmed by Nagle's algorithm? * Will showing these cats badly impact democracy? * How to center this div??
Replying to @beaulne
100% there should be no such thing as a front end developer outside of super junior contexts. All developers need to think across all the layers that they build on to be effective.
3
21
162
When someone asks for a TypeScript-to-C# compiler
10
21
161
Where were you when you found out Optional Chaining went to stage 3?
πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰BREAKING: #TC39: Optional Chaining has now moved to Stage 3!!! #JavaScript
18
26
151
Here's one way to think about this. Would you ever intentionally _ship_ unminified JS to your production website? Probably not Do you _write_ minified code today? Definitely not. But is it useful to be able to _run_ unminified code? Extremely!
Could we have TypeScript with no build step? Could we have types in JavaScript? Maybe! We're exploring bringing optional type syntax into the JavaScript language! devblogs.microsoft.com/types…
9
11
152
An eagle-eyed user spotted that the color used for TypeScript in the GitHub Languages repo breakdown wasn't the same shade of blue as used in our official branding. As of today, that's fixed. Happy Friday! #3178c6
3
4
151
Writing some standard JavaScript
11
52
149
Please, for the love of god, do not abuse this flag. It's not here for aesthetic reasons to let you write paths that are actually misleading.
Turns out I was totally off-base with a post I made last week. You'll never need to write a `.js` import again, thanks to this new flag in TS 5.7. The TS team changed their mind. This is massive. 🧡
7
9
149
56,187
Ironically, Infinidash actually is powered by two parallel fixed-length arrays
1
138
Why does fuddy-duddy TypeScript say I shouldn't pass a number to parseInt? Haven't they read the ES spec? It goes through a coercion process that is totally lossless, probably
2
12
136
Still a CSS noob because I can't figure out if I should do body { margin: 6 ft; } or body { padding: 6 ft; }
16
13
141
The weirdest feedback on TypeScript that I see is that the type system is getting "too complex", when in reality we only ever add type system features to support existing behavior of JavaScript libraries Blame the territory, not the map πŸ™„
8
11
133
Sometimes I see conditional types like this: type F<T> = T extends "a" ? A : T extends "b" ? B : T extends "c" ? C : (... many more) never; When the test type is always a literal or literal-like thing (e.g. unique symbol, enum), this often isn't the best approach 1/
4
16
136
"No committees" ... "Who's responsible for these changes? David and I are. Who made the changes? David and I did. These are our calls, and the outcomes and impacts land at our doorstep." If only there were a name for a decision-making group like the one Jason and David comprise
3
123
If a 10x engineer becomes bored with the product, they'll often embark on a spiritual quest of refactoring. If this succeeds, you will notice absolutely nothing. If this fails, the 10x engineer ascends to become an Architect, and you'll have to double their pay for no reason.
1
18
121
When sum hit the different objects at the end of the array, they were not the same shape as the rest, so the property access became "megamorphic" - not suitable for optimization. See also erdem.pl/2019/08/v-8-functio… But array1 is still fine, right? 6/10
2
7
132
That's what working with the process looks like - we waited over 5 years (an eternity in JS tooling years) before adding our most-wanted feature because we're *not* taking over an open standard.
3
11
132
It turns out the answer to "What if we made query parameterization as convenient as string interpolation?" is "People assert that it's vulnerable to injection, regardless of how it works"
3
3
120
16,508
It's not a gambling addiction if you win, it's just a job
109
5,212
Last Thursday, the @typescriptlang npm package had a million daily downloads for the first time ever
3
22
125
We call sum(array1) five times again and measure the time in milliseconds: 477 479 475 494 475 Now array1's performance is as bad as array2's was in its final run. sum is permanently megamorphic and much slower now. 7/10
2
1
116
TypeScript came in #3 (tied for #2?) for Most-Loved in the StackOverflow Developer Survey this year. We β™₯ you too!
4
27
120
Replying to @samlambert
The Netlify docs claim to already have DDoS protection. Why shouldn't customers expect that they're protected against outrageous charges from DDoS attacks?
1
115
8,821
JavaScript is - 70% Lisp with C syntax - 20% Java - 10% indefensible nonsense
7
9
120
Incompleteness is when your program works, but the computer doesn't believe you. This is a necessary part of all type checkers due to Math (see Gâdel, 1931), and also often for performance reasons A common source of incompleteness in TypeScript is ... 🧡
3
12
121
PSA: Due to Brexit, the U.K. will be switching back to 7-bit bytes at the end of the year. Please ensure your systems are updated.
6
6
113
I was thinking about blogging but then I remembered I'm not done writing my own static site generator yet. Don't laugh this is not a joke
9
4
110
TypeScript: *has over a dozen commandline flags for controlling typechecking behavior* TC39: *can't decide on exact syntax of obj?.prop; proposal is blocked for several years as a result* People: "Browsers will definitely have built-in type checking any day now"
6
11
110
Replying to @garybernhardt
The C compiler was an artificial intelligence system that used deep learning to automatically allocate registers and produce bytecode, allowing true "no code" development using a special DSL to describe the desired behavior of the output program
1
20
108
Replying to @garybernhardt
Anyone voting True on this would get 70% of the way through writing a new layout engine, find out that RTL exists, and throw away their computers to go live in the woods foraging for berries.
6
2
105
5,362
Just a normal JavaScript thing. What's the value of 's' ?
10
17
112
The TypeScript team is looking to hire a Senior Software Engineer! Do you have expertise and interest in areas like developer tools, compilers, Node.js, and (of course) TS/JS? Apply now at careers.microsoft.com/us/en/…
6
61
109
Better error spans in TypeScript 3.1!
2
14
112
Replying to @yhdistyminen
Even families making $800k are left with nothing after accounting for taxes, spending, and saving
2
98
2,696
Really loving how every reply to a reply on this thread is people mansplaining JS incorrectly
6
1
91
I was excited for the discourse to reach the "Adding comments to JavaScript was a mistake actually" point and now here we are
12
6
105
People: They should close tax loopholes Also people: Totally gutted they're stopping the Mega Backdoor Double Secret Probation After-Tax Roth 4IRA01k Fliptober method
7
6
104
Privilege is no one trawling through your git repos to see if you committed the most bytes
1
9
103
This headset works, but it's got a lot of problems. What can we do? v1: People keep getting motion sick. Remove the head-tracking thing and let people adjust the camera manually
I want a TikTok sketch where two engineers are trying to create the perfect AR headset and incrementally make a normal flatscreen monitor
1
24
89
A small announcement - @fdsmars (mhegazy on GitHub) is moving on to new adventures and I'll be taking over as interim engineering lead on @typescriptlang. My short-term goals are to not ruin anything and keep this awesome type train on the tracks! πŸš‚πŸš‚πŸš‚ Best of luck Mohamed!
12
1
105
🚨 TypeScript has turned on strictNullChecks in its codebase 🚨
1
17
105
This coal plant emits less CO2 than all humans' breathing combined, so it's basically green energy
2
3
88
When TypeScript was released, CoffeeScript was 3 years old and soon to be on the decline. TypeScript is going to turn 7 this year. We're long past the point where using one to predict the other's fate is meaningful.
5
22
99
Microsoft is truly an OSS-first company now: We're having a reply-all storm on the GitHub org 'everyone' channel instead of via email
2
9
98
Can we not? 😞
13
4
101
Sometimes "document the workaround" is the best you can do
2
9
105
Replying to @ob_cycler
Everyone saying "That isn't a bike lane" please turn in your driver's license and report for a free eye exam
4
90
9,677
The Y2K denialism out there today is so strange. You can talk to literally anyone who was working in the industry at the time and they'll tell you about the necessary work that was done. It isn't difficult to get history right when the people who did the thing are still alive!
8
12
90
Tech hiring: We'll judge you on ability to implement obscure tree algorithms from the 1980s Also tech hiring: There's a 7-month gap in your resume, have you been able to keep up on the dozens of important frameworks that have churned in and out of favor in that time?
1
10
86
Sometimes people suggest adding a feature to TypeScript, and that we can just tell people not to use it in a particular way that would be very problematic, thus rendering the problem moot. I am here to tell you that no one hears the second part. This isn't a thing that works.
4
3
93
Today's cursed code snippet is a ? (x) : b => (c) : d => e which either means a ? ((x): b => c) : (d => e) or a ? x : (b => ((c): d => e))
20
2
92
This is despite the fact that every object to ever enter 'sum' had 'val' as its first property with type number, and that sum ever only looked at that property. Doesn't matter; the extra properties are different types and this 100% matters to the engine. 8/10
1
92
Replying to @mattpocockuk
People saying they have library behavior that can't be expressed in TS either don't know enough about what TS is capable of, or are shipping some truly galaxy-brained API design that humans are unlikely to be able to understand
5
5
97
23,324
Replying to @AdamRackis
I can't believe these 12 lines don't explicitly demonstrate every layer of a real app architecture. Also, where are the tests? Are they saying you shouldn't write tests? I would have put tests, docs, and a diagram showing the load balancer, all on this one slide, for clarity
5
7
93
15,712
$1,024 for a side of bacon is bad enough, but $3.77e22 for a soda is out of control
4
14
89