Hacker Newsnew | past | comments | ask | show | jobs | submit | 1880's commentslogin

A PHP framework has to initialize all its systems from zero for each request. It may because of that, it may not, it's just a guess.


You would think the frameworks would be designed around that, loading the absolute minimum of code to handle the request.


That still doesn't prevent you from needing to do that on each request.

Also, with most frameworks, they're usually quite complex; how else are you going to be everything for everyone? Complexity comes at a cost, most notably in framework land this takes the form of code with very tall inheritance structures and/or tons of dependencies.

You need Foo? Ok, Foo inherits from BaseFoo, which inherits from CoreBaseFoo, which inherits from the Widget class, which itself is a BaseWidget, etc. Let's implement a few interfaces too, and now load in various dependencies... pretty soon that simple, 5-line class that you implemented now requires 100+ classes.

Things like op-code caching can greatly reduce this per-request penalty, but it doesn't change the fact that it still happens.


Except that nothing says that you need deep class hierarchies. In fact, i think heavy use of classes and class hierarchies is an anti-pattern in PHP because of its procedural per-request model.

Typically php frameworks follow a java-style model of unserializing data into objects, loading the corresponding class files on-demand, calling API's on the objects, and then reserializing. It is _much_ faster if you treat the data as a stream, cutting it up and transforming it as it passes through your code, without ever building up an object representation, and not doing any more deserialization than a simple json_decode (which is really fast). This is in fact the original PHP model, transforming a stream of annotated HTML.


Lazy Loading is a thing with modern PHP frameworks.


I'll give an example: zend_validate uses a proper OO hierarchy, so that for each type of validation (maxlength, digits, ...) there's a distinct validator class, which has to be instantiated prior to being applied to a piece of data. The whole thing is really clean and organized ... and abysmally slow, because on each request you're loading dozens of validator classes. That would have been much faster had it been a simple ugly procedural API with all its code in one file. The per-request overhead of input validation is more important than a 'pure' oo design in my opinion.


It is for my Gmail and Google Apps accounts, free and paid. Also check https://twitter.com/search/realtime?q=gmail%20down

The status dashboard doesn't show anything yet: http://www.google.com/appsstatus

Edit: 20 minutes later, it's working again.


If you want to be a "trabajador autónomo" (autonomous worker), you have to pay a mandatory monthly fee of about 250€ (it varies a bit on your activity, if you want extra coverage, etc). There are some discounts, if you are under 30 (35 if you're a woman) and it's your first time being an "autónomo", you pay only 20% of the tax on the first 6 months and 50% on the next 18.

The 20% thing was approved about a month ago, and it's been a bureaucratic mess. I applied to it on the first day of being on the law, and as of today I'm still waiting for approval. Apparently their systems are not prepared for this discount and they have to be applied manually. Of course you don't have to wait, you can pay full rate and then claim the difference, but that could take months.

If you create a SL, you must designate a legal administrator, and the cheapest way is being an "autónomo".

Edit: about creating a Ltd in the UK, if your revenues are more than 50% from Spain, you will be fined by the Spanish IRS for capital flight. It's not easy.


So that money goes into health insurance and social security?

If you work as an "autónomo" and your business fails, do you qualify for social-security /unemployment benefits? In this case it would not be the worst deal, espacially counting in the discounts. The scandal here is, that the system needs ages to approve the paperwork.

Also as I understand EU laws, incorporating somewhere else would not solve the problem, since you are subject to the local taxes at the place where you actually do the work.


Yes, with that money you pay social security and health care, which is fully covered with the minimum, mandatory "autónomo" fee. That's nice I guess.

Unemployment is optional (about +20€/month IIRC), to get it you have to prove a specific lost of revenue in a specific length of time, first year doesn't count, and you get 2 months of pay per 12 months worked ("normal" jobs get 4/12). I recently read that only about 25% of the unemployment petitions are approved. I chose not to pay it.

Since the moment you stop being an "autónomo" you get 90 days of "free" health insurance. After that, if you are <=26, you can use the health insurance of a parent or sibling. If you are 27, you have to pay for health care, or prove that you don't have any income to get free healthcare.


So basically the only benefit you get for the fee is health care? Then its pretty expensive. Does it increase with income or is it a flat fee?

Can you work around the whole thing, if you make e.g. your wife (or father, or whoever) the owner of the company and hire yourself as CEO? So you would pay health care + other stuff as a percentage of your wage (which would be very low monthly + share of yearly profit).

I am asking extensively because I plan to spent a year in Spain in the near future. And while all this information is irrelevant to the stay (I am a student and will hopefully have set aside enough to spend the year without having to work on the side). But I really like to understand as much as possible on how the country works. :)


Yes, it's a flat fee, it only increases if you want extra coverages (full pay on day 1 of sick leave, unenmployment, etc).

The mandatory minimum doesn't increase which income†, but since you are also paying towards your retirement, you can choose to pay more, if for example you are in your final working years, so that you get a better retirement. But I'm not thinking about that right now :)

I am not the right person to ask about these things, and I may be wrong, but I think the workaround you are suggesting would cost, in the best case, the same as being autónomo on your own. You'd be paying about 250 € in taxes for a worker with the minimum wage (758 € in 12 wages).

†: of course you will have to pay income tax later (annually if >=70% of your income is B2B, quarterly if not, so many random rules!).


Sounds like there are a ton of pitfalls running a company in Spain. Good luck in the tight economy!


> So anyone with some basic Android knowledge will be able to extract my applications key and secret?

Yes:

http://news.ycombinator.com/item?id=4410398

http://stackoverflow.com/questions/4419915/how-to-keep-the-o...


The problem is it has 40k active installs but around 60k tokens taken up by pirating the app.

http://androidspin.com/2013/02/23/falcon-pro-for-twitter-rea...


There they refer to "active installs". Its still possible they sold 100K apps, everybody tried it (used a token), and 60K people deleted the app again. Those people then didn't reject their token in Twitter's app setting (which almost nobody does).

If it were indeed 60K pirates, that would really suck.


Don't forget that logging in with multiple accounts on the same install also uses a token per account.


The Play Store says the app has 10,000 - 50,000 installs.


times are tough when people have to pirate a $1 app.


It's a Webkit thing.


Cheapest I've seen is $98 for 10 years (Dynadot), which is still not bad.


The book "Masters of Doom" tells more about it. And of course the story of id software, Doom, Quake, Carmack and Romero.


I've read masters of doom. Why does the Sweeny/CliffB partnership work, while Carmack and Romero failed?


My guess is ego impacted by fame, Sweeny/CliffB managed to not be quite as personally famous as Carmack and Romero. While I play video games, and recognized Sweeny/CliffB it took a search to place them as the fathers of Epic. I recognized Carmack/Romero without the need of Google.


Maybe because of this? http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone

I didn't actually check the project source, so I could be wrong.


Bootloader and SIM lock are usually not related.


You are right, sorry for the false information.


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

Search: