How computers could change pure mathematics - <AUTHOR> http://www.slate.com/articles/health_and_science/science/2015/03/computers_proving_mathematical_theorems_how_artificial_intelligence_could.html?wpsrc=sh_all_dt_fb_top <comment><USER2> And on the flip side, computers can suggest beautiful theorems to mathematicians by making it easy to run virtual experiments.

There's now a burgeoning field of pure math called "Experimental Mathematics," where they do just that. A good intro on how computer experiments can be used in algebraic geometry is here: [http://math.uga.edu/~noah/files/spheres.pdf](http://math.uga.edu/~noah/files/spheres.pdf)

(Disclosure: Noah was my college roommate and we published a paper with Henry Cohn on experimental mathematics for high-dimensional sphere packing, so I'm a biased participant.)

<comment><USER3> I did my PhD in complex dynamical systems, and in that field, computer experimentation is invaluable. The favorite way to generate hypotheses is to explore with computer tools. Once you notice a pattern, then you trot out the theoretical tools to try to solve it.

<comment><USER4> Could you give some examples of the computer tools/software that are commonly used?

Could you provide or maybe point me somewhere where I could get an expansion of the ideas in your last sentence? Is it basically creating a simulation along certain non-linear parameters then running the simulation and watching what results? Like, "hmm... that looks like a phase transition, let me see if I can workout what is going on"?

</comment></comment></comment><comment><USER5> We're already in a world where mathematicians publish proofs that only a few other people in the world can (and have the time to) understand or verify. I'm thinking of e.g. Shinichi Mochizuki.

I think a lot of the art will be getting the computer to emit proofs in a form amenable to human understanding.

<comment><USER6> 99.9%+ of all papers published by Math professors are incomprehensible to all but a few experts.

You know all those famous problems that were solved recently? How do you know they were actually solved? Maybe the Math professors are just pretending to check each others' proofs, playing a gentleman's game, and they don't want to admit that these achievements were wrong?

How do you know? Do you really want to spend 5-10 years learning enough to check one of these proofs?

If it's a computer-generated proof, and people checked the source code but can't read the proof (because it's terabytes of details), is that a valid proof? It isn't really leading to any greater understanding.

<comment><USER7> >99.9%+ of all papers published by Math professors are incomprehensible to all but a few experts.

That's just flat out not true. In fact I would hazard a guess that the reverse is true (0.1% of math papers are incomprehensible to most). Not to say that math is simple but that just because something is highly specialized does not mean it is incomprehensible. Of course my only evidence is that the vast majority of specialized physics papers that I read only require some background in quantum mechanics, statistical mechanics and some of the problem domain. I read some papers in math journals too and feel like they're about on par in general.

There are certainly some mathematicians that publish in super highly specialized fields that are remarkably difficult to understand but these are a teensy tiny minority.

<comment><USER8> Understanding papers depends on what your field is.

For example, I'm interested in optimization/signal processing/machine learning and finishing up my education. In the related journals I can barely understand the notation and miss the higher level concepts.

On the other hand I'm taking a class that required me to read a journal paper written by the professor. It was strange: I could understand it. I followed it and most of the finer details too.

I would say that OPs statement _is_ true: 99.99% of papers published by math profs are incomprehensible to almost everyone. Not only do they use foreign notation there's also a lot the don't say because it's assumed the reader knows enough to prove it -- hence "left as an exercise for the reader..."

<comment><USER7> Just because someone doesn't understand how a jet engine works doesn't mean its incomprehensible to them. It just means they haven't spent the time and effort to understand it. There are very very few topics out there in this world that you cannot understand if you've had the proper training.

Granted a lot of topics may take a couple of years to understand, or even a decade. But guess what, it took the author that long to understand it too.

</comment></comment></comment></comment></comment><comment><USER9> It is worth noting that according to the Curry-Howard isomorphism[0], programs are equivalent to proofs and vice versa.

0.[https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...](https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence)

<comment><USER10> You have to pay close attention what system of logic the proofs are written in. So, for example, it is an open problem, how and whether proofs written in homotopy type theory can be interpreted computationally (source: [http://en.wikipedia.org/wiki/Homotopy_type_theory#Computer_p...](http://en.wikipedia.org/wiki/Homotopy_type_theory#Computer_programming)).

<comment><USER11> I thought this was more or less solved with the recent developments on the cubical sets models? There is even a toy interpreter with univalence and higher inductives:

[https://github.com/simhu/cubical](https://github.com/simhu/cubical)

<comment><USER12> They've done a lot of good work, but it's not quite done yet. The original conjecture has not been answered in the affirmative, and there are also further questions...

</comment></comment></comment></comment><comment><USER13> The scenario in the OP is not very promising:

E.g., we can study the natural numbers and the integers, rationals, algebraics, and reals, but why the reals? Well, they are the only complete, Archimedean ordered field.

Why do we care? We want the order because we want to consider bigger and smaller. We want a field because we want to be able to do basic arithmetic.

But why do we want completeness? Because it says that pi, e, square root of 2, derivatives, and the Riemann integral exist with few or no more additional assumptions.

Why? With completeness we get compactness, continuity, and uniform continuity and, thus, know that the Riemann integral of a real valued continuous function on a closed interval of finite length exists and we also get the fundamental theorem of calculus.

Why do we care about calculus? Because it is the main way to discuss, analyze, and understand continuous change, e.g., Newton's second law and planetary motion, fluid flow, heat flow, electro-magnetism, etc.

And why do we care about such analysis? Because it has been one of the pillars of physical science, engineering, the industrial revolution, and the growth of technology and economic productivity since Newton -- that is, we care about _applications_.

So, to understand mathematics and why we do it and why some math is important, need also to understand applications to the betterment of human life on this planet, and I'm not holding my breath while waiting for the automation of that!

Apparently now there is a big theme, climb on the bandwagon, ride the wave along with everyone else trying to get people up on their hind legs to grab their eyeballs for ad revenue, of with _artificial intelligence, the machines are about to take over_.

We've had many waves before -- they come and they go. And we've had that wave of the computers about to take over before, and apparently we will more times before computers can get even remotely close to any such thing.

Ah, basic rule: "Always look for the hidden agenda.". Here, it feels to me like some people are grabbing at me, by the heart, the gut, maybe below the belt, definitely below the shoulders and not between the ears.

<comment><USER14> Sometimes I wonder if the usefulness of calculus is overstated compared to other areas of math. Linear algebra & discrete math pop up a lot more than integrals in CS.

I loved my real & complex analysis courses but my courses on linear algebra, abstract algebra, & discrete math have been much more useful.

<comment><USER13> I can understand and essentially agree with everything you said except your first sentence, and I'm not sure the rest of what you said does much to support your first sentence!

One point is, CS isn't the only area for _applications_!

E.g., in the software for my startup, sure, I have some matrix theory, right there in the code, but it turns out the matrix theory is what is left for the actual code after some earlier derivations very much in _calculus_!

When I was a prof in a B-school and teaching linear programming, right, awash in linear algebra, I mentioned to my students, all of whom had had the required courses in calculus, that I regarded it as a "pillar of Western Civilization". I still do.

Without Newton's second law, Maxwell's equations, etc., I strongly suspect that Western Civilization would be a very different and much less good place.

E.g., my father in law eventually slowed down his farming and got a job in town. He was head of the REMC -- Rural Electric Membership Cooperative. So, it was the local electric utility. They handled only the last few miles and bought their electric power from the _grid_ , really from one private power company.

Some of his customers were factories, and at one point he asked me why his engineers put large capacitors outside some of the factories. Well, I'd been a ugrad math major but, except for one course I wanted instead of another that would have been required, also a physics major, and had done well in ordinary differential equations, so had see the differential equations of basic passive AC circuit theory, that is, with resistors, capacitors, and inductors.

So, sure, the factories had a lot of big electric motors with a lot of inductance. So, the utility pushed current to the motors but half a cycle later the motor pulled more current. So, net, the utility was moving a lot more electrons than necessary to deliver the power it was getting paid for and, thus, was getting more power losses in its lines. So, put a capacitor just outside the plant, and then the plant looks like a pure resistor to the electric company and all the extra electron moving is just between the motors and the capacitor just outside the plant. Ah, _applied calculus_!

There are many more such examples; the examples say that calculus is really important but don't really settle your question about "overstated"; for that question, I don't know what to say!

</comment></comment></comment><comment><USER15> I recall an experiment that Gowers was doing when he had a program that would write proofs to basic theorems and questions that an undergraduate math major might encounter in a first analysis or linear algebra course. His experiment was to see if other could distinguish between proofs written by students and proofs written by the program.

You can see some of that in [1] and [2]. Although I was not fooled (nor do I think that people who both understand analysis and have a bit of foresight into the structural approaches such a program would take would be fooled), it was interesting to see.

[1]:[https://gowers.wordpress.com/2013/04/02/a-second- experiment-...](https://gowers.wordpress.com/2013/04/02/a-second-experiment- concerning-mathematical-writing/) [2]:[https://gowers.wordpress.com/2013/04/14/answers-results- of-p...](https://gowers.wordpress.com/2013/04/14/answers-results-of-polls-and- a-brief-description-of-the-program/)

</comment><comment><USER16> Also, [http://www.math.rutgers.edu/~zeilberg/Opinion137.html](http://www.math.rutgers.edu/~zeilberg/Opinion137.html)

(Doron Zeilberger's opinion can only be gleaned from a large sample of his writings.)</comment>


Reddit Moderators Are Locking Up the Site's Most Popular Pages in Protest - <AUTHOR> http://techcrunch.com/2015/07/02/reddit-is-blowing-up/

<comment><USER2> [https://news.ycombinator.com/item?id=9822580](https://news.ycombinator.com/item?id=9822580)</comment>


Making Work, Destroying Wealth - daniel-cussen http://www.cato-at-liberty.org/2009/01/12/making-work-destroying-wealth/

<comment><AUTHOR> One issue that I have with all of the analysis of the current crisis coming from the left and the right is the intellectual dishonesty that they engage in. They seem hesitant to say, 'look, the nature of the world's economies have changed. The thing is, we have only a tenuous idea as to how.'

For example, long ago, when production was king, the hierarchy of real estate values in port cities went like this:

Industrial (Port or Factory) > Office > Residential

This was based on the belief, widely held by the nation's businessmen at the time, that the value of a given 'widget' is related in a very real sense to the total value of the things that 'widget' will produce in the future. This rule was true for valuing everything, real estate is just a convenient example here.

Well fast forward to the late 1990's and all of a sudden a businessperson finds that there is profit to be made converting factories, warehouses, and even entire ports to condos. That is, converting industrial real estate to residential real estate created profit for developers who undertook to do it. Now in a normal economy perhaps this could happen in a few places as production shifted elsewhere. What we need to consider though is that this was happening in virtually every American city of any appreciable size. This was drawing down American productive capacity in a systematic fashion. Where new productive capacity was built, it was built outside of the cities. In essence, FURTHER away from the ports. This indicates that the planners foresaw a diminished interest in exporting anything that was produced.

Now all of that might make perfect sense, I would need more data to make that determination. My point is that people on the left in the right tend to neglect an in depth analysis of trends like this, and instead appeal to what might be termed 'soundbite economics'. 'It's the unbridled greed of the elites!' Or, 'Well this is what happens when the government forces you to give loans to poor minorities!' The fact the market was buying these bonds and entering into these mortgage contracts, makes little difference to people who make the 'unbridled greed of the elites' argument. The fact that the market consists of many times as many teachers, police officers, and plumbers as investment bankers and real estate developers, is similarly ignored. On the other side, the self evident reality that striving yuppies rather than impoverished minorities were the ones buying this new housing, and then defaulting, is conveniently omitted from their protestations of government interference.

In any case, we would be far better served to look at things going on in our real estate market and ask what do these things tell us about the fundamental nature of our larger economy? As I said, I would need more data to make a determination as to the appropriateness of some of the pricing that was happening. That said, at the very least, the seeming financial prudence of converting industrial to residential should have told us, 'Hey, guys, here's something you should look at to make sure things make sense with respect to where you want your nation's economy to go in the future. Because I know in the past you always thought that production was king, but your pricing is saying otherwise right now.'

I think the economic world may have changed, and since we are still making decisions the way we have always made them, we find ourselves in a crisis. I'm no professional economist, still, I believe we really need to be able to articulate where and how the economic world has changed prior to prescribing solutions. An exhaustive enumeration would be ideal, though it is inessential. I just mean that policy makers should have SOME idea how things have changed at that fundamental level, and whether those changes make sense for the United States.

I told you all of that to tell you this. People on the left and the right making these arguments through their respective think tanks, would have as much trouble as anyone else enumerating the changes in economic fundamentals that have developed in the past say, 20 or 30 years. The difference is, intellectual honesty. That is, most are willing to acknowledge that deficit, whereas think tank gurus will give you an answer that aligns with their school of thought. Without regard to any of the contradicting facts.

</comment><comment><USER2> So let me get this straight: we have this little problem here where a bunch of people borrowed money to buy houses and lifestyles that they couldn't afford and the resulting debt has choked up our financial system. Now it seems like a good solution for the government to borrow a whole bunch more money and spend it on things that we may or may not need? We won't have any of those nasty earmarks; instead, we'll just hand billions of dollars over to state and local governments to spend how they want. Yeah that sounds like a good idea, that way in five years the contractors and construction companies that benefit from this largess can replace investment bankers as the new national whipping boys.

<comment><USER3> The main problem the simulus is trying to avoid is capital destruction. At some point, if enough people get laid off, it becomes a self-reinforcing cycle. Now, instead of a few people being laid off for a couple of months, companies start to shut down operations for good because there is reduced demand (Google Austin, anyone?). Once you shut down an office (or factory, or mall, or whatever), it can take years before anything pops up to replace it.

There really is no benefit to having a bunch of unemployed people lying around.

I think it is fair to argue about the best way for the government to stimulate the economy, but doing nothing is not really an option.

</comment></comment><comment><USER4> A few things missed by this overly simplistic analysis:

Alternative energy investment, to name one of many examples in Obama's economic plan, isn't "make work". This sort of research is necessary if our society is going to survive the inevitable oil depletion problem, and will create wealth in the long-term. Improving our infrastructure, which is in desperate need of repair, isn't make work. No one that I am aware of is seriously proposing make-work.

Bush's war and no-bid contracts to his buddies look a lot more like "make work" than anything Obama is proposing.

Also, these problems are too complex to frame in terms of creation or destruction of wealth. Is wealth being destroyed as real estate prices revert to fairer values? Perhaps, but this is a _good_ "destruction". Also, adding to the aggregate wealth while destroying jobs (without replacement; job "churn" would be a great thing if this society were better at training people up) and creating inequality is a very bad thing. Finally, the wealth of the wrong people (such as the uncouth trashy real-estate nouveaux who destroy culture everywhere they go) is a horrible thing and must be destroyed.

<comment><USER5> > Alternative energy investment, to name one of many examples in Obama's > economic plan, isn't "make work". This sort of research is necessary if our > society is going to survive the inevitable oil depletion problem, and will > create wealth in the long-term.

Not so fast. Some alternative energy "investment" may end up being useful. A fraction of that will end up being worth more than it cost. However, the history of govt spending on "alternative energy" is filled with boondoggles that were worse than "make work".

If you're going to argue that Obama's program will be different, you're going to have to do more than describe "features" of things that failed in the past.

</comment></comment><comment><USER6> Job = enslavement. The goal of the current economic-stimulation is to create millions of new enslavements. From the article:

 _Drama was a Keynes tool. During a 1934 dinner in the U.S., after one economist carefully removed a towel from a stack to dry his hands, Mr. Keynes swept the whole pile of towels on the floor and crumpled them up, explaining that his way of using towels did more to stimulate employment among restaurant workers._</comment>


Android developers can now force app updates - <AUTHOR> https://techcrunch.com/2019/05/07/android-developers-can-now-force-app-updates/ <comment><USER2> > In addition, Google is launching its dynamics updates feature out of beta. > This allows developers to deliver some of their apps' modules on demand, > reducing the file size for the initial install.

So you can install an app, go offline, try to use it, and realize that you can't because you did not install it after all but Google lied to you.

<comment><USER3> A lot of apps (games in particular) already do this by downloading a bunch of resources on first launch. It sounds like Google is giving them a proper way to do it.

<comment><USER4> I believe the modules it refers to are executable code (dex and so files), which you're currently not allowed to download because it circumvents the app store and its approval process.

Google now supports uploading such modules to the Play store where they can be approved, analyzed and tracked, thereby allowing on-demand features without allowing third parties run arbitrary, unvetted executable code on your device.

<comment><USER5> Right... but that is a distinction without a difference: it was the case that some assets were being downloaded after the app started, and that without those assets the app did not work, and now that is still the case; the form of the asset doesn't matter as long as it prevents the app from working after the base install without first downloading whatever it is.

</comment></comment></comment></comment><comment><USER6> I hope the UI for this feature says "This app requires an update to work. Update or Uninstall?"

If developers see even a small fraction of users choose uninstall, they won't force updates anymore. Nearly half of android users at any point in time have run out of space and can't install updates anyway.

<comment><USER7> > Nearly half of android users at any point in time have run out of space and > can't install updates anyway.

Do you have a source for this? Not saying that you're wrong but I'd be very surprised if this was the case. In my experience Android is so laggy as to be completely unusable at anything above about 85% storage utilization. In fact it's the first thing I check when friends / family members complain about their phone being "slow".

<comment><USER8> I have a Nook tablet with 8Gb internal storage and a 32 Gb MicroSD card installed. Almost all of the Google and Nook apps cannot be moved to the MicroSD card space. Android takes up almost half of the 8Gb internal storage and the unmovable apps take up almost half of the rest, leaving very little space to work with. I've had lots of occasions where the system has told me it needs more space to do an update, and I would have to delete some of my apps to get that update.

I really like my Nook, but having Android and Google apps locking up so much of the internal space seriously impacts its usability.

<comment><USER9> Maybe you can move these apps when you root your tablet, but you should do some research first

</comment></comment></comment></comment><comment><AUTHOR> I understand the attraction from a developer's point of view... but as a user this is a troubling path toward even less control over my device.

<comment><USER10> Just what I want when I try to use an app quickly (e.g. my bus tickets or something related to time-sensitive travel) - forced updates.

I'm going back to Nokia.

</comment></comment><comment><USER11> _> Developers can force users to update, say with a full-screen blocking message, force-install the update in the background and restart the app when the download has completed or create their own custom update flows._

I don't like this idea from a user experience point of view. I hate auto updates (on iOS) because I have been disappointed heavily more than a few times with some games that got worse (on ads or more ads or experience) or some apps that made bigger changes in how they work and how they charge users (like going to a subscription model from a fixed price model).

I also like to read the release notes of app updates so that I get to know about new features in a release. This is very cumbersome (or impossible) to know if auto-update is turned on. Some apps show the list of changes on launch of the new version, but this is up to the developers to do in a way that's not very intrusive while keeping it interesting. Ideally, there should be APIs for these, and users should be able to reject updates and stay on an older version if that's what they want (subject to some platform related restrictions or constraints).

Edit: It's ironical and amusing that Android, the (almost) "do whatever you want" OS on mobile, is the one forcing this on users first. Surely there'll be ways developed to disable this by/after rooting the device?!

<comment><USER12> Especially annoying when an update comes out that is known to have issues on your device and you'd like to avoid it until the issues clear up. For instance, I don't update my Macbook to the latest version of macOS immediately after the update comes out -- this is because I know there are likely to be bugs and I don't need to live on the bleeding edge most of the time.

Another example: venmo recently updated on my iPhone SE (very small 4" screen by modern standards). I can no longer send a payment request or pay a friend because the buttons for those options are literally displayed off screen. I can also no longer dismiss the "get the venmo card!" popup that appears a few times a day when I log in because, you guessed it, the dismiss/ok/cancel buttons are all rendered off-screen. I actually knew this was an issue prior to updating because of a friend, but auto-update pushed the new version to me before I could stop it and now I can't use venmo.

Software needs different release channels for different users. A lot of us would rather be on stable stuff than the bleeding edge. Of course, with modern alpha/beta testing techniques bugs are going to show up in most applications no matter what (looking at you, Spotify)... but it would at least help a little.

</comment></comment><comment><USER13> I wonder if it will be a permission users can see an app has before installing for the first time or updating to a version that includes this "feature". I guess one will have to be even more careful deciding to purchase any apps, and make backups of apks so one can restore a previous known working version without the forced auto updates...

</comment><comment><USER14> Hint to other developers out there: if you do this to an app on my phone, I will delete it and give you a nastygram low rating on the play store. Just don't.

<comment><USER15> You'd probably give a nasty rating if you opened the app and everything was deprecated.

Whats the big deal exactly? Do you complain when a web page changes?

<comment><USER14> I like ownership of my phone and it's OS. I like control over what is on my phone. I pay attention to who develops the apps I use, and I read their changelogs after approving upgrades. I don't give nasty ratings to apps that I haven't updated, that job is on me, because it's my device. So no, I probably wouldn't do that.

I have complained at web page regressions, especially when they sacrifice usability for visual improvements, but only when I have some sort of stake in the page, such as paying for the service or being a long time user who has contributed consistently.

And the specific part that galls me about this feature, which will result in nastrygram ratings and comments stems from this new "feature": "Developers can force users to update, say with a full-screen blocking message, force-install the update in the background and restart the app when the download has completed or create their own custom update flows."

That is a hard no from me.

</comment></comment></comment><comment><USER16> What if an app is sold and I don't trust the new developer?

<comment><USER17> Does auto-update persist when authhor changes?

<comment><USER18> Yes, alas, same for iOS AFAIK. It's a flaw in the security/trust model of both platforms. Similarly, you'll be prompted for new permissions if a malicious new owner adds new permissions to the app, but nothing tells you it's a new owner so you will likely grant permissions without realising everything might have changed.

<comment><USER19> It's not really a flaw. Whether it is the same app or not is being distinguished by package name + signing key. If both versions are signed by the same key, for all intents and purposes the newer version is legit.

On Android, in offline scenario, the installer doesn't even know who is the author and whether it changed. Here, all it knows is the above: package name + key used to sign.

<comment><USER16> Seems like a flaw. E.G.:

[https://www.androidpolice.com/2019/04/27/es-file-manager- van...](https://www.androidpolice.com/2019/04/27/es-file-manager-vanishes- from-play-store-possibly-part-of-do-global-scandal/)

</comment></comment></comment></comment></comment><comment><USER15> Everyone is so damn negative. Devs were force upgrading apps before and this just makes for a consistent UI. It also fixes the race condition where the dev rolls out a forced update but it hasn't propagated to all regions. This is a good feature.

<comment><USER20> We're 'so damned negative' because this is yet another anti-feature that removes control from the owner of the device.

If I don't want to update now, I shouldn't have to. My device, my rules.

And this feature encourages bait and switching: free app is no ads and free, and then at update+1 gets malware installed for free on forced update. We've already seen this with optional updates - only now they won't rely on tricking the user. They'll just update.

<comment><USER15> You think anyone that was going to bait and switch was stopped because there wasn't a consistent UI for the feature?

</comment></comment></comment><comment><USER21> To be fair, developers have been displaying warnings and "you need to update" screens for a long time already. It's just that there is now a standard way to do it.

<comment><USER22> That's very different than force-upgrading apps. There's no excuse for forced upgrades.

</comment></comment><comment><USER23> Well as an Android dev, if you didn't already have a deprecation strategy in place, then that's not really a commercial standard app IMO. Since forever, at least for networked apps, we need to be able to deprecate APIs, and know which client versions we explicitly test and support etc. (It's easy to do, along the lines of: simple HTTP call to check latest and minimum supported app version at start up, or once a day or whatever; compare with current app version; then nag, force or do nothing as appropriate).

This might turn out to be a helpful feature from Google... then again it might turn out to be half implemented, have a confusing user experience, not work properly for most usecases, and mainly serve to confuse new developers with yet another thing to learn, when all they needed to do was a bit of HTTP and layout work. 8 years doing Android, I'm 50:50 about most of Google's "help" until I've seen it in action.

</comment><comment><USER24> I once bought a fantastic yoga app for 4.99$ from an independent developer, I used it every day for a month due to its simplicity and understandably.

It has since been bought by Gaiam, where it was switched to a >4.99$ per month subscription, while offering little to no additional features. Furthermore when contacting the company they had no way of honoring my original purchase, the response was basically "too bad for updating, and here's 10% off a yoga mat".

I greatly fear the integrity of software ownership when it comes to apps. I love the model of paying a fixed price for a great software release that fulfills a need. I feel like there needs to be some way for the user to retain the state of an app or there's no longer the guarantee of keeping what you originally paid for. You're now at the whim of an vendor cutting features or putting them behind a paywall after the original sale.

</comment><comment><USER25> I look forward to seeing how this feature will work on my phone with no google play services installed.

</comment><comment><USER26> Yeah, nah. I decide what software gets installed on my devices and I decide when that software is allowed to update. I'm not going to tolerate a self- updating app any more than I'm going to let Amazon unlock my front door by themselves.

</comment><comment><USER27> Can't read this because of oauth. Sounds extremely bad. Is there a way to avoid it as a user?

Can developers add new permissions this way?

<comment><USER17> No, permissions need to be exactly same.

</comment></comment><comment><USER28> The inline updates thing takes a bit of the advantage away from React Native/Expo, which can push updates without app store changes, although with that tooling there is no notice to the user, the new features just appear.

</comment><comment><USER29> This lets developers force downgrades after you start using or pay for an app.

This makes an app account hijack even more dangerous.

As a result, this is a net negative and a further appleization of Google app store through removal of choice.

</comment><comment><USER30> I have 20 apps on my Galaxy S4 with Android 5.0 because i don't wanna give them extra permissions they asked for over the time, if they force this shit on me i'll be really pissed

</comment><comment><USER31> I wonder what % of users auto update all their apps anyway?

<comment><USER22> I certainly don't. I want to review any updates before they get installed. Not all updates are desirable.

</comment></comment><comment><USER32> as a dev ->This is pretty great - no more having to support users who refuse to update apps/are using some hacked version of your app in order to access older APIs you're supporting for older versions of apps. I envision this settling into a LTS version and rapidly updating(or even beta) versioning system - which large app devs like whatsapp already do.

as a user ->i already switch to an app's beta ASAP, this makes doing that unnecessary(if the dev is smart about it and doesn't just force updates for monetisation)

People complaining are forgetting that apps aren't applications - they're small and easily forgotten/uninstalled unless they come up with something new and exciting - which right now is locked behind a clunky visit to the clunky play store. Apps controlling updates isn't me having less control - i always have the power to uninstall an app if it gets irritating about updates. The new feedback/rating system means that apps that mess this up will plummet rapider than before in the play store too!This feedback loop gives me more insight as a user into a devs practices vs before just hoping a popular app was decent about updates.

Google files explorer even encourages you to uninstall apps you don't use for a long time to save space - which (anecdotally) finally led me to nuking all adobe products from my phone and life and switching to arguably better paid app alternatives for mobile.

<comment><USER22> > Apps controlling updates isn't me having less control

Yes, it totally is.

> i always have the power to uninstall an app if it gets irritating about > updates.

So, if I have an app that works perfectly well, then it force-upgrades to a form that doesn't, my only choice is to stop using that app? I should be able to continue use the version that works for me. If I can't, then I don't have control over my own machine.

<comment><USER32> Well yes, from a business perspective the app dev wants to take the app in a direction that doesn't align with your usecase. your recourses are

1.leave a bad review 2.uninstall the app

That is literally the contract between you and the app dev btw, they aren't obligated to try and keep users if it doesn't make sense business wise and you aren't obligated to stick with them any longer. This is the dark side of the freemium model i guess but how does it make sense for an app dev to provide you free use of their idea by you using an older version of their app(if their business model doesn't align with that)?

</comment></comment></comment><comment><USER33> In my recent memory, Moviepass and Chase Bank already did this last year?... Not sure what makes this different

<comment><USER34> "Previously, it was only available to a few select Google partners."

</comment></comment><comment><USER35> It is easy to show an alert about the update or quit app. You don't need this feature at all

<comment><USER36> Yea you can obviously already do this, Google just added standardized function calls for it so you're not rolling your own. Plus in-line code updating (previously apps could only download additional assets like game data; code updates outside the Play store were against the rules and could get your app pulled).

</comment></comment><comment><USER22> Damn, this makes me really happy that I'm going to be able to ditch the Android ecosystem.

<comment><USER37> Yeah I switched to iOS few months back and I don't get along with it at all, but with the regressions of Android 9 along with news like this I don't want to switch back to Android either... Guess I'll have to see what becomes of the Librem Phone.

</comment></comment><comment><USER38> Why all the negativity?

It has always been possible to implement on your own, and often was. It just removes additional friction. It's a feature intended for apps with security updates, or apps that require online communication with the server, like games.

<comment><USER22> > It's a feature intended for apps with security updates, or apps that require > online communication with the server, like games.

Regardless of the intended use (whether or not that intended use justifies forced updates is a different question), it is certain that app developers will be using this for more things than that.</comment></comment>


A Built-in Web Server For PHP - <AUTHOR> http://wiki.php.net/rfc/builtinwebserver <comment><USER2> What's the deal with the negative comments? You basically get this feature as a gift. If you don't use it, you won't be affected by it in any way. If you do, you get to enjoy the author's labor for free. Where's the problem here?

Any idiot can write a snarky comment about PHP. Very few get to write code that has anywhere near the impact it had.

<comment><USER3> The problem is that this encourages lazy development. Many developers love the ability of tools like Tomcat that allow you to run your web app inside of the application server itself, rather than having to configure a pesky Apache server.

The problem this creates is that once a developer has it running on their own machine inside Tomcat (or now this PHP built-in webserver) the app is probably coded in such a way that it will ONLY run inside this server, and will never scale. What's more, they often turn it into a production application with real customers depending on it, and blame you if you can't make it scale to handle hundreds or thousands of users.

This is the problem with using "built in" webservers. It encourages developer laziness, and encourages people to kick bad code over the fence to the operations team who has to make it reliable and run in production. Never mind that a built in PHP webserver will never scale to meet the needs of more than a few users.

<comment><USER4> Sounds more like a procedural issue being created by poor programmers and bad management. Not testing it on a production-like environment is a capital offense whether you are using a development server or apache/lighttpd/nginx.

<comment><USER5> I think it's better if the devs run something close to the production environment.

The problem is, web developers already have a lot on their plate.

LAMP. The operating system, the web server, the database, and the scripting language. Plus HTML, Javascript, and CSS. And all the frameworks that "simplify" making these work together nicely. Then they have to figure out how to deploy on the test and prod servers. Oh, and they better back _everything_ up. And some redundancy would be good.

That's on top of the existing requirements:

\- VCS \- Bug tracking \- Documentation \- Project management (Scrum? PMI? Flying-by-the-seat-of-their-pants?) \- UX / UI design \- Unit tests

Not to mention having some domain knowledge. The above is fine for a to-do list, but they might also need to know how to solve "real" problems, not just do IT.

<comment><USER6> "I think it's better if the devs run something close to the production environment."

I used to think so too, but I changed my mind a few years ago. Have diversity in the environment in the phases leading up to staging/testing leads to many problems being uncovered early - hardcoded paths, platform assumptions, potential performance issues that only show under some circumstances, ...

I think it improves the code if various devs use different installation paths, DB's, development tools and even OS's. I've seen many deployment issues that would have trivially been detected if devs had different environments.

</comment></comment></comment></comment></comment><comment><USER7> Hopefully this will end the long-standing practice of novice PHP developers writing code and pushing it to production to test it (or worse, editing code on the production server).

Yes, I know you can set up Apache and mod_php or whatever, but starting a server from the command line is just awesomer. You'll see, guys!

<comment><USER8> This is probably the biggest potential win for this feature as long as said developers understand the difference between the inbuilt webserver and the production server (the difference between python paste and apache/mod_wsgi).

</comment></comment><comment><USER9> This is a great addition to php's toolset.

And for those, who want greater flexibility, <https://github.com/indeyets/appserver-in-php> is a Ruby-Rack/Python-WSGI style solution which gives you possibility to initialise objects, open db- connections, pre-warm caches, etc. before serving requests. Provides HTTP, SCGI and Mongrel2 interfaces

<comment><USER10> Here is how we use the PHP AppServer in Midgard Create. Very easy setup:

[http://bergie.iki.fi/blog/introducing_the_midgard_create_use...](http://bergie.iki.fi/blog/introducing_the_midgard_create_user_interface/#5ef787a743aaa025fb1edb5f7086eab1)

</comment></comment><comment><USER11> Seems like this would be useful for development. It'd be great to be able to print to the console for debugging purposes etc. while working on something.

<comment><USER12> i use error_log() for that and just tail apache's error log.

for dumping arrays and things, i use an error_log_r() which just does print_r to the error log:

         function error_log_r($obj) {
             ob_start();
             print_r($obj);
             $lines = explode("\n", ob_get_clean());

             foreach ($lines as $line)
                 error_log($line);
         }

<comment><USER13> Hey, rather than using ob_start and ob_get_clean you can do:

      $lines = explode("\n", print_r($obj,1));

Or better yet if we're playing golf:

      array_map('error_log', explode("\n", print_r($obj, 1)));

<comment><USER12> ah, i must have written that a very long time ago when the return parameter to print_r() wasn't available.

thanks, i've updated my local implementation.

</comment></comment></comment></comment><comment><USER14> The best argument for PHP having it's own web server is to allow novice developers an easy way to code and test their sites. I'll go out on a limb and say I don't think the lack of a built in web server has hurt PHP's adoption in the past.

And a built in web server would only be good for the novice tinkerer. I don't see entrenched PHP shops switching, nor new applications being written specifically for the build in server when Apache w/mods, nginx or LigHTTPD offer better solutions (mature solutions) that are available now.

</comment><comment><USER15> I guess no one really needs this _bad_ but if someone's up to build it, why not?

If it's kept as simple as the RFC suggests, it should be stable real soon and there are definitely scenarios where I'd choose this over launching Apache or even installing it, depending on the task and environment.

<comment><USER16> Give it some time to burn in first. Always give any new webserver time to burn in first. I'm not sure that anyone has yet successfully produced a web server that does not ship with the trivial directory traversal vulnerability on day one, for instance.

I don't say this because it's PHP particularly either. Nobody seems to be able to avoid really trivial and massive vulnerabilities in new web servers. I've lost track of the number of times I've seen it. I'd link to a search of osvdb.org for "directory traversal web server" but it seems to be down.

<comment><USER17> One thing the Symfony2 framework does that I sort of appreciate is limiting access to the page to calls from localhost only by default. It seems like that might mitigate some of the (no doubt gaping) security issues.

</comment></comment></comment><comment><USER18> I feel this is trying to solve a problem where there isn't one. You can easily install MAMP or XAMP and have access to a full stack if your developing on your local machine. There are so many other higher priority items for PHP to address.

<comment><USER19> As a PHP newbie many years ago jarin's comment resonated with me:

 _"Hopefully this will end the long-standing practice of novice PHP developers writing code and pushing it to production to test it (or worse, editing code on the production server)."_

I was guilty of this because I just wanted to start writing code, not shave yaks for an hour to get Apache and everything else installed.

Rails definitely got this right, I doubt it would be nearly as popular if it weren't so freakin easy to get started on the tutorials. Not that PHP has a popularity problem.

<comment><USER20> I guess you were just lazy.

There is practically never a valid excuse for uploading testing code to production, unless the site is down __and __you already have everything under revision control.

<comment><USER19> Is being 14 years old and not knowing better a valid excuse?

I think it's good to encourage best practices even if everyone _should_ know these things, especially for the newbies.

</comment></comment></comment></comment><comment><USER21> I've already done something like this. I've implemented a Rack style web server in PHP: <http://github.com/dhotson/kelpie>

I also wrote an extension for the mongrel HTTP parser, but you could probably get away with a half-assed pure PHP HTTP parser.

<http://github.com/dhotson/httpparser-php>

It sounds crazy but it actually works pretty well. :-)

</comment><comment><USER22> I like this idea. It would be handy on dev machines, and I would use it.

</comment><comment><USER23> I really hate this idea. Coupling the server to the language seems like a weakness in both django and rails to me, since it means deployment becomes more of a scary hurdle, with possible changes in environment between your dev server and production.

One of the strengths of PHP has always been for me that your development and production environments are pretty much the same, and deployment is just a matter of finding a way to copy the files over (and you can be as simple or clever about that part as you like).

Teaching a newbie how to run the PHP server is not that much less complicated than getting a default apache install running (especially with all the LAMP and WAMP installers out there to do it for you), and then you'd have to teach them about apache anyway before they pushed to prod.

<comment><USER24> I think that advice flies in the face of best practices.

1\. Your dev box isn't supposed to be very similar to production, this is why you have staging servers. My dev boxes have weird tooling and debug tools. They also run all services on a single box rather than distributed. Don't pretend dev is at all like prod, this assumption will disappoint you.

2\. App servers, which generally speak HTTP and use a standard interface (in ruby Rack, in Python WSGI) and speak HTTP to a load balancer (probably nginx). Are simple and just work. They're less pain than setting up apache. `cd myproject && rails server` is nice.

3\. There are about 10 billion things you can get wrong with setting up a production server. If you can't figure out how to proxy requests to an app server you have no business setting up a server in the first place. You've probably already lost.

<comment><USER23> 1\. My dev system is a series of VMs that mirror that same box deployments we have in production, the only difference being that systems we duplicate for redundancy in production are singular in dev. I've found that this prevents accidental dependencies between libraries and processes that would otherwise complicate deployments and scaling.

2\. For me, "apt-get install apache" once is much simpler and cleaner than running a dev server every single time, but I have been doing it this way for more than a decade, so perhaps you are right and I am just set in my ways.

3\. If you can't set up a production environment you can't set up a production environment, and it doesn't matter which architecture is involved.

</comment></comment></comment><comment><USER25> NodePHP anyone? heh, afraid that would be a little more then just a SAPI implementation though, we'd have to throw out a good chunk of the standard library and very few if any extensions were coded for asynchronous execution.

An interesting thought though.

</comment><comment><USER26> I don't really get it as the RFC clearly compares two different things. Web servers included in _frameworks_ to ease the development (django/ror and others like web.py) and a web server included in a cli interpreter which is more or less the engine itself. For me there is a huge difference and mind gap I'm not ready to do. I genuinely think that php is a convenient language for a lot of things but implementing a simple class (like SimpleHTTPServer) looks more natural to me than adding a server directly inside the cli.

</comment><comment><USER27> As much as I'm not so sure about the overall idea, it had never occurred to me to look at cli php from this angle before. Rather than homegrow the listener/invoker there I wonder how hard it would be to do this with xinetd.

Then there's the apc cache question, there would have to be some way of persisting/sharing it.

Full blown goofy, but a little fun to ponder.

</comment><comment><USER28> This is nice for a PHP cloud PaaS. Imagine the instructions for testing an app locally before deploying it to the cloud. Instead of trying to coach the user on setting up Apache (or whatever) in a way that mirrors your platform, you just point them to "php -S".

</comment><comment><USER29> I would agree if the webserver was a functional replacement for apache in a production machine. What I mean is that, if the built in server is more efficient than apache and it can be used with performance gain (lets skip the middle man)

</comment><comment><USER30> I know its kinda useless for anything other than "just because i can" but anyone can code their own webserver in for PHP using PHP. Just saying. Might be useful for development on your own machine or something.

</comment><comment><USER31> I applaud this!

Django has this built in, Rails too. PHP went a step further and put this in the core language and that makes sense because PHP in itself is meant for the web, and is not a framework over some other language.

<comment><USER32> Actually, it is. PHP is a Web framework for C, except it uses its own syntax. Or to be more precise, PHP is a templating engine for C, only it got out of control.

</comment></comment><comment><USER10> We've been using a web/application server written in PHP for quite a while now: <https://github.com/indeyets/appserver-in-php>

</comment><comment><USER33> If they mean for it to only be used for development and not production, it would be funny if they hard coded a specific set of 'normal' ports that it would not work on!

</comment><comment><USER34> Couldn't one simply write a php script opening up a socket and routing the request as fit? Is there a need for this in the core?

<comment><USER35> It's unnecessary to have to write that every time you want this feature though. Would be nice, and certainty more efficient, for it to be in the core.

<comment><USER34> I'm just thinking this would be better suited for a quite simple php script/framework you could download, since it's not in any way meant for deployment.

<comment><USER9> see my comment here: <http://news.ycombinator.com/item?id=2283301>

</comment></comment></comment></comment><comment><USER36> Ouroboros has bitten its tail.

</comment><comment><USER37> no

</comment><comment><USER38> Oh god... as if configuring Apache for a non-trivial site wasn't complicated enough, now we'll have the full genius of those responsible for PHP's function naming conventions writing their own web server? Is this _really_ necessary? Why not spend the time making PHP's namespace support not suck, or working on the SPL?

<comment><USER39> Curious as to why you think PHP's namespace feature (I'll assume you mean the real one introduced in 5.3) sucks.

It seems like you didn't read the whole RFC. The configuration is actually very simple (just the command line options), and not meant to be a front- facing HTTP server.

<comment><USER38> Off the top of my head, because when I want to reference My.Namespace.MyClass.Foo(), I have to do something like:

      use \My\Namespace;
      $var = new Namespace\MyClass();
      $var->Foo();

I have to remember and type the parent namespace for every imported class I want to use. In a big project this gets to be too much typing and too much for my brain to remember. Contrast with say, C#:

      using My.Namespace;
      MyClass var = new MyClass();
      var.Foo();

You import a namespace, and the compiler figures out what goes where without you having to remember anything.

Plus the weird exceptions required for backwards compatibility, and the global namespace: I often forget where a root \ is required and where it isn't (not when declaring a namespace, but often--not always!--when referencing one). And of course there's the monstrous choice of namespace separator.

End of the world? Not really. Sucks? Yeah. And possibly a dealbreaker for me for larger projects with complicated namespaces and lots of classes.

I'd love for this to be just a misunderstanding on my part, because it would make my life a lot easier if PHP namespaces where more like C# ones!

<comment><USER39> Your PHP example is possible to write in a way that is nearly identical to the C# you provided. Why are you prefixing Namespace\MyClass(); when you declared your namespace scope in 'use \My\Namespace'? Your assignment can just be:

      $var = new MyClass();

This brings it pretty much in line with your C# example. Have you read the PHP docs on namespaces?

<http://www.php.net/manual/en/language.namespaces.basics.php>

<comment><USER38> That's the point; the PHP doesn't compile without the namespace prefix. In fact I just tried it to make sure I'm remembering right.

<comment><USER39> I was taken aback when I tested this for myself as my initial reading of the PHP docs lead me to a very different conclusion. You are indeed correct, and in my opinion that _is_ very broken. Touché.

</comment></comment></comment></comment></comment></comment><comment><USER40> I don't really see how this would help. Thats what FastCGI is for. You would have to be dumb to expose a php internal HTTP server to the world, and configuring a FastCGI backend is no harder than setting up a HTTP backend in apache/nigix/whatever. If its just for testing, most apache installs come with PHP by default, its just another command to learn.

<comment><USER41> Seems like the built in server would be most useful for newbies to get an application running. Think if how much easier it is to get a basic Rails app running to start learning compared to configuring Apache and PHP together.

<comment><USER40> Normally you just install apache and php and they just work. Macs come with both pre-installed as do most linux distros. Don't see whats so hard!

<comment><USER41> It isn't too hard for someone who is already familiar Apache. On OS X, mod_php is not enabled by default, requiring new users to dig in and learn about apache config files and document roots. I'm not saying it is difficult, and it is obviously important to learn, but it would be nice to be able to have a 1 page "get started with PHP" tutorial.</comment></comment></comment></comment>


Devastating LTE apropos of the paper Methylphenidate exposure and neuron loss - <AUTHOR> http://www.plosone.org/annotation/listThread.action?root=53905

<comment><AUTHOR> We discussed this[1] yesterday, but this letter to the editor is worth reading. Lots of useful info for reading and understanding a scientific paper.

[1] [https://news.ycombinator.com/item?id=8263515](https://news.ycombinator.com/item?id=8263515)

edited: One of the paper author has just reply to the LTE</comment>


Ask HN: Tricks to improve posture? - <AUTHOR> I'm sitting in front of a computer at least 8 hours every day and have noticed that my posture is terrible, constantly hunched over especially when I'm at my desk. Has anyone developed any tricks or tips about improving posture? It seems like a simple problem but requires constant reminding, otherwise you will fall back on your old slouched posture. Thanks! <comment><USER3> Wall slides [1]

They are quick and easy to perform and surprisingly effective. After 20 of them I fell my back and neck muscles kind of "activated". They wont fix everything but they are a good immediate action and will also make you more aware of your posture and muscles.

[1]: [https://www.youtube.com/watch?v=Apk- frSspcU](https://www.youtube.com/watch?v=Apk-frSspcU)

</comment><comment><USER4> Yes. Strength training, especially back and shoulder exercises such as deadlifts, rows and shoulder press.

I'd advice doing whole body training though, rather than focusing on posture only.

I've tried a posture brace before. It helps to remind you to straighten up, but it didn't feel like a permanent solution. I eventually went back to bad posture when I stopped using it.

</comment><comment><USER5> Proper heavy deadlifts are one of the best exercises to help posture. It's impossible to get a good amount of weight off the floor slouched over, and after a few weeks of training this movement you'll have good posture habits drilled well into your head.

...at least once this whole virus situation clears up. In the meantime, maybe farmer carries with heavy book bags or somesuch? If you're not in proper posture it will hurt, but correct form will challenge your grip strength more than your back. Planks are also wonderful for building up the strength to keep good posture.

Farmer carry demo: [https://youtu.be/cBv3NcxqhPM](https://youtu.be/cBv3NcxqhPM)

<comment><USER6> One form cue from deadlifts that's very helpful is to "hold the ceiling up with the top of your head" to finish. When a lot of people "stand up straight" they are pushing their sternum forward and arching their upper back. What good posture really is about is taking the force of gravity and distributing it straight down among all your joints, then resisting it with all your muscles.

Your feet are pushing into the floor, your knees are pushing into the tops of your tibias. Hips, ribs, vertebra, head. When you feel the downward pressure on your skeleton it means your muscles are pulling you _up_. Like a circus tent pole surrounded by guy wires, you're in a perfect balance between tension and compression.

I don't know if there's one weird trick for it. Ice skating helps you develop the feel.

<comment><USER7> I think this is the same thing a karate instructor meant when she told me to imagine I'm being pulled upwards by a string attached to the top of my head. Not exactly a "one weird trick", but a very effective mental image.

</comment></comment></comment><comment><USER8> I use meditation. I spend 20-30 minutes sitting on the floor focused on my breathing and muscle tension. Without anything to support myself, as I relax, I'll slowly find a pretty good posture. It's hard to hunch over when you aren't leaning on a keyboard. I find that it tends to translate over to the rest of my day.

</comment><comment><USER9> In two parts:

1\. Fix the underlying ergonomics. Put your monitor higher and your keyboard closer. The position you want is like the rest position of a dancer: elbows nearly against your sides, relaxed. (Taking an actual dance class will teach a lot about posture habits). A small change of a few degrees here and there can make a big difference. If you are a laptop user and have been actually resting it on your lap, try putting a shoebox or similarly sized object under it.

2\. Train mobility. The hunch develops as a result of persistent overtraining in one direction. You don't need a lot of additional strength to start to correct this, just mobility.

Look up Youtube channel "Calisthenic Movement" \- there are some very good mobility routines and I have incorporated parts of them into my everyday workout. Some of them use a pull-up bar but most are pure bodyweight and the floor or a wall.

If you want to stock a home gym I suggest going for resistance bands - they're small, light, cheap, more forgiving than weights and hugely versatile.

<comment><USER10> A laptop user should either buy an appropriate stand (I have [1]) and keyboard and mouse, or a monitor. Or both.

This is so essential to a reasonable posture that it's essentially required by workplace safety regulations in Europe. (In other words, in Europe your employer should buy these things, including for working at home.)

[1] [https://www.therooststand.com/](https://www.therooststand.com/)

</comment></comment><comment><USER11> There are not effective "tricks". Strength training will "magically" solve the issue.

Try this: [https://hundredpushups.com/](https://hundredpushups.com/)

<comment><USER12> While the parent post might appear dismissive, I've found that strength training is indeed the best way to improve posture. Once you learn to lift weights in good form, the body tends to naturally stay in good posture even when you are not doing your exercises. I've found that no amount of conscious effort to observe oneself and maintain good posture is even remotely as good as just doing exercises to strengthen one's body. Of course, mobility and flexibility help too and I'm assuming one is doing enough stretching as a good way to cool down after the exercises.

</comment></comment><comment><USER13> Try a $20 upper back brace. Wear it for 20 minutes at a time while you're working. It conditions your upper back to straighten up and become less rounded.

[https://www.amazon.com/Posture-Corrector-Men-Women- Truweo/dp...](https://www.amazon.com/Posture-Corrector-Men-Women- Truweo/dp/B07DKHTKP3/)

<comment><USER14> $20 is really cheap for this kind of value prop.

Have you tried it yourself? Not doubting, just always have some skepticism of reviews on Amazon haha

<comment><USER15> I got an el-cheapo one from Staples. Same idea, same shape, etc. It helps a lot, but it takes some fiddling to dial in the right amount of tension pulling your shoulders back.

</comment></comment></comment><comment><USER16> I second everything about hitting the gym, seeing a physio, and focussing on back and glutes etc.. but for some tricks and cues, I recommend getting a great chair that you love, positioning your screen slightly higher and maybe closer than you normally would, get a MS sculpt keyboard which positions your shoulders outward more comfortably, pretend you're James Bond or some badass woman when you're walking around, and position your car seat at right angle if you drive. Also tell your partner if you have one to poke you when you slouch, and think abiut squeeezing your abs when you walk

</comment><comment><USER17> All of the above/below. It's a complex problem (which I share) caused by a lifetime of habit, and it takes a long-term, multi-pronged/phased approach. A) Physical fitness: proper conditioning will allow you to hold posture for long periods of time without fatigue/strain (this is something you work towards over time). B) Physical environment: everything must allow you to maintain posture without excessive leaning/reaching/craning; don't hold a fixed position continuously, but your base state should be strain-free. C) Habits: take frequent stand/stretch breaks (sometimes I stand up if I am reading something that will take a minute or more; also remember to rest your eyes periodically; look out the window; engage in brief social interation; standing desks are great (alternate with sitting), especially if you get restless). D) Triggers: develop reminders about posture (if I see my reflection from the side or when I'm sitting in front of a TV...; I try to be (not self-)conscious of what an observer would see); when you stretch, use that to "reset" your postural expectation (through repetition, it will become your "natural state", and you will be aware of when you're out of sync with it); if I don't feel like I'm standing up _really_ straight, then I'm not. E) Mental state: if you feel tired, depressed, preoccupied, etc. then you will lose track of all of this; it won't seem important, and you will regress; pick it back up again and move forward (it's about improvement/maintenance, not "fixing"). HTH.

</comment><comment><USER18> I've been sitting on the floor, resting my laptop on the coffee table. When I get tired, I put the coffee table on the dining room table and stand. I used to fatigue quite quickly and go back to regular desk, but after 3 weeks of this, that's how i spend the majority of the working day. You can't use your chair's back support when you're on the floor or standing so you're forced to engage your core muscles.

<comment><USER19> How do you sit on the floor? I used to this a while back but I would have a hard time keeping a straight back and not slouching.

<comment><USER18> I either sit in half lotus, or 90-90 style stretch. When I started I had a hard time sitting like that for more than 10 minutes, so I had to change position frequently, but it's better now. I'd switch from sitting to standing ( dining room table + small coffee table). When I got really tired, I'd sit down and start slouching. I slowly increased my sitting time.

</comment></comment></comment><comment><USER20> I've had good success with the Upright GO.

It's a little device that you stick on your upper back and connect to your phone via Bluetooth. It detects when you're slouching and buzzes your back with a slight vibration to remind you to sit up straight.

[https://www.amazon.com/dp/B0747YHYZF/](https://www.amazon.com/dp/B0747YHYZF/)

</comment><comment><USER21> This is a problem I faced which contributed to giving up my day job in front of a computer. The ongoing solution for me started by going to an exercise based physiotherapist.

Simplified, the anterior muscle chain (muscles along the front of your body) are over activated and are not working in balance with your posterior chain. The muscles in front are shorter and stronger. In back they are weaker and elongated. This especially in hunched forward posture and neck tension.

The muscles in front also work harder to hold your body upright as you are probably used to 'thinking' with the front of your body. Instead of being evenly balanced and distributed properly from the hips and up through the spine.

This is a simplification and each muscle in the body tends to have complementary and opposing muscles. Each individual will manifest problems in different areas and require strengthening and stretching accordingly.

My current physio has a Pilates studio and focuses on strengthening and stretching tailored to me. Not cheap but for me it has helped to identify and rethink how I move in an intuitive movement focused manner. 60 per week for an hour session so not prohibitive.

Also Alot of problems tend to have issues rooted in the glutes and hip flexors, I.e. an imbalance down there at the body's structural core manifest up through the spinal and muscle chain. This being the case with me I do a lot of glute work and hip flexor work as well as upper and lower back strengthening etc.

Eventually going to a gym or something similar being the goal, i suggest to start with a good excercise based physio, ones who do Pilates seem to have the right science & body mechanics approaches, to establish good form (which can be quite non intuitive if you have under active and over active muscles).. starting out at the gym may be overreaching and may compound imbalances... a good instructor may help but start at the physio imho.

Good luck!

</comment><comment><USER22> I agree with the strength training mentioned here, but I also found out I was sitting wrong. I always had my hips tilted too far forward, as if I was slightly slouching. Often made me hunch my upper back and my lower back would ache if I worked for too long.

I forget where I learned it, so unfortunately I can't provide professional guided advice, but I saw an article about sitting better and making sure your hips aren't too far forward or back. It took some getting used to as I had been sitting poorly for years. I needed time for certain things to stretch a bit so that it became natural, but now I've even had compliments on my posture while sitting.

Getting a split keyboard helped too. Being able to spread the two halves prevented my shoulders from pinching together in the front.

</comment><comment><USER23> One easy-to-forget factor is lateral symmetry. Especially with asymmetric multi-monitor setups (including laptops), it's easy to spend hours with the body facing straight, but the head tilted slightly to the side. This is probably very unhealthy for the neck/spine.

</comment><comment><USER24> If your chair allows it, lean back.

 _A new study suggests that sitting upright for hours at a time -- for example, when working at a computer -- may lead to chronic back pain. Instead, the best position for your back is somewhat reclined, sitting at a 135-degree angle rather than the 90-degree angle most office chairs are designed for._

[https://www.webmd.com/back-pain/news/20061129/back-pain- ease...](https://www.webmd.com/back-pain/news/20061129/back-pain-eased-by- sitting-back)

</comment><comment><USER25> In the near future, I plan on purchasing one of the chairs [https://www.komfortchair.com/](https://www.komfortchair.com/) . But for now, I am using this [https://www.amazon.com/gp/product/B0167NBDYU/](https://www.amazon.com/gp/product/B0167NBDYU/)

</comment><comment><USER26> There's a lot of information here, lots of people saying to work out. If you don't workout and start, I would advise starting slow and using proper form, also getting the advice of a professional or at least something that really knows what they're doing is paramount.

I'll throw out something that helped me - strengthening my upper back. My upper back was weak and not doing it's job which was causing my lower back to suffer.

</comment><comment><USER27> You need to make sure your desk is properly set up (screen, keyboard, chair). There shouldn't be any reason to slouch if it is properly set up.

<comment><USER28> So much this. Also give standing desks a try. That helped me to fix my posture a ton (not only while working on the computer, but while standing/walking/etc overall) and also made half of my lower pain back go away.

<comment><USER27> How long do you manage to work standing up? do you switch positions throughout the day?

<comment><USER28> Yes, I switch every hour. Also, when I have a meeting where I don't have to present my screen, I always make sure to switch to my phone and walk around. That's another very important, but often overlooked exercise.

</comment></comment></comment></comment><comment><USER29> Working from home for the past month+, I started using an active learning stool. It's basically a height adjustable stool that wobbles around. It lows me to sit on it, or lean against it. This keeps me from slouching in a chair all day and has done wonders for my posture.

I'll probably request one from work once we return to the office.

</comment><comment><USER30> What worked for me is ditching the pillow to sleep when I'm on my back. I keep the pillow in the vicinity and use it if I switch to my side. People used to comment how bad my posture was, I don't get that anymore.

</comment><comment><USER31> Do core workouts. While doing the work-out, really concentrate on keeping your core stable and your breathing in sync with your motions. Learning how to brace your core unconsciously will help more with your posture than anything else.

All those ergonomic solutions force you to position yourself well, but they won't work unless you have the strength to hold it.

</comment><comment><USER32> I've got the opposite problem. I would like to sit in one place for 8 hours... or even 1 hour. But I can't sit still for more than 20 minutes. Anyone got any tips for that?

I've been prescribed adderall before (I basically asked for it), and it was good, but I've cut it out since I don't like what it did to my personality.

<comment><USER23> Consider it a blessing in disguise (look at all the articles about how sitting for long periods is awful), which prevents you from wrecking your posture/health. It's good to keep moving around! Some folks use Pomodoro timers to stretch/flex/move regularly :-)

Maybe what you want is a way to maintain focus — not necessarily hold still. Don't mean to be patronizing; I'm trying to change my habits to move around more.

</comment></comment><comment><USER33> Stand up. Sitting all day just isn't natural, no matter what. Learn to do your desk-work from a standing position, barefoot, no shoes, and with a lot of little movements and stretching from time to time. And the workout ideas already mentioned are also great - build up your core. This is the way.

<comment><USER34> I think sitting is more natural than standing. Hunter-gatheres sit around a lot but they don't sit on chairs. On the other hand they don't stand on one place for too long and usually are on the move.

[https://www.sciencealert.com/hunter-gatherers-are-as- sedenta...](https://www.sciencealert.com/hunter-gatherers-are-as-sedentary-as- us-but-how-they-sit-makes-all-the-difference)

</comment></comment><comment><USER35> 8 Steps to a Pain-Free Back: [https://www.amazon.com/dp/0979303605](https://www.amazon.com/dp/0979303605)

This book fixed my posture. After reading it, I understood for the first time what it actually means to have good posture.

</comment><comment><USER36> I am 52, male. Started wearing wooden clogs a couple of years ago, as I was experiencing similar symptoms as OP. Life-changing experience, this has been. My advice to OP: dispose of your sneakers and all of your comfy shoes. Wear nothing but wooden clogs instead.

<comment><USER37> I think you live in the flat above me.

</comment></comment><comment><USER38> Stand more, sit less. Stretch frequently, and do the basic calisthenics: pushups, unweighted squats, crunches, maybe even burpees.

Don't do a bunch of reps, just 5-10 or whatever is comfortable, every couple hours.

</comment><comment><USER39> Start regularly attending yoga classes. This has improved my posture significantly over the past year. I personally enjoy power yoga classes that are more strength focused but all yoga will help with posture.

</comment><comment><USER40> Weight lifting is the only reliable medicine. Everything else is a band-aid.

</comment><comment><USER41> Got myself a 75cm exercise ball last week to sit on. Improved my lower back in just 2 days and can see myself sitting up straighter. $10 ball so much better than a $1000 chair.

<comment><USER42> Be careful, you may want to invest in a more expensive burst-resistant exercise ball that will not pop like a balloon.

[https://fitter1.com/products/classic-exercise-ball- chair](https://fitter1.com/products/classic-exercise-ball-chair)

<comment><USER41> Yes, I did get a birthing / maternity / pregnancy ball. They go by these names rather than gym / exercise / swiss ball. Thicker material, non-slip and burst resistant.

<comment><USER42> Excellent, thanks for following up!

</comment></comment></comment></comment><comment><USER43> ^F stool... phrase not found.

My strong suggestion is raise your desk to 36 to 42 inches and buy a good quality lab stool with a foot rest. A stool forces your to sit upright and not slouch.

</comment><comment><USER44> i have 'lordosis', ive found some simple excercises to sort it out - <USER2> pulling "my ass down" which makes my back straight. make sure to get your posture diagnosed and possibly get excercises from physician, if you cant then there are some books and good videos on youtube (sic! i know), just choose someone u can verify as knowlegable person if you cant physically get to doc.

</comment><comment><USER45> You might try a standup desk. I have a varidesk.com. It is sturdy and lets you stand or sit.

</comment><comment><USER46> Raise your monitor high enough that you have to sit upright and hold your head up to look straight at it.

</comment><comment><USER47> Mounted or raised screen and a yoga/exercise ball. Also, do squat exercises.

</comment><comment><USER48> Long duration walks (1-2 hours) with an upright stance has helped me a lot.

</comment><comment><USER49> Press ups. Yoga. Moving about.

</comment><comment><USER50> Yoga.</comment>


Show HN: Video Game Soundtracks - <AUTHOR> http://vgsoundtrack.com <comment><USER2> Neat. A lot of these make excellent programming soundtracks since they're non- lyrical.

</comment><comment><AUTHOR> Thank you. Good point</comment>


Can you actually buy 3d printers on Amazon? Is it egal? - <AUTHOR> http://www.amazon.com/gp/product/B008M1CHX2/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B008M1CHX2&linkCode=as2&tag=giacomoballi-20

<comment><USER2> Why would anyone think buying a 3D printer is not legal?

<comment><AUTHOR> I was thinking with all the news converge there has been lately regarding the many possible illegal objects that can be "printed" (ie weapons of all kinds, unofficial replicas etc.)

</comment></comment><comment><AUTHOR> it says fulfilled by amazon so I would assume it's safe?</comment>


Type hints – a mediocre programmer's reaction (2015) - <AUTHOR> https://mail.python.org/pipermail/python-dev/2015-April/139267.html <comment><USER2> That's what you get from duck typing.

Python API are defined solely by how the API uses its argument. The requirement is already encoded as far as the computer is concerned, except the check are by default all done at run-time. A Python compiler could work its way backward to try to verify them at compilation time. Making them explicit would solely be as a helper for the programmer, which might as well just be in straight documentation, which can ba as brief as the name of the parameter.

It's all a feature, and this is being actively exploited in code, providing exceptional flexibility. Its no worse than other language with type inference: their types can be extremely complex and reading them would not help most of the time. You're better off with a succint, high-level description, like a URL-like string, a file-like object, an object indexable by such and such.

<comment><USER3> Well, the problem is on annotating types, when you only actually care about behavior.

Duck typing isn't a bad thing. In fact, it's great. You just need to annotate the ducks instead of the types. For a great example of how to do it, look at Haskell's type classes.

(In fact, Haskell's easyness of integrating generic code is visible even to a beginner, but I never notice that this is because the entire language is based on duck typing.)

<comment><USER4> To be pedantic, Haskell technically doesn't use duck typing, it uses structural typing. Duck typing is run-time coercion of types, structural typing is compile-time inference of minimum interfaces.

<comment><USER3> Noticed.

Interface based typing may be a better generic term.

</comment></comment></comment></comment><comment><USER5> This is totally crazy. With a slightly different syntax it's really not so bad:

{a:b} for mappings from a to b

(a,b) for tuples of a and b

[a] for iterables of a

a | b for unions of a and b

Then factor out that nasty common thing and you end up with:

        Optional[    {basestring: StringThing}
                  | [(basestring, StringThing)]
                ]

        StringThing = (basestring, Optional[basestring | file]])
                    | (basestring, Optional[basestring | file]], Optional[basestring])
                    | (basestring, Optional[basestring | file]], Optional[basestring], Optional[Headers])

        Headers =  {basestring: basestring}
                | [(basestring, basestring)]

It's not inherently complicated nor does it have anything to do with duck typing, it's just that the syntax chosen is awful.

</comment><comment><USER6> Couldn't they use helper methods to convert all those types he brought up to a single common type that they annotated with? It would simplify the API a lot. I come from a full day of working with associated types, generics, type erasures and protocol extensions, there is a darker side to it.

I wanted to have a generic protocol that could have some logic of its own without enforcing you to subclass it. I would regret the decision so much, if I wasn't busy regretting other decisions even more.

Just enforce a type that you accept that's large enough to be used by many and convertable from other common types you want to use.

I swear, soon they'll classify programmers urge to write as generic and extendable as a mental illness.

<comment><USER7> > Couldn't they use helper methods to convert all those types he brought up to > a single common type that they annotated with?

But then it wouldn't be "pythonic". To be frank though, I think being _too_ generous with your inputs is just asking for maintenance hell. I don't see why requests feels the need to allow data in so many different formats when one or two + conversion functions for anything else would be sufficient.

<comment><USER6> I've come to realize it's an addiction/urge, that's the only /reasonable/ answer I can give.

<comment><USER8> [https://en.m.wikipedia.org/wiki/Robustness_principle](https://en.m.wikipedia.org/wiki/Robustness_principle)

""" Be conservative in what you do, be liberal in what you accept from others (often reworded as "Be conservative in what you send, be liberal in what you accept"). """

<comment><USER9> Didn't we decide later that that's a bad idea? I mean, in the early days of the web, Internet Explorer was the very embodiment of this principle and a couple of decades later the internet is still full of the resulting non- standard crud.

<comment><USER10> Yes we did. It can also lead to really surprising security issues in protocol- land where such "liberalism" interacts badly with security-sensitive portions of protocols.

(Security is non-trivial and mostly there are very good reasons that things are _exactly_ as they are in such protocols.)

</comment></comment></comment></comment></comment></comment><comment><USER11> First reply is a very practical response:

> At this point, you may want to just stop caring about the exact type.

> Part of the point of gradual typing is that you can short-cut a lot of

> this. And quite frankly, this isn't really helping anything. Just skip

> it and say that it's Union[Mapping, Iterable, None].

<comment><USER12> And the reply to this reply shows the problem:

"This change doesn't catch any of the bugs anyone was going to hit (no-one is passing a callable to this parameter), and it doesn't catch any of the bugs someone might actually hit (getting the tuple elements in the wrong order, for example). At this point the type signature is worse than useless."

</comment></comment><comment><USER13> The public interface of a library isn't where type hints will shine, and I'm not sure why someone would think they would.

Type hints are going to be awesome for nailing down the behavior of the core parts of your business application. I think of it more like writing good tests than anything else.

Like everything else in development; 80% of the problem is choosing the right tool for the job.

<comment><USER14> This. Types, except for those built-in to the language, are not for APIs. But they can be great for internals if you don't overdo it.

For example, Perl6 has Subset (types), which is a great feature. You could make a subset type of Str (a built-in type) which contains only strings that match a given pattern (e.g. URLs, user-ids, or shell-safe strings) and still benefit from all generic string code.

<comment><USER15> I think there is such option in Python ABCs.

</comment></comment></comment><comment><USER16> Thank god I'm not the only one who feels that way about PEP 0484. No offense to Guido or the other authors, but I don't know what was going on in their minds.

<comment><USER17> Some PEPs are just wrong. This is one of them. It's kowtowing to dumb editors when the point of the language is to be as human-friendly as possible. If we wanted an IDE-friendly language we'd just use Java.

</comment></comment><comment><USER18> This isn't just the problem of 'duck-typing' vs 'strong typing.' There is always going to be data whose shape is very hard to define and annotate explicitly with intent of machine type checking or verification, yet much easier to describe to a programmer.

Take for example a spec for a "Set-Cookie" header syntax. It can be described as "[https://tools.ietf.org/html/rfc6265#section-4.1.1"](https://tools.ietf.org/html/rfc6265#section-4.1.1"), which would be a rather unwieldy thing to show, looking similarly to the pythonic polymorphic argument described in this message.

Type hinting (and strong typing) helps machines 100% of the time, and users some of the time. It's helpful if your API has an interface that is easy for a human to understand, even if you describe your data as 'a URI', "truthy" or even "Any", even if their shapes are not strictly defined.

<comment><USER19> > 'duck-typing' vs 'strong typing.'

For the n'th time, python is a strong typed AND duck typed language. Did you mean static?

</comment></comment><comment><USER20> Yes, it's going to be hard to retrofit Python libraries that use this style of parameter passing.

But if you're starting fresh, it's not that hard to use keyword parameters to support a lot of different options while also having reasonable types. (Take a look at how Dart libraries do it.)

</comment><comment><USER21> Why can't Python have transpilers like JS does? Adding types to Python like Typescript could be a good thing.

<comment><USER22> I feel like JS mainly has transpilers because people are locked in to the language, which is not true of python

<comment><USER21> People that choose Python are "locked in" to a language that doesn't have static typing.

<comment><USER23> You are missing the point. People that choose Python do just that, they _choose_ Python. The use of JS is very often not a matter of choice, because it's the only language supported in browsers.

<comment><USER24> Exactly, there is a difference between torture (JavaScript) and masochism (Python).

</comment></comment></comment></comment></comment><comment><USER25> Obviously old and feature-full libraries aren't going to benefit much from type-hinting. More than anything, I see it as a way to encourage new projects to re-think how they design their APIs - i.e. keeping it simple. That huge polymorphic argument example just seems like convenience was picked over API design by the Requests authors, and if you decide on that order of priority, type-hints aren't going to be useful to you.

<comment><USER26> > That huge polymorphic argument example just seems like convenience was > picked over API design by the Requests authors

Convenience _is_ API design. In a fully dynamically-typed language, there's no real downside for heavily polymorphic APIs and a lot of upside in terms of brevity and flexibility.

I believe pretty strongly that you can design great dynamically-typed APIs for dynamically-typed languages or great statically-typed APIs for statically- typed ones, but I don't think you can easily layer static types on a great dynamic API. The affordances are just too different.

One obvious challenge is that statically typed languages almost always support overloading. This makes it dramatically easier to have these kinds of polymorphic APIs while having sane types. Most dynamically typed language support overloading at all, which is where these giant union types come from when you try to cram a single static type onto what is effectively a number of different method overloads.

<comment><USER19> > In a fully dynamically-typed language, there's no real downside for heavily > polymorphic APIs and a lot of upside in terms of brevity and flexibility.

Wow, I'd say that's a major pain point for me—reasoning about polymorphic code with only vague guidelines:

"give me something that looks like a string".

"Well, which types are those?"

"Hell if I know! But it needs these methods, but it can also change its behavior if it doesn't have them"

"stabs self in neck because this was solved in the 60s"

Seeing a hard-to-skim polymorphic API for anything but a quick script is a massive problem for me—the time sink in just parsing its behavior isn't worth the inevitable problems that come with the edge cases at runtime.

That said, requests is great and I use it to do all my web scraping because it's super idiomatic. I had no idea the interface was that complicated, though, and it reduces my confidence in the library.

This PEP reminds me of typed racket: pretty awesome, but a completely separate language to write with separate considerations.

</comment></comment></comment><comment><USER27> Python isn't about types, it is about protocols. If you are thinking about the type of something while writing the code, then you are transcoding C++ or Java into Python. The important thing about a Python instance is not the type, but the protocols that the instance supplies.

Switching gears and thinking about code validation for a minute, I agree, protocol conformance checking is a much more difficult problem to resolve at compile time, at least they way Python duck types support protocol definitions.

<comment><USER28> Aren't protocols just a particular kind of abstract type? In Swift, "interfaces" or "traits" are literally called protocols.

<comment><USER29> If you go that route, anything can be abstract type.

I tend to see it like: type is what this object actually is, and protocol is how we interact with it.

<comment><USER28> I see where you are going. But I'm sure we can agree that both concrete types and protocols would be handled by a "type checker".

If ever there were a language where you'd want to be looking at protocols and not concrete types most of the time, it would be Python.

</comment></comment></comment></comment><comment><USER30> Type hints for Python would be useful if used like structural typing from Prismatic's Schema for Clojure [1], where you can pattern match against tuples/lists/maps/keys but also against arbitrary predicate functions (such that you could do `instanceof('foo')` or `hasattr('foo')`).

[1] [https://github.com/plumatic/schema](https://github.com/plumatic/schema)

</comment><comment><USER31> In for example JavaScript or other high level programming language: Instead of implementing type check/hints, your functions should validate the input data and throw an error if it doesn't meet the requirements. The compiler/VM should chose the optimal type. Types are for low level systems programming. In high level programming, think form design and validation instead of types. Example: Argument "yearBorn" should take a numeric value of two or four numbers. Not a "unsigned short int".</comment>