Hacker News new | past | comments | ask | show | jobs | submit | cokeandpepsi's comments login

Pandering to the people who own the company seems normal


It is also a great way to ruin a company. Especially if you are pandering to the wider market.


Hard to imagine a incumbant who destoryed the country while millions flee won the election, also hard to imagine he's going anywhere


Not surprising I can't recall a time in america where life didn't feel like it wasn't balanced on a knifes edge

It takes so long to feel safety your near the end of the fertile window at least in the case of my wife and I for us it was the '08 recession for others something else I'm sure; we've built a pretty shitty world

my siblings who luckily missed that window had 2-3 kids each and still struggle financially even with "decent" jobs and education.. I can help them with that but that's not the case for others


> we've built a pretty shitty world

The world has always been harsh and unforgiving. When did humans create a better world, and how do you quantify that? I think we're still very well off.


I agree. However, there is a strong sentiment with a significant part of the population that "things suck" which leads to a dim view of the world... which is a horrible way to live. I would go so far as to say that it is self-reinforcing and leads people toward apathy toward the world in general.

Alternatively, if people collectively see the world as a place they are responsible for making better, and that it's better for each individual to do so, then the world becomes a better place. This is hard to get to because "better" at scale is really hard to define. People start worrying about things like human-induced climate change, other environmental pollution, social welfare, etc. Even if we can collectively agree on things that are globally "good," sometimes making things better in one arena causes problems in another arena of "global good."


I'm not surprised, matrix is not easy or enjoyable to use at all; maybe the protocol itself is sound but every implementation I've tried both server and client is seriously bad


the a series are well priced/supported and do more than enough for me, you can pick one up for $300 and be good for years.. all while there are people making monthly payments for 1,200 iphones


I find it interesting that you’re comparing an old, low-end Pixel phone to the most expensive current generation iPhone. If your phone budget is $300 you’d be comparing it to the similarly priced iPhone 11 or SE; if you wanted a prestige flagship phone you’d be comparing it to a high-end Android device costing about the same.


> all while there are people making monthly payments for 1,200 iphones

A lot of the carrier /manufacturer incentives (in the USA) have been fantastic lately, especially if you had an older device which could be traded in.

Right now, through Google, you can trade a Pixel 5a in when buying a Pixel 6a and pay $50 for the upgrade.


I just can't agree with this one


I'm not suprised, they have been scraping the bottom of the talent barrel pretty hard lately


the refactored version of the example is much worse


Do you mind elaborating? I find the refactored version significantly easier to understand than the original. Readability is one of the top priorities for me and I find the original example too clever, in a bad way.


I dislike variables that are used just once. Sometimes they're a "necessary evil", but rarely. For "envStr" it's defensible IMHO as it splits up some of the complexity, but I would rather just use a helper function, which has the same "splits complexity" effect and is re-usable.

"styled" seems entirely pointless here.


This actually surprises me!

One habit introduced to my current team by a former co-worker involves having even more intermediate keys than that:

    const sensitiveEnv = [...];
    const envKeys = Object.keys(envars)
    const safeKeys = envKeys.filter(envar => !sensitiveEnv.includes(envar));
    const safeEnv = safeKeys.map(envar => `${envar}=${envars[envar]}`).join(' ');
    const styled = chalk.dim(`$ ${envStr}`, 'node', args.join(' '));
    console.log(styled);
In the beginning I wasn't a fan of it, as I do a lot of Haskell (and have point-free idioms on the tip of my fingers), and it's obviously unnecessary, as you said yourself. But with time I learned to appreciate this kind of function for its simplicity and consistence.

Now, of course, with a pipe operator (or other similar constructions) you can get the consistency without the intermediate names.


I just find it easier "thing" that happens is one self-contained statement, if that makes sense. Makes it easier to see what does what. I don't think one way is "better" or "worse" btw; all I can say to my brain, I find it harder to follow. This is what can make programming in a team hard.

I'm also one of those people that likes single-letter variables. I know some people hate it with a passion, but I find it very convenient. Just makes it easier to read as there's less to read.

I'm not smart enough to do Haskell, so I can't say much about that.


Oh, a kindred spirit. I also love single-letter variables where they make sense. I have a math-heavy background, so they're totally cool for me, BUT I get why most programmers would hate 'em. I also like them since they were the "norm" in old C# LINQ code where I learned functional programming. If I were alone in the programming world I would have written the example above with single letter vars.

I agree with your remarks, there's no right or wrong, it's like tabs and spaces.

Btw I'm also not smart enough for Haskell, but it hasn't stopped me so far ;)


Extracting `envStr` is definitely the highest impact change for me. I dislike temporary variables too when they don't represent a meaningful intermediary result, but in this case I see them as a lesser evil. I agree that `styled` is more about personal preference.

This is why I'm happy to see the pipe syntax proposal, it avoids unnecessary temporary variables while simultaneously aiding readability.


