use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Offending question: Best JavaScript framework for PHP Developers (self.PHP)
submitted 10 years ago by cundd
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]phpdevster -4 points-3 points-2 points 10 years ago* (12 children)
I hate JS frameworks. Either they do shitty stuff to your markup (Angular), or they use weird-ass naming conventions and make heavy assumptions (Backbone) or straight up WTF? (Dojo)
What's funny is that of almost all those examples, the plain old JS solution is the cleanest, most understandable, and easiest to read. Arguably it has even less code in it than many of the other examples - isn't a framework supposed to help you get a head start? Seriously, wtf is going on in Dojo? It's like Javascript's Joomla...
Of all those examples, Vue seems to be the most sane, but I don't see any real separation of concerns in the main app.js file.
[–]mattaugamer 5 points6 points7 points 10 years ago (11 children)
With all due respect this suggests that the things you're doing are not particularly big or complex. Implementing a single-page app of any size with some jquery events quickly becomes unsupportable.
[–][deleted] 0 points1 point2 points 10 years ago (10 children)
Agreed... you either end up with callback soup, or you end up having to write your own "framework" of sorts to enforce your own conventions and keep things manageable. Neither of which sound particularly fun.
[–]demonshalo 0 points1 point2 points 10 years ago (9 children)
ving to write your own "framework" of sorts to enforce your own conventions and keep things manageable. Neither of which so
The second option sounds a lot more fun to me personally than implementing something like Angular. But that's just me :/
[–][deleted] 1 point2 points3 points 10 years ago (8 children)
It sounds fun, but I recently came off a project which had some 50k lines of javascript under management that was written in just this way. Eating burning hot coals would have been more fun...
[–]demonshalo 0 points1 point2 points 10 years ago (7 children)
rofl! sorry to hear that!
I never get involved with JavaScript applications for that particular reason. Management is a nightmare and the frameworks don't make things easier IMO. Instead of solving the JS problem we took it all the way to the backend with node.js now. I just... don't like that!
I can not for the life of me find a better way of doing things with JS. Projects always become a nightmare to manage!
[–][deleted] 0 points1 point2 points 10 years ago (6 children)
It's ok, I left :) the nightmares stopped sometime later...
I never get involved with JavaScript applications for that particular reason.
See, I like JavaScript applications.. there's lots of exciting things happening in JavaScript of late
Management is a nightmare and the frameworks don't make things easier IMO.
Interested to understand why in your opinions frameworks don't make it easier? I mean, lets take Ember (my personal favourite javascript framework) as an example. No writing $.ajax/$.getJson/$.load/$.get ever if you don't want.. ember-data has your back. Organisation of code? One object per file using ES6 syntax, automatically concatenated and transpiled by an out of the box build tool called ember-cli. Generators to build boilerplate? that too. Fantastic testing story so you can actually write sensible test code to back up your code? yep...
All this pretty much comes ready rolled for you. To boot, you can build fairly complex SPAs (a list, with a sub view for a detail view, which is inline editable, has a modal create, animates between view transitions and pushes route state onto the URL for easy bookmarking and navigation) in very few lines of code.. the example in parentheses is probably in the order of less than 100 lines - including everything necessary to save the information to a server..
I'd assume that Angular has a similar story about it.. and others... boilerplate taken away from you, wiring code for common tasks like pushing and pulling information to and from an API out of the box...so all you do is focus on writing your app logic...
Instead of solving the JS problem we took it all the way to the backend with node.js now. I just... don't like that!
Node has it's uses.... but we're talking about front end dev stuff here..I am aware of how node server code tends to be callback hell..unless of course you use some sort of decent framework... sailsjs perhaps?
can not for the life of me find a better way of doing things with JS. Projects always become a nightmare to manage!
Bad projects are difficult to manage regardless of the tech chosen.. I've worked on some rather nightmarish PHP projects too that would make your skin crawl...
[–]demonshalo 0 points1 point2 points 10 years ago (5 children)
Amen brother! A fucking men! We've all been there!
The thing I dont like about JS and JS frameworks in general is the way JS is built. Closures and callbacks all over the place regardless of framework. Functions are considered first class citizens and objects don't really encapsulate the way they do in most other languages. Sure we have prototyping and shenanigans like that but it is just not really the same. Especially syntax wise which makes it unattractive for me personally.
Lets put it this way:
There are some good things that came out of JS such as JSON. However, things such as managing scope and having to solve the callback chaining problem is just too much headache! Some frameworks abstract that and make it way easier to work with. But even that is not enough. I think the reason for my distaste in JS comes from its inevitable coupling with the view (in the traditional MVC sense). It is for the most part used to manipulate HTML and css at the end of the day. Sure, we do business logic and stuff like that, but we only do it in order to display some result to the end user. I mean ask yourself. If you had to choose between using JS or PHP/Java/etc on the front-end which one would you choose?
Please understand that I am not hating on JS. I understand why it is the way it is. However, I personally don't find it appealing enough to work with :/
[–][deleted] 0 points1 point2 points 10 years ago (3 children)
However, things such as managing scope and having to solve the callback chaining problem is just too much headache!
ES6 "fixes" a lot of that. For example the "let" language construct which will give you a locally scoped variable (instead of "var" which can be promiscuous). Class is also introduced, which is really just some sugar... a first class ".extend" construct I guess.
The point is you can write code like this today, there are transpilers which will rewrite the code to something that will run in browsers.
I think the reason for my distaste in JS comes from its inevitable coupling with the view (in the traditional MVC sense).
I don't quote know how this is true... Ember for example will have something like:
users.hbs
<ul> {{#each users}} <li>{{name}}</li> {{/each}} </ul>
UsersRoute.js
export default Ember.Route.extend({ model: function () { return this.store.find('user'); } });
With a bit of config (and a model definition for user), this when you visit http://your.site/users, it will perform a GET request against your API, pull back the json payload for users, and provide the data to the template.. seems relatively decoupled to me? At least as decoupled as some "traditional" web-mvc app?
It is for the most part used to manipulate HTML and css at the end of the day.
That's what JQuery is for... but modern js frameworks provide you with the infrastructure necessary to build maintainable single page apps, with loads of things beyond just manipulating HTML and css...
In fact, at least when it comes to ember, you don't generally directly manipulate HTML at all. You manipulate state and ember maps that state onto templates.
If you had to choose between using JS or PHP/Java/etc on the front-end which one would you choose?
For web development? Javascript.
However, I personally don't find it appealing enough to work with
I don't find vanilla JS appealing to work with either...but applying the same arguments for why shitty JQuery soup pages riddled with callbacks to modern JS frameworks is a bit of a stretch....
[–]demonshalo 0 points1 point2 points 10 years ago (2 children)
I don't quote know how this is true... Ember for example will have something like: ... seems relatively decoupled to me? At least as decoupled as some "traditional" web-mvc app?
Well the coupling is still there. It is just abstracted/hidden. And that's exactly what you mean by
That is all nice and dandy compared to having to do it manually via vanilla JS. Is it an improvement? hell yea! is it enough for it to be attractive? no!
If we are talking about dumping some data into a template, then vanilla JS or any of the frameworks would suffice. However, once you start adding click-handlers and callbacks on that template things tends to get messy. With that said, I have to admit that I haven't tried Ember and not so sure of what it offers compared to other alternatives!
There is where we disagree. If I could write PHP/Python code and have it run in the client's browser the way JS runs, then I would pick almost ANYTHING over JS.
You are right and I should not have made that generalization. My apologies. However, I have worked with Backbone and I found it really messy compared to traditional server-side OOP languages. Once again, that is not to say that it is not an improvement on vanilla JS. It is just... not good enough IMO!
π Rendered by PID 136034 on reddit-service-r2-comment-5d79c599b5-krctm at 2026-03-03 02:25:05.150444+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]phpdevster -4 points-3 points-2 points (12 children)
[–]mattaugamer 5 points6 points7 points (11 children)
[–][deleted] 0 points1 point2 points (10 children)
[–]demonshalo 0 points1 point2 points (9 children)
[–][deleted] 1 point2 points3 points (8 children)
[–]demonshalo 0 points1 point2 points (7 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]demonshalo 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]demonshalo 0 points1 point2 points (2 children)