Javascript framework fatigue (article)
-
Our codebase luckily is pretty sane. We used to have this a lot:
struct foo { /* members */ char f_name[1]; }; struct foo * make_foo(..., char * name) { struct foo * foo = malloc(sizeof(struct foo) + strlen(name)); strcpy( foo->f_name, name ); /* initialize other members */ return foo; }
But apart from the UB I don't consider that particularly nasty.
-
But apart from the UB I don't consider it particularly nasty.
"Apart from wiping out all life as we know it, World War III was fairly uneventful."
-
A legal version, in later versions of the standard:
struct foo { /* members */ char f_name[]; }; struct foo * make_foo(..., char * name) { struct foo * foo = malloc(sizeof(struct foo) + strlen(name) + 1); strcpy( foo->f_name, name ); /* initialize other members */ return foo; }
Of course, you don't want to ever modify the f_name member afterwards, since you're probably not storing how much memory you allocated for it.
-
No matter what they do with it; PHP is superceded and dying off.
HAHAHAHA
Most websites use PHP you do know that?
-
Most websites use PHP you do know that?
List prominent (i.e. not banged together on Wordpress, Joomla, etc.) recently launched or re-imaged websites written in PHP. Now list the various big brands that have quietly been discarding PHP and replacing it with alternatives like NodeJS.
There's still a lot of it around, but PHP is definitely dying off.
-
Of course, you don't want to ever modify the f_name member afterwards, since you're probably not storing how much memory you allocated for it.
You've got other fields in that struct; keeping the space used and allocated is trivial…
-
But apart from the UB I don't consider that particularly nasty.
Which UB? Having a variable length final member is specifically called out as legal in the standard.
-
As I understand it, the modified version (with empty braces for the last member) is a legal variable-length last member. In the first version, where the final member is declared with length 1, accessing any later member is array-index-out-of-bounds and hence UB.
-
There's no later member.
Look, it's a technique that was very widely used, so any compiler author that broke it would get lynched by all the people whose code he broke, no matter how much he claimed that it was UB. That was why it was admitted to the standard as an OK technique; it was just making what is actually required mandatory.
-
While a "lot" of places are going to NodeJS, how many turn back after?
-
While a "lot" of places are going to NodeJS, how many turn back after?
I wonder how many of those places are going from Ruby-on-Rails, not PHP?
-
While a "lot" of places are going to NodeJS, how many turn back after?
Php is a lovely place, such a lovely place.I wonder how many of those places are going from Ruby-on-Rails, not PHP?
Ooh, or
cluscoldfusion.
-
They say if you sit at a river bank long enough, you'll see the corpse of that cool new Javascript framework/library you wanted to learn float by.
-
Too late, you already missed it while fetching the grandalissimissimo (or whatever is "large" this week) frappe latte with skimmed soya milk with added lactose, coffee, milk, chocolate and flavour, and already this week's framework is being adopted.
-
this week's framework is being adopted
Too slow! Gotta go with the framework of tomorrow today and take an industry mindshare lead in advance adoption!
-
while fetching the grandalissimissimo (or whatever is "large" this week) frappe latte with skimmed soya milk with added lactose, coffee, milk, chocolate and flavour
DAFUQ DID I JUST READ
SOY MILK WITH ADDED LACTOSE
MAKE ME UNSEE ITexcuse me while I go puke
-
Not sure if ?
-
DAFUQ DID I JUST READ
SOY MILK WITH ADDED LACTOSE
MAKE ME UNSEE ITAlmost a haiku, but not quite.