skysight-inc/HackerNews huggingface dataset:
"And you shouldn't cast objects in almost no code ever." - I have a question about tests. Imagine I want to test a function that operates on quite large application state but not all app state is necessary for that function.
Options:

- Define all app state as a snapshot. Problem: snapshot can become stale, so more infra might be necessary to make sure that snapshot is up to date;

- Pass only the necessary state and construct as necessary. Problem: hard to define whole state precisely and ensure that it conforms to runtime state of a healthy app;

- Pass a subset of necessary state for some execution branch and cast the type. Problem: casting may result in test failures during runtime and potentially other issues such as modify-run-fail debug loop;

- Mock return values of functions called within the function being tested and use any combination of "state passing options above".

In a lot of places I use such approach with custom type helpers and transitive types, and passing in only the necessary subset for smaller functions or mocking return values for bigger ones. What do you think? I know that the AppState can be defined as a union of possible states and together with type guards can address those issues better. I just wanted to hear your opinion on how you would address such problems. I hope I explained it well enough.

export type Fn = (...params: any) => any;

type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;

export type FirstParamType<G> = G extends Fn[]
? UnionToIntersection<Parameters<G[number]>[0]>
: G extends Fn
? Parameters<G>[0]
: never;

export interface AppState {
first: {
a: number;
b: number[];
};
second: {
c: string;
d: string[];
}
}

type DeepPick<A, B extends keyof A, C extends keyof A[B]> = { [BK in B]: Pick<A[B], C> };

function calculateUsingFirstB(state: DeepPick<AppState, "first", "b">): number[] {
return state.first.b; // some calculation
}

function calculateUsingSecondC(state: DeepPick<AppState, "second", "c">): string {
return state.second.c; // another calculation
}

// function which takes complex state parameter and calculates the result based on results of other functions
function calculateMore(state: FirstParamType<[typeof calculateUsingFirstB, typeof calculateUsingSecondC]> & DeepPick<AppState, "first", "a">): string | number[] {
if (state.first.a > 10) {
return calculateUsingFirstB(state);
}
return calculateUsingSecondC(state);
}
Yeah, and we deliberately prepend because that doesn't involve writing to a field in a node which may not be in cache. It's the consumer's job to reverse the list if they ever actually need it.
Programmers are incredibly productive. An hour of a doctor's time, an hour of a lawyer's time an hour of an investment banker's time only help one person. An hour of a programmer's time impacts tens of thousands of people.

Programming at a high level which gets good money is hard. It's hard to reach that level, it takes lots of time learning, reading and practicing, it's hard to do the work. Also many programmers work more than 40 hours weeks.

If a good programmer helps a company win a few millions per year or he helps the company to make economies of few millions per year, then he deserves a share of those money.

The demand is larger than the supply and it is likely to stay so since all sectors of the economy demand more automation and not many people like to code or are willing to become programmers.

The "winter of programming" might never come. Even if it comes it is likely that won't happen during our lifetimes, even if we live a lot.

People said long time ago that software is a fad or a bubble that will burst. Still software continued to rise year after year.
>The result was a disaster.

wtf? metres and centimetres are not different types! they are just different ways of writing same type: Length. radians and degrees are just ways of writing a dimensionless Angle quantity. you made the absolutely elementary mistake of conflating a physical quantity with the unit used to measure it, of course it was a disaster.

>nothing sensible to infer when you, say, multiply an angle and a distance

angles are dimensionless so they should just be a distinct type of float. there is literally no problem here.
It’s also an easy way to ensure you remain single. Self-reinforcing.

“Remote area” = down by the river.
This is three years old, but is kind of prophetic.

As far as I'm concerned, the money has been fairly corrosive. It's a damoclean sword, bringing manna, but levels of avarice and corruption that are just heartbreaking.

But I suspect that I'm in the minority in my opinion. I just love the craft of software development, and find it hard to adjust to the new rat race for money.

I do get treated fairly badly, when I mention that money just isn't that important to me. I love coding and architecting. In fact, I do it for free, these days, which was always my dream.
> Why does 100,000 lines of code of python tend to be safer and more manageable then 100,000 lines of C++ despite the fact that python has no type checker and C++ has a relatively advanced type checker?

Because C++ sucks, but static types are not to blame for that.
I agree with the author that there are no signs of pay collapsing anytime soon, but living below your means is always great advice.
The art of resiliency includes letting go, but that is not to be confused with losing.
Industry standard has been over a million dollars revenue per year per employee. That includes non-developer roles, which all exist either to support or sell what developers make, or to enable you to hire more developers (management).

So these companies have had high margins on hiring developers. I think this also makes sense of "why does company X need so many developers to make product Y?"

The answer is they don't need that many developers to make product Y. But companies have largely seen that the more developers they hire the more money they make.

Or course that's a statistical phenomenon, it doesn't happen right when you hire a developer, it isn't guaranteed to happen at all. You're hiring as many developers as you can because it increases the chances that some of them will make money printing machines for you or improve your existing money printing capabilities.

I can see salaries going down if revenue is dropping across the board and companies switch to focusing more on making money right now and less on maximizing these chances. I don't think it is likely to drop like a rock, though.

Between being roughly zero margin once produced and being general purpose, software does promise to eat everything. But not everyone can afford to pay developers. Prices going down means more people looking to hire.
> If AI enables you to build a full-fledged Google Docs clone in one day, your value in the labor market will go up by a lot, certainly not down

If AI enabled everyone and their dog to build Google Docs clones in one day, you can be sure that your market value won't go up but plummet, so keep the trick to yourself.
At a place like SpaceX, software engineers working on internal corporate software make far more than the mechanical engineers in propulsion doing things that have never been done before. It's just a function of the market. You'd never be able to hire any software engineers if you paid them the same.
US oil producers reap $200B windfall from Ukraine war price surge
I am an aphant, I can not imagine anything.

While I can appreciate to have a good income and always had good paying jobs, I was never really interested in making a career and becoming filthy rich. Possibly because I can not imagine myself in this situation.

On the other hand I was always better then others on making long term strategic plans.

[0] https://en.wikipedia.org/wiki/Aphantasia
https://archive.ph/nPgjI
> What makes me nervous, though, is that we don't really understand why programmers are paid this well

Are you kidding? Computer programmers have extremely high burnout and surprisingly low job satisfaction. People are eager to rush in to the field but they slowly realize how tiring the work becomes. I chose industrial engineering in college as my computer science friends would constantly tell me about just how much programming they had to do as part of their internships. I can't even recall a person who said they loved programming for 8 hours a day and wanted to do it for the rest of their life.
The pay is deserved. Case closed.
I just got done detangling various ip addrs, ports, and paths being passed from Go to C bindings. Not fun

Rust having builtin IP address types (and libraries actually using them) is long overdue for mainstream programming languages
Well, but design a great widget and a manufacturer can scale production as high as necessary.
Thomas Watson thought the total number needed would be 5 [1]

[1]https://www.uh.edu/engines/epi1059.htm
You seem to be conflating trespassing for taking photos, as well as selling photos and/or contempt of court for taking photos.
Not for long.

I think the point op is trying to make is without the investments in software to support business modeling, procuring supplies, scheduling staff, payroll, online marketing and all of the front of house functions like reservations, online menus and what have you, your steampunk restaurant is going to be outcompeted eventually.
Before English, French was the international language of diplomacy, and it was very influental in science and humanities. Spoken French is as simple as Spanish at a glance. The writing system is peculiar, but still much more regular than the English one.
As other people have said, it's kind of scary to think about getting an account somewhere and not understanding that that "place" has a specific culture or political orientation that ends up making me a bad fit for it in a way I didn't understand.

And I guess imagine there are some potentially significant incentive problems about the way that instances talk about themselves and their communities.

How does the federation part work in practice when people run their own instances?
I have an index. Doing text editing in vr just can't compete with my 34" 4k monitor under any circumstances. However, virtual chalkboards can activate a different part of the brain and can be quite nice if you like working that way normally. VR is also excelent for viewing cad models but the tooling still needs tons of work. Once there is proper vr support in autodesk products i will likely use it maybe 30% of the time.

One thing i didn't anticipate is how hard it is to do the equivalent of alt+tabbing to a reference document or similar and then jumping back to the main program in use in VR. Context switching is important for productivity and probably can't really be done right without remaking the whole desktop environment for vr. I would wait at least 5 years before expecting anything to be viable as a full monitor replacement.
> they use excel

Indeed, many companies make great progress because of this. But inevitably they reach a point where it is unamanageable or unmaintainable. Then who do they depend on to keep their business operating (as it is now overly dependent upon Excel)?

I'm glad you mentioned it though, as it is something I have direct experience with. The firm I worked for several years ago was full of very sharp people, such that they made great money on mortgage related debt trading before, during, and after 2008. They did it by applying their effort and knowledge and depending on complex spreadsheets their people had made. But it reached a point where Excel would regularly corrupt the file; and opening the spreadsheet would take 10 minutes on modern hardware. And many activities were ungodly slow.

