Alternatives to Dreamweaver
-
How does php encourage that behavior more so than any other language?
It had major problems in the past, and still has problems with promulgation of old practices (which ought to be retired). In other words, it's not that it can't be used well, it's that that's an all-too-rare occurrence. And yes, there were awful recommended practices in the past, mostly relating to the fact that not so many greybeards used PHP in its formative days.
-
How does php encourage that behavior more so than any other language?
By making it super-easy to add stuff like
<?=base64_encode(file_get_contents('http://what.thedailywtf.com//uploads/default/8214/16c00f5bd6b57125.png')); ?>
to your templates. Good template languages make it hard to do BS like that.
It had major problems in the past, and still has problems with promulgation of old practices (which ought to be retired).
We weren't talking about PHP as a language, but about PHP as a template language. ;-)
-
By making it super-easy to add stuff like
<?=base64_encode(file_get_contents('http://what.thedailywtf.com//uploads/default/8214/16c00f5bd6b57125.png')); ?>
to your templates. Good template languages make it hard to do BS like that.
If a developer is doing stupid things, then educate the person better. If that doesn't work, or they are intentionally doing bad things, find a new employee?
I get why you might want to "sandbox" cheap hires / interns with limited skills, but if you have good developers who know what they should be doing, then all the templating language does is slow things down (all the code is reviewed, right :) )
-
I get why you might want to "sandbox" cheap hires / interns with limited skills, but if you have good developers who know what they should be doing, then all the templating language does is slow things down
Why would it slow things down? The template will be transformed into PHP code, which will then be cached.
Also:
- Template engines make it harder to accidentally introduce bugs (because the template won't even compile if you reference non-existing variables, for instance).
- IMHO, Twig templates are a lot easier to read than PHP templates.
-
Agree with the caching argument, disagree with the last 2. Will respond tomorrow - a beer has appeared in front of me
-
I just poured another dram of whisky. Cheers!
-
dram of whisky
How damned old are you? Who still uses that word? And why would anyone drinks such a small amount of anything?
-
@Intercourse said:
How damned old are you?
Probably younger than you.
@Intercourse said:
Who still uses that word?
Nobody. Except me. Do I get a special snowflake badge now?
@Intercourse said:
And why would anyone drinks such a small amount of anything?
Cause the whisky I'm currently drinking costs more than $40 a bottle and I want to enjoy it.
-
Do I get a special snowflake badge now?
Only if you also pour a dram of scotch on your haggis before you eat it.
-
@Intercourse said:
Only if you also pour a dram of scotch on your haggis before you eat it.
Nah, flying to Scotland just to buy some haggis ain't worth it.
-
You could always make your own. You might have to go to an ethnic grocery store to get the stomach and other entrails though.
Still not worth it.
-
@Intercourse said:
You could always make your own. You might have to go to an ethnic grocery store to get the stomach and other entrails though.
I just considered doing just that, but then Discourse reminded me that I'm already too drunk to make my own decisions by telling me to STFU because I'm posting too much. Now I finally understand what that warning message is for.
-
No wonder I got it Saturday night then. That night I killed a half gallon of Jack Daniel's, just to watch it die.
-
I'm suspicious of anybody who doesn't realize PHP IS A TEMPLATING LANGUAGE, IDIOT!
Dang. Anyone know how to wipe the spittle off the inside of my monitor?
-
Dang. Anyone know how to wipe the spittle off the inside of my monitor?
Someone appears to be rankled.
-
@Intercourse said:
>asdf:
dram of whiskyHow damned old are you? Who still uses that word?
Oh god, shut up before the metric bigots wake up.
-
@Intercourse said:
Someone appears to be rankled.
Me or him? Not me, I'm feeling fairly calm at the moment, just engaged in some pangolin-baiting.
-
Him.
-
@Intercourse said:
Him.
Notice he stopped talking about how he wasn't rankled once it became obvious he was?
-
Notice how he never admits when he is proven wrong? I feel like he
believes that if he does not acknowledge something, it never happened.
-
@Intercourse said:
Notice how he never admits when he is proven wrong? I feel like he
believes that if he does not acknowledge something, it never happened.That is, indeed, a hallmark of an SJW. Also of hard Leftists, but I repeat myself.
Since some asshole's going to come along and say it if I don't, those aren't the only groups.
Edit: Oh, yeah, you meant someone else. Him too, but I bet he's pretty lefty as well.
-
So without Twig, smarty, etc you wouldn't be passing only the variables needed to the view? Using simple php code in the view layer is "backend programming"? Twig etc doesn't allow a 'front end' guy to make a bunch of xss vulnerabilities?
I just dont see the point in giving front-end people a "training wheels" language that adds overhead and forces learning yet another syntax.
It's not "just another syntax". It's the only thing they WANT to learn. Some of the ones I know are generally allergic to backend duties and (it seems) programming in general.
But even without that, something like twig or handlebars is just nicer than mixing up php code islands within the markup. Admittedly, some of it is a stylistic choice, but it also helps you keep things clean. Prevents you from "hacking something just this once", leading to untestable and unmaintainable cruft.
That said, I'm not a hardcore PHP dev. All of the PHP I wrote was template-less. I just like what I've seen lately in a symfony2 + twig project. And most of my other stuff relied on templates (razors, handlebars, ejs...), so they seem a natural fit for me.
-
Correction, php /was/ a templating language.
Its Turing complete and object oriented. Its just as much a programming language as C, if not as efficient or consistently documented.
-
Laravels better, and the blade templating / caching is actually very nicely implemented.
-
-
What is QFI?
-
hat is QFI?
according to the ABBR tag @dkf used it's
Quoted For Irony
, a play o the more commonQuote(d) For Truth
-
Correction, php /was/ a templating language.
Its Turing complete and object oriented. Its just as much a programming language as C, if not as efficient or consistently documented.
So they took the templating stuff out or what?
-
Yes, actually. A lot of it.
<?= "Hello world" ?> is invalid now, and inline code is considered poor practice. Is been moving towards MVC for about a decade, wordpress is pretty much single handedly holding it back.So much shit online that they can't break backwards compatibility with. Came across 5.3 because magic quotes yesterday.
-
Ah, abbr didnt work on phone. Also, typos because on phone.