6 ms·
I could've done that but that wouldn't have taught the same things. PDO is awesome but requires deeper level of understanding (for a beginner), which may increa
by trm42 11y ago
I could've done that but that wouldn't have taught the same things. PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co.
It's easier point to framework that's already using PDO and and making sane defaults and solving bootstrapping problems. Once you've learned bunch of new concepts like ORM in one framework, it's easy to understand other ORs and be able to compare it to DMs.
My own experience with Laravel has been really positive. Actually I was thinking about creating something similar until I learned about Laravel, so it solved lots of existing annoyances regarding PHP coding for me.
Everybody needs to start somewhere and I believe that by nudging towards Laravel, my young friend'll learn more in the long run and in the meantime can concentrate on making services instead of writing home grown PDO helpers and custom routing libraries. They are problems that have been solved already multiple times.
Also, Symfony and Laravel communities are encouraging and teaching about the better ways of doing things so that'll help him in the long run.
In many small project it's more fun and more easier to use $favorite_framework instead of searching for reinvented wheel. There are cases when it's better to do more custom solutions but for many cases frameworks are just awesome
- reitanqild 11y agoAgree, then again there are different types of people. Some wants to learn from bottom up(analytic approach), others want to see cool stuff then tweak, modify, replace to find the limits (holistic approach). IIRC there is a tendency that young people prefer the holistic approach while teachers either are selected for or grow into preferring the analytical approach.
- trm42 11y agoReally good point! Most of us veterans assume that because we have learned things the hard way and from bottom up, everybody else should learn like that. "Make them suffer like us and they will learn the holy truth" ;D
- ludamad 11y agoWhenever I know something well I feel like I'm excited to teach people 'just the good techniques'. I do notice that the things I describe don't sound as cool because they haven't struggled with the less cool stuff, though
- cpplinuxdude 11y agoDoesn't holistic approach just make sense? It's not like you learned to speak with your parents reading you the dictionary beginning with the letter A.
- datasage 11y agoIts a good way to start and actually make things happen. But it's also important to get beyond that to become a strong developer. Some do, some don't. jQuery is a common way to learn to do front end programming. It saves a lot of time when used well. But it is important to extend the knowledge to core javascript and be able to write code when jQuery is not available (like when writing scripts to embed on different sites).
- steveklabnik 11y agoThe approaches aren't exclusive either, you can start "holistic" and then learn more by going "analytic" afterwards, once you have the gist of things.
- reitanqild 11y agoAgreed, this is my preferred way of learning.
- sarciszewski 11y ago> PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co. Yeah, that's basically why I wrote EasyDB. https://github.com/paragonie/easydb https://github.com/paragonie/easydb $rows = $db->run('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC', $_GET['blogpostid']); foreach ($rows as $row) { // etc } Teach people to do things this way rather than concatenate strings, say goodbye to SQL injection vulnerabilities.
- deleted 11y ago[deleted]
- bpicolo 11y agoYep. PDO still leaves room for string concatenation issues. Unfortunately, so does Doctrine.
- Iridiumkoivu 11y agoWhat do you think of Propel?
- sarciszewski 11y agoPeople who want to do string concatenation will continue to do so no matter what we tell them. At some point, we have to educate users. Giving them an easy-to-use alternative is a step in the right direction.
- mikeash 11y agoWhy not have the obvious API call for making a query only accept constant strings? You can still have an escape hatch for the rare cases where an expert needs to do something fancy, but hide it well and make it scary and you shouldn't have many problems.
- sarciszewski 11y ago
- mzarate06 11y ago> Laravel ... solved lots of existing annoyances regarding PHP coding for me. Can you name a few such annoyances and how Laravel addressed them? And do you mean to say that Laravel addresses them, while other frameworks don't?