3 ms·
I can't believe you hardcoded this for MySQL instead of using PHP's excellent and versatile PDOs, and I can't believe the 10k line count. Gosh. Is "de-engineeri
by markhuus 14y ago
I can't believe you hardcoded this for MySQL instead of using PHP's excellent and versatile PDOs, and I can't believe the 10k line count. Gosh. Is "de-engineering" a suitable term here? Thumbs up for open sourcing your work, though.
- markhuus 14y agoNo I'm serious here, renownedmedia. Don't disregard my rant with a silly downvote, but do instead indulge yourself in the PDO methods instead of painting yourself and your projects into corners: http://php.net/manual/en/book.pdo.php http://php.net/manual/en/book.pdo.php
- renownedmedia 14y agoIt wasn't me who downvoted you, I promise! I love PDO; please read my other comment.
- citricsquid 14y agoYou can't downvote comments that are a reply to your own item, the person that downvoted you is not the OP -- unless he used an alternative account. I would suspect someone else did, the tone of your comment isn't one that really fits with the HN environment even if your point is valid.
- aaronpk 14y agoHaving just converted an app to use Postgres from MySQL, I can tell you that the PDO drivers only get you so far. You're still ultimately going to be writing SQL, and then you have to get into the differences between MySQL's `key`="val" and Postgres' "key"='val' quoting differences.
- savories 14y agoYou probably got down voted because you seem like a dick, rather than a helpful, nice, encouraging person.
- rpeden 14y agoWhat makes you think he was the one who downvoted you? You could easily have asked him about his technical decisions without being a jerk. Besides, this was a personal project, probably created without the intention of eventually open sourcing it. If he only ever intended to use MySQL, and portability across RDBMS systems wasn't a goal, then it's fine as it is.
- renownedmedia 14y agoYou hit the nail on the head. I never knew I would open source this, I didn't even plan on it getting as feature-rich as it had become.
- jakejake 14y agoYour very first comment on HN got a down-vote, I haven't actually seen a -5 karma before. On the bright side you've nowhere to go but up. Seriously though I agree with your point about PDO. Perhaps the down-vote was due to the comment about de-engineering and apparently making fun of 10k LOC? I took a look at the app and it's got a huge amount of features. 10k is not really that much code for a "enterprise" app I suppose you could call it. The OP probably is just trying to express the amount of labor that went into the app. Unfortunately other developers may judge your LOC as either a positive or negative, so it's probably best to avoid mentioning it (unless you've written an app in an unbelievably low number of lines).
- renownedmedia 14y agoIt was the first metric that came to mind, it was hard to describe in time since development was on and off for a while. I just wanted people to know it wasn't a small project.
- jakejake 14y agoIt actually looks like a nice product. I can tell from your video that you feel about the same way I do of many of my projects. Even after a few months it's hard for me to look at my work and not see the flaws and missing features. But it's good to keep in mind that people who aren't building the app don't usually see those things.
- renownedmedia 14y agoI built it using CodeIgniter, and wasn't as proficient in PHP as I am now. CI is a beginner framework and doesn't teach a lot of good practices (e.g. it loads external classes as singletons and uses a class loading script developed during the PHP4 days). Here is the suggested CI method for executing database queries: http://codeigniter.com/user_guide/database/examples.html http://codeigniter.com/user_guide/database/examples.html Nowadays, I prefer (PHP) frameworks with real autoloaders and better OOP usage (like Zend or Kohana).
- sandollars 14y agoThis is the sort of comment that keeps a lot of people from publishing their source code. Make a pull request, sir.
- jwdunne 14y agoPlease can you point me to documentation that shows that you can easily switch vendor when using PDO? The PHP docs clearly state database abstraction isn't purpose of PDO. The purpose of PDO is to abstract access to a database. http://www.php.net/manual/en/intro.pdo.php http://www.php.net/manual/en/intro.pdo.php In this sense, wouldn't it have been better to either recommend that he should have used a DBA library? Or even recommend that he used PDO in place of CodeIgniter's own DB access library? The OP's experience aside, I think you're also missing that this was written on top of CodeIgniter. From my own experience and learning, CodeIgniter isn't really the best tool for writing larger applications. It's architecture isn't so great and is largely a remanent of the past. To end a rant about CodeIgniter short, it seems more natural to write namespaced procedures using classes rather than taking full advantage of objects and OO (again, probably due to it being largely a PHP4 framework).
- ericingram 14y ago"markhaus" has -15 karma. I think his goal is to accumulate negative karma. That or he is just a real jerk. Plus, I really disagree with his comment.
- tonywebster 14y agoReally disappointing to see someone's work get trashed. Rock on for open sourcing it.