Who might you imagine took their Excel VBA and rebuilt it (still in Excel, and still with VBA) so it took an order of magnitude less disk space and launch time, and also a fraction of the file space? Yes! A software engineer. Also, as most of us SWEs do, I didn't know VBA before being given the project and producing a very successful new version.

How much money did they make using my version in the following years? I assure you it was enormous compared to what they paid me to do it.

A good developer is a force multiplier. Our salaries, if we actually do a reasonable job, should be large.
use mypy? it can enforce the type hints.
Are my 17+years of C++ experience not enough?
If you were unable to focus your eyes properly afterwards it means the headset you have tried has been likely poorly adjusted and/or damaged. Typically the interocular distance was likely set incorrectly for you (there is a slider on the headset physically moving the displays & lenses), forcing your eyes to strain in order to see clearly.

Another aspect causing discomfort is for the headset lenses to be
sweaty/greasy/fogged up slightly - again very common when doing mass demos on exhibit floors ...

The dizziness and disorientation depend very much on the content you are working with. This is not universal! So the fact that some demo you have tried made you very dizzy and feeling uncomfortable only means that that demo was poorly made and not that all VR content will feel like that.

In addition, the feeling of dizziness and motion sickness will diminish over time for most people. So don't judge the entire concept on your poor 10 minutes experience that you had in less than ideal conditions.

(I have worked over 20 years on VR/AR, both as a researcher and commercially)
This is what scares me. I predict that instead of developers salaries going down, there will instead be fewer low-hanging jobs for developers to pluck. We have an increasing workforce of web-stack developers (front-end JS, back-end JS, full-stack JS) that, as far as I can tell, do a LOT of the same stuff in the same language (JS) over and over again. I don't know when, but I am very confident that that skillset will be replaced by AI Software 2.0 in the relatively near future. That will lead to a massive reduction of jobs and a massive influx of SaaS type web-stack software. Obviously that means an increase in demand for AI developers (but only until that cycle repeats on them) and "prompt engineers" and project managers.

I've put time into learning a skillset that I genuinely think will be unnecessary in the near future and the solution is to prepare for a skillset that has almost zero fiscal value in the short term. That's a tiring thought, haha.

I could totally be wrong, but that's a future that I think is highly likely and people who think they can't be replaced are kidding themselves. I need to learn lower level programming ASAP.
Totally this. Did decision fatigue stop you from using email? It didn't because they all talk. It doesn't really matter which you choose.

This is especially true now that there is an official system to change/move servers.
Notably, energy conservation is a local property of spacetime. Meaning, if you can manipulate the metric, you should be able to create (or vanish) energy.

Creating the warp-bubble clearly takes energy dependent only on its volume, not the mass contained therein.

Here, with a subluminal warp drive, you could hoist matter out of a gravity well and let it fall down afterwards.
It exists, it's widely supported, and it's good enough. There's no reason it has to be XML, but there's no good enough argument against it to justify fragmenting an already shaky ecosystem.
GPT3 Password Guessing
Libera chat is rad, though channels are a mixed bag on IRC servers. I've met awesome people with whom I've been in IRC channels now for... phew... 25 years, on Undernet of all places.

I find it hasn't changed all that much over the years, if at all, so some should be warned - it does remind me of the early wild-west days, which I love.
> Looking down at my laptop for years has become a source of chronic pain

Why not use an external monitor at eye level?

Or elevate the laptop and use an external keyboard.
I'm sure it varies from person to person but its only going to get better.
I doubt anyone is really going to care all that much if all the unchecked randos lose their voice on twitter. It will clean up the noise by a lot.
Luckily tech is one of the few fields where having the corresponding degree is not necessary and you can make a good life for yourself without following a traditional path to upper middle class (like law, medicine, finance etc)

> go to a bar, tell someone you make 300K

you must be having way different bar conversations than I've ever had - maybe they just don't like you as a person lol
What about the part where they purged and executed every one of their allies - socialists, liberals, even opposing cliques in their own theocracy - after the overthrew the Shah?
Well... in this case there is?
Totally agree should have played that much more up in my comment.
As an embedded C developer that just moved to JavaScript, this is very true.
This is a pretty cynical view of things, and definitely isn’t nearly as true anymore. Software engineers, depending on where in the country you are, are often extremely well respected now.
I mean, I get it I have some pothos but also limited window space and shelf space. A 30x improvement in efficiency is compelling.
See https://hnrss.github.io/

Filtering on points or comments will cut off the long tail.
we are still hiring and it's hard to find a suitable candidate who is willing to take the offer and join our company.
Thanks! Macroexpanded:

Programmers Should Plan for Lower Pay? - https://news.ycombinator.com/item?id=21904070 - Dec 2019 (492 comments)
Maybe we could try labeling broken code "opinion".
Thanks! Year added by a volunteer year editor. If anyone else would like to be a volunteer year editor, let us know at hn@ycombinator.com.
Yes especially considering it’s pronounced the exact same way.
The source code of the standard library is usually an awful way to show off any language. Pointing and gawking at such a thing as criticism is very bad criticism.
People love reasoning things from first principles rather than learning.
Well, and save for retirement.
Asking, encouraging, and highlightning the negatives of not doing his way isn't forcing in any way at all.
The thing is, isn't this an universal phenomenon across the entire tech industry over the past 2-3 years? After the initial pandemic onset panic, company valuations skyrocketed and so did the demand to increase headcount.

Isn't everyone at risk, except for those at companies that have already had layoffs?
It's a pity I can up-vote only once. This nails it!
The obligatory: https://scottlocklin.wordpress.com/2019/01/15/quantum-comput...
I have a friend who is a composer for film.

She has made some of the most exquisite thought products I've ever experienced (a strange way to talk about music, but I'm trying to cleave to the OP.) She works 90 hours a week, has been well-regarded in her industry for 10+ years.

I've seen her drop everything, on any night of the week, to hit the deadline for wrap, dozens of times in the last year alone.

She has $400CAD to her name, has no car, and rents. If she weren't in a housing co-op, she'd need to move out of the city -- and as it already stands, she lives in the roughest neighbourhood in town.

The moral of this story is that enjoyable, well-regarded work where you feel a deep connection to the end-product almost inevitably becomes part of its own compensation package.

There will be people who will code for free, for 'exposure', and there will be a lot of them, not too long from now at all, because coding is a delight, and is becoming more delightful every day (cf CoPilot).

I think a lot about how the romanticization of coding as a profession parallels the romanticization of the music industry in the 80s and 90s. People work cheap for hallowed dreams. Pride goeth before the fall.
Sustaining engineers write very little code. Tell me how they'd all stay employed with such a metric.
Congrats on the milestone(s). It has been interesting watching the github, lots of activity and discussions.

What's the roadmap looking like these days?
Your comment "Like it or not, virtually every aspect of life now is dependent on software" reminded me of Heinlein's "The Roads Must Roll".

In the story, the road technicians were the linchpin to a system that millions of people depended on daily. Some of the technicians decided to go on strike, owning to their beliefs in the "functionalist revolution":

> Concerning Function: A Treatise on the Natural Order in Society, the bible of the functionalist movement, was first published in 1930. It claimed to be a scientifically accurate theory of social relations. The author, Paul Decker, disclaimed the "outworn and futile" ideas of democracy and human equality, and substituted a system in which human beings were evaluated "functionally" - that is to say, by the role each filled in the economic sequence. The underlying thesis was that it was right and proper for a man to exercise over his fellows whatever power was inherent in his function, and that any other form of social organization was silly, visionary, and contrary to the "natural order."

> The complete interdependence of modern economic life seems to have escaped him entirely. ...

> Functionalism did not take hold at once-during the thirties almost everyone, from truckdriver to hatcheck girl, had a scheme for setting the world right in six easy lessons; and a surprising percentage managed to get their schemes published. But it gradually spread. Functionalism was particularly popular among little people everywhere who could persuade themselves that their particular jobs were the indispensable ones, and that, therefore, under the "natural order" they would be top dog. With so many different functions actually indispensable such self-persuasion was easy.

The subtitle of the original 1940 publication: "The higher civilization becomes, the more it is dependent on each unit — and the more it is at the mercy of a few!" - https://archive.org/details/Astounding_v25n04_1940-06_SLiV/p...
I've moved from Python to a static language and it's made programming enjoyable again. I'd forgotten that that was possible. It's much more productive as well. Using Python as a production application language is like playing operation. For me what I really detest is ambient, untyped (in the sense that they aren't declared in the function definition) exceptions. Exceptions can just happen on any line, and there's no way to know what exceptions a function will raise. So you have to dig into the source code of your dependencies and such, it's a tremendous waste of time and you still get unanticipated exceptions in production.
This is BBC. People expect it to use British English and will complain if they don't use it.
Hear hear - we are alike. My comment was basically yours, aimed at another person who was correcting someone, with incorrect information.

That said, I had parents like that too, _and_ I did a comp-lit degree, so I'm basically hopeless.