> This is why I'm happy to see the pipe syntax proposal, it avoids unnecessary temporary variables while simultaneously aiding readability.

The thing is I don't think it's all that much more readable. No matter which syntax you use, there's still the same number of "things" going on in a single statement.

I do have to admit I never worked with a language that uses |>, so I'm sure that with increased familiarly with this it would become "more readable" to me, but one has to wonder: just how many calling syntaxes does one language have to support? More syntax also means more potential for confusion, more ways to abuse the language/feature, more "individual programming styles", more argueing over "should we write it like this or that?", more overhead in deciding how to write something, harder to implement the language and write tooling for it, and things like that.

There is always a trade-off involved. The question to ask isn't "would this be helpful in some scenarios?" because the answer to that is always "yes" for practically any language feature. The question to ask "is this useful enough to warrant the downsides of extra syntax?" I'm not so sure that it is, as it doesn't really allow me to do anything new that I couldn't do before as far as I can see. It just allows me to make things that are already too complex a bit more readable (arguably).


> I do have to admit I never worked with a language that uses |>

Have you never worked with Bash? It's basically the same thing


Indeed it is, but it's kind of a different context than a "real" programming language. What works for one doesn't necessarily work well for the other.


Truly, one of the main reasons I might stop increasing the complexity of a bash one-liner and move it to a full shell script, or bail for Python, is specifically so I can turn those chains of pipes into imperative steps with temp vars so that they're actually legible and easy to reason about. I can't imagine why I'd want to go the other direction.


Those variables help to document intent by naming the intermediate values. They also make step-debugging more convenient. In languages with type declarations, they also serve to inform about the type of the intermediate value, which otherwise is invisible in a pipe sequence.


IDEs for languages with pipes allow break points on pipelines and can show inferred type annotations mid pipeline. Given the popularity of JS, this tooling will appear rapidly after pipe standardisation.


In this case I like that it gives you a hint about what's going on. "chalk.dim" sure doesn't.


The refactored version is doing what pipes would do in a language that doesn't support pipes; it's reordering the statements into execution order rather than having to use a mental "stack" to grok the original version.

Given that the OP stated that they like the pipe syntax, and the refactored version illustrates the hoops you'd have to jump through without it, I guess your comment is just a strange way to agree with the OP?


why? are you of a 'pointfree' opinion? what are your concerns? https://wiki.haskell.org/Pointfree

personally i detest pointfree syntax. having intermediate values makes it much easier to step through code with a debugger & see what is happening. and it gives the reader some name for what the thing is, which is incredibly useful context. the enablement of pointsfree styles is one of my main concerns about potential pipe operator syntaxes: the various syntaxes that have been raised often introduce implicit variables which are passed, and i greatly fear the loss of clarity pointsfree style brings.

maybe there's something beyond the pointsfree vs not debate here that i'm missing, that makes you dislike the refactored example. personally i greatly enjoy the flatness, the step by step production of intermediate values, each of which can be clearly seen, and then assembled in a last final clear step. that is much more legible to me than one complex expression.


I think it really depends on the language.

In languages that more easily support repl-driven development (e.g. Clojure), I think this is less of an issue. If you have a handful of pure functions, you can quickly and easily execute them via the repl, so you get a lot of clarity as to what those intermediate values look like even if the functions are ultimately used in a more point-free style.

But on the other hand, this would be a nightmare in C# (what I use in my day job). Sure, you can execute arbitrary expressions while debugging C#, but IMO you can't really achieve the same clarity. I'd rather see intermediate values like you suggest since it's easier while debugging, vs a bunch of nested function calls.


I agree that

(1) named intermediate values are sometimes more readable ... though I have examples where it's very hard to come up with names and not sure it helped

(2) debugging is easier.

For (2) though, this IMO is a problem with the debugger. The debugger should allow stepping by statement/expression instead of only by line (or whatever it's currently doing). If the debugger stopped at each pipe and showed in values (2) would mostly be solved. I used a debugger that worked by statements instead of lines once 34 years ago. Sadly I haven't seen once since. It should be optional though as it's a tradeoff. Stepping through some code can get really tedious if there are lots of steps.


Intermediate variables also have the benefit to make not just the last value available in a debugger view, but also previous values (stored in separate variables). Of course, a debugger could remember the last few values you stepped through, but without being bound to named variables, presentation would be difficult.


It's hard to understand which statement the debugger has a break point set to when you can put many breakpoints on the same line

I have tools that can do it, but I'll still have a better time splitting out a variable for it, especially since what I really want is a log of all the intermediate values, so I can replicate what it's doing on paper


Would be cool if it got up to 100% one day


Nope. In the "good old days" corpos got thay a move like this would kill morale. Nowadays in the "you should be grateful you have a job" days corpos no longer care. It's great because they can squeeze more work from the people left behind and they also have flexibility when it comes to opportunistically shedding workers around key date (ie earnings)


yeah most american's don't receive severance outside unpaid vacation, the funny thing is that the people who need it most usually don't


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: