1,565 karma · joined November 16, 2018
If you have VerifiedUserWithBirthday, any value that fails the parsing function is implicitly UnverifiedUserOrUserWithoutBirthday... No need to define it separately. You get the inverse type for free IE a value that is of type User and not of type VerifiedUserWithBirthday.
A new property doesn't mean a new derived type. Only if that new property impacts what a VerifiedUserWithBirthday should represent should the VerifiedUserWithBirthday type be updated and even then, it's not a new type, just an update to an existing type. Again minimal updates needed.
The compiler handles all the validation and will tell you exactly where there are any issues - the compiler is what makes the maintenance cost quite low.
type User = { name: string; verified: boolean; email?: string; lastName: string; birthday?: string | { year: string; month: string; date: string; }}
type Birthday = Required<Pick<User, 'birthday'>>;
type UserWithBirthday = User & { birthday: Birthday }
type VerifiedUser = User & { verified: true; email: string; }
type VerifiedUserWithBirthday = User & UserWithBirthday & VerifiedUser;
const userHasBDayAndEmail = (user: User): user is VerifiedUserWithBirthday => {
if (user.email === undefined || user.birthday === undefined) {
return false
}
return true
}
Any caller of userHasBDayAndEmail knows for the rest of its nested call stack if the provided user is a User object or a VerifiedUserWithBirthday.The types are cheap to write (they're all derived) and have no runtime impact (types are erased at build/compile time) and these parsing functions are quite small to write
https://www.typescriptlang.org/play/?#code/FAFwngDgpgBAqgZyg...
In the US we often use the term interchangeably but internationally they are quite different.
How do you create an environment where everything is deterministic? Do they invoke every supported non deterministic function when creating the environment and rewrite those functions to return the values from the environment's creation time? Is there something more complex happening?
Is there a structured concurrency library being used to manage the chained promise calls and lazy evaluation (IE when the final promise result is actually awaited) of the chained functions?
If an await call is never added, would function calls continue to build up taking up more and more memory - I imagine the system would return an error and clear out the stack of calls before it became overwhelmed, what would these errors look like if they do indeed exist?
I think the identity element would be 1 for integers and multiplication, right?
0 would be the identity element for integers and addition.
The goal is to encode the information you learn while parsing your data into your type system. This unlocks so many capabilities: better error handling, making illegal states unrepresentable, better compiler checking, better autocompletion etc.
[1]https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...
No affiliation but it caught my eye when the launched.
Admittedly it still feels abstract to me, but the value proposition of having every capability supported by an API (like AWS's methodology of having all services be API first) on top of an actually chartered bank seems perfectly fitted for the creation of banking services that are significantly easier for consumers to interact with and understand.
I'm curious to see what people build on top of it.
I imagine its how parents might feel when they go to help their children with math homework only to find the math is now totally different from when they were in school and their methods (while still valid) for solving problems are no longer accepted by the school and their child is annoyed by having to reconcile the two systems...
I get the, tailwind works well in a team and scales nicely and you just have to use it, mentality. I've experienced it.
I still prefer a plain style sheets that targets elements by a class or tag (especially since CSS supports nested selectors!).
There is an issue in managing stylesheets, and for that I really like how Remix/React Router manages CSS where CSS flies are defined and applied at the route level. Where that isn't enough or dynamic styles are too complex for a .css file:
style={{...}}
is always available.CSS is so powerful, flexible, and extensible, tailwind feels like a limitation rather than an enhancement. I don't understand the continued appeal, but clearly many others do. I'm not sure why, but I am confident we'll all have moved on to something else in another 3 or 4 years too.
Awesome project and great work on it! Congrats on the launch :)
It seems the sideways arrows in the demo only appear for class based methods and not plain functions :(
Overall I love the idea and have wanted a graph visualization of a codebase showing every function call, who calls it, and who it is called by which this seems to do but for classes. Hope to see this working for functions as well soon! Great work.
Vim has
- normal mode which allows you to enter commands to manipulate text rather than just type characters in the file
- insert mode which allows you to enter text into a file
- replace mode which allows you to replace text
and a few others.
Most editors like vscode, sublime etc only have a single mode that they are always in IE insert mode. Modal editors have additional modes that allow for additional capabilities.
[0]https://www.freecodecamp.org/news/vim-editor-modes-explained...
They are tax efficient since dividends are taxed before they can be reinvested (back into the same stock or any other investment) whereas stock buy backs allow the investor, rather than the company, to decide when to incur the taxes which would be incurred by selling the appreciated shares.
Financially they are equivalent.
The only real argument against either buy backs or dividends concerns if the company is better off pursing this return of investment to shareholders or investing the money back into the business to pursue growth. Finding the balance between these two is critical for every company.
I read almost exclusively fantasy and have always loved reading since I was young. Fantasy series are often trilogies or more with some being over 10 books long.
You go on adventures, read about relationships, interpersonal problems, power, team work, individualism, religion, and so much more. While it's mostly what I read, it's not all, but it keeps me reading.
My team has done a lot of work to lean into the tool IE well defined issues, epics, tickets, t shirt sizing for pointing via 1, 3, 5, etc.
There is lots that can be improved for sure.
With this system, my team, in addition to any one else at the company, is able to click into our JIRA board and get a very high level to a very low level understanding of what we are working on.
This allows for very clear reporting structures and ensures our goals are on track with those of the company's. This also makes outcomes more measureable which is exceptionally helpful for reviews.
At the end of the year or halfway through I can go in and say: I worked on these 4 epics that are part of these two Issues which serve company goals A, B, and C. I completed x% of the tickets for each of these epics, led this entire other epic which was completed on time etc etc.
Where we run into issues is when there is a ticket that has to move between boards. The ideal situation is we just move the ticket from board to board as needed but based on the user they may or may not have permissions and have to open a new ticket linking it to the previous one. Not ideal but that's up to us to resolve to make sure the right people have the right permissions.
We ignore all the analytics IE burn down and friends. Those are useless.
We considered Adaptive Cards, but ultimately decided against it in favor of our own schema especially since we already had platform specific UI libraries.
Why?
Adaptive cards proved inflexible for uses not part of its core capabilities.
Adaptive cards doesn't allow for interactive elements IE charts or graphs with tool tips.
Adaptive cards doesn't appear to be well maintained or supported for ongoing future needs.
There were some other reasons but they are fuzzy a couple of years after the fact. This was one of the most fun projects I've worked on, I had to write a mini parser which is always a fun exercise, and I think it had massive potential. Would have been a very cool project to ship to prod fully but it wasn't meant to be.
[0]https://twitter.com/XDevelopers/status/1585707921433923585
Dependency injection is 'just' passing an argument to a function or method.
Whether that happens via the constructor, some method, or a plain ol' function, its very simple.
But naming it dependency injection and ascribing terms like setter injection, or constructor injection or discussing dependency injection frameworks with complicated set up instructions, can make this very simple concept seem significantly more complex and difficult for junior and mid level engineers.
All my opinion but this was also my experience.
Across 3 companies and 8 managers, I have yet to receive feedback that was productive in helping me understand what skills or track record is lacking and what is necessary to move up. Managers are (often) bad at providing actionable feedback let alone any feedback which leads to lots of blandness in 1:1s which translates to lots of blandness in mid year and end of year review cycles.
I try and rectify this by finding quantitative data: impact on revenue (very difficult though most of the time), MRs merged, GitHub activity, tickets closed, projects led, initiatives taken, demos presented etc but this only goes so far.
All this leads me to believe that at the end of the day promotions are decided by various levels of managers getting together with a few beers, deciding how many total promotions can take place due to budget, and going through a list of names while deciding based on their gut but of course this can't be admitted as the official process.
It is frustrating that unlike other careers IE finance, law, medicine etc where performance can be directly tied to revenue (investment returns, client income, patient income) we have yet to design a standard for measuring impact for many software engineering roles.
Looks like there were 2 outages[0], one in June and one in July of 2021.
[0] https://www.reuters.com/technology/websites-airlines-banks-t...
Cloudflare at least accurately reflects the incident on their status page.
Often dashboards will show everything green despite the service being down.
In these moments communication is critical and Cloudflare does it well especially as we all know when it comes to the post mortem. They are very transparent about these issues and incidents.
NeoVim incorporating Lua as a first class language has allowed plugin authors to build plugins that are faster and better than plugins for Vim written in VimScript (or other languages like python/typescript which are much slower).
There is a strong community for neovim on reddit, youtube, etc and plugin authors do a nice job of building tools that work with each other.
Setting it up I agree is a pain, but once done its very little maintenance/work. Even when I've had to 'redo' my setup (eg switching package managers like vim plug to packer to lazy) its been easy and under 15 or so minutes.
I edit minor things in my config every few months. Everything flows quite nicely now and breaking changes are far less common than they used to be (at least among the plugins I use).
My vim config if you're curious (along with the rest of my dotfiles): https://github.com/sbernheim4/dotfiles/tree/master/vim
Its awesome to have so many choices so everyone can pick the system that best fits them. It also encourages better tooling that can fit on top of any of these like the Language Server Protocol, TreeSitter etc which benefit everyone.
Thanks to everyone for working on all these projects and tooling, its truly incredible.
You have 15 doubles between 1884 and 2034.
So you get 2^10 * 2,000,000 or 2,048,000,000 - just over 2 trillion dollars.
I read through parts of the article - I have no idea what point is attempting to be made. It all rambles quite a bit.
Verifiability and authenticity matter and are valuable. Amazon has long had a problem of fake reviews. This issue with kindle books seems an extension of that. Massive centralized platforms like Amazon makes fraud more likely and is bad for the consumer.
The "decentralization" that we need as a society is not in the form of any crypto based technical capability but simply for the size of the massive players to be reduced so competition can reemerge and give consumers more options on where and how to spend their dollars. Other E-book stores may just pop up that develop relationships with publishers and disallow independent publishing if amazon were forced to be broken up.
I hope the FTC can begin finding a strategy to force some of these massive corporations to split making it more likely for there to be more competition.
Listen to what these post graduate students want - for those who are moving a city like NYC or Boston they are probably enjoying not having urban sprawl, fun downtown areas, available housing, easy and accessible public transportation, etc.