HN user

bern4444

1,564 karma
Posts15
Comments502
View on HN

Yeah that's the engineering part in software engineer :)

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.

It's pretty trivial to create derived and augmented types with Pick, Omit, Required, Partial. Combined with a few parsing functions that return an object typed to whatever specification you need and you are set IE:

    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...

For instance, Math.random and Date constructors are fixed in workflow runs, so you are safe to use them and the framework ensures that the values don't change across replays.

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?

This looks awesome, I had two questions:

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?

The identity element is zero

I think the identity element would be 1 for integers and multiplication, right?

0 would be the identity element for integers and addition.

It's like a tax free dividend. Dividends are taxable but if a company uses the cash they would have spent on a dividend on a buy back there's no taxable event for the investors. Those investors who want the cash can sell and pay the tax and the rest enjoy the higher share price

The most interesting tech company in the banking to me is Column[0].

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.

[0]https://column.com

My initial reaction to Tailwind was: what a pain. I already know CSS, now I have to learn CSS again...

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.

I downloaded this and opened up a React based project that uses functions and not classes. I'm not seeing the sideways facing arrows to show the call stack of the function I'm looking at and have my cursor in - the functions that call the function I'm looking at and the functions that reference the function I'm looking at.

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.

Modal editors like vim and helix have modes[0] that allow for different operations.

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...

Stock buy backs are simply a tax efficient return to investors that are an alternative to dividends.

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've loved books that have won lots of awards and recognition that I only read cause it was part of a curriculum, but it's perfectly reasonable to also not connect with some of them.

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.

Eh - I like Jira or rather I don't dislike it.

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.

I was on a team building tweet tiles[0][1] which required a cross platform UI system that would allow 3rd party developers to register a schema that would be used to render a custom UI under certain circumstances (usually by including a link in your post). We made it to beta, but never beyond given the internal turmoil.

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

[1]https://twitter.com/ashevat/status/1562862418514288640

I agree.

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.

The flip side to these performance cycles is all the time in between in which often very little actionable feedback is provided to engineers which makes the mid year and end of year reviews so difficult.

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.

feat is just the short form of feature; chore is for annoying stuff like fixing lint issues or maybe package updates that don't require any code changes etc... those are the little chores we do to keep everything flowing.

Downtime happens - no one is happy about it but it comes with the job and downtime will happen whether you use cloud or run on prem.

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.

Why Kakoune 3 years ago

I use NeoVim. I used Vim previously and just know the built in basics very well.

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

Why Kakoune 3 years ago

I love that we have so many choices for editors. VSCode, Vim, NeoVim (+ vim distros like astro etc), emacs (+ emacs distros), Kakoune, Helix etc.

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.

Maybe the years and amounts were chosen this way but at 7% you double your money every 10 years (for those who don't know too, percentages are reversible so at 10% you double your money every 7 years...)

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.

It seem that as a society we are coming to realize that enabling anyone to do anything on their own and at anytime isn't the best of ideas.

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.

Its up to the state then to ensure they create an environment that attracts these recently graduated students!

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.