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

Where do the "Popular Gift Lists" at the bottom of the page come from?


It is coming from database, where I have added many lists based on some common interests and recipients so if someone doesn't sure about his/her recipient, they may find a helpful list in explore ideas section.


Is this really what Rust macros look like?


This is one kind of macro in Rust: declarative macros [1]. The other kind of macros in Rust are procedural macros [2]. Both are widely used in idiomatic Rust. And even within the procedural type of macros, there are different categories of macros (i.e., function-, or attribute-like macros).

[1] https://doc.rust-lang.org/book/ch19-06-macros.html

[2] https://doc.rust-lang.org/book/ch19-06-macros.html#procedura...


Yes, and I've seen them in production. Once you learn the rules, you can parse them reasonably well in your head but it is still really confusing at a glance.


It is! Although they are being used in a really weird and not normal way here.

I found "The Little Book of Rust Macros"[1] to be a really good resource for getting started with Rust's declarative macros.

[1]: https://veykril.github.io/tlborm/


I feel like smartphones should be banned but

> On average, they were falling asleep 20 minutes faster than before the ban,

20 minutes seems like kind of a small impact.


20 mins is actually pretty big. The difference between chronically sleeping 20 minutes less than you need, and always getting the rest you need really does add up quite significantly, especially when it comes to learning and the ability to pay attention.


“ sleep. On average, they were falling asleep 20 minutes faster than before the ban, and reported getting a full hour of extra rest each night. ”

An hour of extra rest does seem significant. Also averages without standard deviations are yucky.


To finish that sentence:

> , and reported getting a full hour of extra rest each night.

An hour seems like kind of a big impact.


4% is a pretty big lift imo

And who knows how good it is for the quality of that sleep


Indeed, four times greater than the absolute risk reduction of sever illness or death provided by the Covid vaccine (Nb: among adults), which was also mandated in many places

And the connection between sleep quality and early death is very well documented


It doesn't really make sense to compare the raw percentage of two completely different things. Especially when one is a percent change, and the other one is a percent risk.

There's a ton of health numbers that work out to 4%. Or 1%. Some of them have massive impacts on your life, and some of them are basically negligible.


Next para says

> 50 minutes earlier during the phone ban weeks compared to the week before the phone ban

That’s a big improvement. Combined with them falling asleep faster, that seems like an hour of extra sleep at least.


If it’s the daily average then it’s a considerable impact


Depends on what you are doing, but without additional constraints the real answer is probably python.


python trades speed and correctness heavily in favor of dx. Other languages provide drastically increased speed and correctness with comparable dx. I understand that lang pref extremely subjective, but if those high level values are THE metrics to analyze on (+domain), I’d courteously suggest that there are greener pastures.

https://cdaringe.github.io/programming-language-selector/


The linked tool does not give any suggestions without choosing a subdomain, but if you average the DX suggestions for each domain the top result is javascript. I don't know many sane people who would argue javascript has a better DX than python.

> Other languages provide drastically increased speed and correctness with comparable dx.

Like what?

IMO javascript has both terrible DX and performance and should be avoided unless you are doing front end.

Go quite a bit of boilerplate and initial setup to get going. It also requires you to think about pointer, pass by value vs reference, etc.

You can get someone who is brand new to programming writing simple Python scripts in less than an hour.


Python DX is terrible, Go DX is awesome


I start with bash and work my way up as needed


This is a little light on actual content.

The best practices are: 1) do it in small steps 2) use version control 3) use automated tests 4) make sure the code is readable.

Pretty straight forward.


5) Use "asserts" liberally to check program state.


here's one that a teammate taught me - const everything that can be const and then slowly undo the consts when necessary. it'll reveal lots of stupid implicit state spaghetti. const methods for the OOP flavor of spaghetti.

another one is move variables as close to their use as possible. so many people somehow inherited FORTRAN style (from where! you're younger than me!) and declare variables at the top of a function. that's a brilliant way to either forget to use/remove/initialize them and/or shadow names. drives me utterly insane (because it's like who the hell is teaching people this).

also probably -Werror or -Wall depending on the size of the code base (at least -Werror=return-type, -Werror=unused-variable, -Wunused-but-set-variable, -Werror=dangling).

> use version control

yea lots and lots of incremental commits with decent commit messages purely for you to remember what ground you covered. also lots of branches and rebasing. what a chore but it's the only way to stay sane.

> make sure the code is readable

debatable but my first move is to undo all the spaghetti OOP and "please break out into a function" bullshit. less readable to the junior maybe but much more readable to a senior that needs to actually understand what the entire module is doing.

C++ is fine language - most people just are really bad at it.


> so many people somehow inherited FORTRAN style (from where! you're younger than me!) and declare variables at the top of a function.

I thought this was a C 89 requirement too, and I thought until recently that some Linux distros lifted the build requirement to C 99.

I've worked on a few code bases with all the variables declared at the top of a function though and you're absolutely right - plenty of variables that end up unused or shadowed.


Also from those who learned with Pascal. Traditional Pascal requires that all variables be declared at top of procedure/function in a 'var' section.


> I thought this was a C 89 requirement too

TIL


It's not a C89 requirement. C89 requires variables to be declared at the top of a block, not a function. So, you could write things like this:

  while (...) {
      int a = 1, b = 2, c = 3;
      printf("%d\n", a + c - b);
  }


Ah okay - I misremembered - I only had to work with strict C89 once and that was close to 15 years ago now, and at a similar time I inherited a codebase that did things the C89 way but it was compiled as C++ so with no enforcement of variables at the top of blocks I didn't really pay attention to where things had been declared when it was first written.


A 2028 Predictions thread on HN


I think of it as, “if everyone did this would it still work”.

If you are blasting out emails knowing most will be ignored, in the hopes that one lands in the right inbox, that’s bad.

If everyone did the same, no one would ever find the useful opportunities among the sea of irrelevant trash.

If you are sending cold emails to people you know will be interested, that’s fine.

There is no upper bound on how many actually useful opportunities people are willing to receive.


> If you are sending cold emails to people you know will be interested, that’s fine.

This is my rule. If I gave you my info at some time, and you have a new product you think could be relevant for me, fine. If you got a contact list from some convention, and are shotgunning it with "We sell X. If you're not in charge of Y, please direct me to the appropriate person", I'll report it as spam faster than The Flash.


Tried signing in with Twitter but when I clock "Authorize App" I get:

> Something went wrong. Please make sure the data you entered is correct.


hey, sorry for the trouble, will fix it today

thanks for letting me know !


But what does the business actually do?


Yes, it is a leads driven business. I have focused on improving SEO in three of their core markets. Any new customer that signs up as a result of my marketing efforts, as long as their base margin is met, I get paid for the lifetime of that account.


I love everything about what you're doing here. There's a lot of opportunity in a lot of different niches and it's all just being slept on.

Did you already have a relationship with this company somehow or did you have to go and sell them?


I was introduced to them via a friend. I know the market well enough to recognize that there was potential to find clients and take a "scrape" off the new business. I know the qualms customers have with their existing service providers so whenever there are any concerns I curate very specific messages during the sales process to reel them in. Once they are signed up, getting it right 100% of the time is impossible, so I also step in on the "support" side and help solve issues, provide proposed solutions to challenges, etc. I do agree with you. Many other types of "sticky" and "unsexy" businesses out-there that are very easy to rank highly in SEO locally in dense urban environments.


> Once they are signed up, getting it right 100% of the time is impossible, so I also step in on the "support" side and help solve issues, provide proposed solutions to challenges, etc.

Maybe I'm reaching here, but as a guess, are you able to offer your partner's services out the cut you take to smooth over issues? I'm just thinking that you have fantastic incentives to do stuff like that (prioritize long-term money) that a support person working as an employee of the company directly would not have real incentives to offer...


I think I am following your question but can you clarify if what you mean is if: I take a portion of the proceeds to send customers gifts, take them out to dinners, etc to ensure the relationship remains strong? If so, then not really. Usually these clients just want smooth problem free services. I am working with him on holiday gifting ideas but that's really the extent of it. I also incur some expenses such as marketing costs, software, etc but it is pretty nominal. In summary, clients just want the teams to show up, do a good job, not break anything, listen to special requests, execute those special requests, and rinse wash repeat.


No, I meant if you need to discount or give them service gratis to smooth over an unhappy customer.

In a former life I was a support drone. Days were full of us taking calls from abusive a-holes who just wanted to get over on someone and also people who had legitimate grievances and deserved relief. We typically weren't empowered to do anything about either of them.


Ah, no, never had to do that. There are cases sometimes when the janitorial staff breaks say a light fixture. What we've found is that immediate and direct communication about what happened, how it happened, what will be done to prevent it from happening again, and how we're going to fix is usually is well received and the partner compensates/credits them for the damage. Of course the invoice amount is smaller for the "repair" so therefore my scrape is less. I've tried to explain to my partner that there is a very select type of client he wants and he for the most part has received it well. The larger industrial type facilities are better than the smaller in my experience.


Sounds like brings leads to the janitorial company


But also saves the janitorial company from having to hire people to do customer management/support.


Correct


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

Search: