9 ms·
They're all over the place. People just starting out. It could've been an intern fresh out of college. It could've been someone who just never graduated beyond
by bphogan 14y ago
They're all over the place. People just starting out. It could've been an intern fresh out of college. It could've been someone who just never graduated beyond copy-and-paste-from-StackOverflow. It could've been written by a person who never did web development before and was just told to make it work.
The little HN/Twitter/Reddit "awesome programmer" bubble is just that... a bubble. It's easy for us to forget that lots of people write lots of bad, untested code all day long. As much as it frustrates me, lots of people code who don't care about code - it's just their job.
- STRML 14y agoI agree, they're everywhere - but it doesn't explain this well-written RFC[1] to accompany the code. [1] http://tools.ietf.org/html/rfc6108 http://tools.ietf.org/html/rfc6108
- ancarda 14y agoProbably written by a different person.
- fnordfnordfnord 14y agoFrom the RFC: > R3.1.1. Must Only Be Used for Critical Service Notifications Additional Background: The system must only provide critical notifications, rather than trivial notifications. An example of a critical, non-trivial notification, which is also the primary motivation of this system, is to advise the user that their computer is infected with malware, that their security is at severe risk and/or has already been compromised, and that it is recommended that they take immediate, corrective action NOW. So much for that.
- Phlarp 14y ago>They're all over the place. People just starting out. It could've been an intern fresh out of college. It could've been someone who just never graduated beyond copy-and-paste-from-StackOverflow. It could've been written by a person who never did web development before and was just told to make it work. I'm an intern, just moving past S.O. copy-pasta jobs and generally get scared at what the hacker news crowd might say about my code... seeing this caliber of shit get pushed live by a major ISP is almost comical, if an admitted novice such as myself can see that it should be a sign as to the ineptitude of our current crop of ISPs.
- bphogan 14y agoKeep it up - keep moving up and learning more stuff. Be awesome. Don't worry too much about what other people think of your code, worry just enough that it pushes you to write better code. :)
- ancarda 14y agoThe code on your GitHub, for the most part, seems fine. One thing I can say is don't use exec[1] if you can avoid it: $string = 'rm /var/www/Giftest/*.gif'; exec($string); While there's nothing * technically* wrong, it's platform specific and I think it would be better to use PHP's unlink[2] function. Also, sorry if this is wrong, I haven't looked at the regex but it seems your parsing YouTube URLs? Have you looked at oEmbed[3] - it may be an easier way to accomplish what your doing? You can use it with json_decode[4] to get an object. [1] https://github.com/Machtap/GiffyTube/blob/master/download.php https://github.com/Machtap/GiffyTube/blob/master/download.ph... [2] http://php.net/manual/en/function.unlink.php http://php.net/manual/en/function.unlink.php [3] http://apiblog.youtube.com/2009/10/oembed-support.html http://apiblog.youtube.com/2009/10/oembed-support.html [4] http://php.net/manual/en/function.json-decode.php http://php.net/manual/en/function.json-decode.php
- smacktoward 14y agoThe type of programmer who writes code like this never wonders whether their code could be better or not. So don't worry, just by being self-aware enough to ask the question you put yourself on a higher level.
- executive 14y ago
- calinet6 14y ago"People just starting out." Ha, you give them too much credit. This code is from a 10-year veteran "consultant," probably charging over $200/hour, brought on by the Global Services company hired by the Consulting Agency that Comcast brought in to assist in completing the critical time-sensitive project as quickly as possible. It was also deemed a great success, and presentations were made about how effective it was, how smart the manager who hired the consulting agency is, and how skilled the global services contractors were who implemented it were, all only 2 weeks behind schedule—a new record for a project of this scope. That manager got a promotion and is now VP of something or other. He sleeps like a baby and makes 100 times more than you.
- bphogan 14y agoHey, hey, now. I did include people who never moved on from copy-and-paste too.
- n09n 14y agoThey understand that "good code" is code that delivers a lot of value to the person who needs it. Why hate on them for that? You just sound jealous that they make more than you do.
- jlgreco 14y agoMaybe he has had the pleasure of being someone that gets to maintain that "good" code. I know I have.. and at Comcast no less.
- deleted 14y ago[deleted]
- n09n 14y agoThat's the whole point. Code is not meant to serve the people who maintain it. Maintainability is only a concern once lack of such starts impacting your actual customers. If writing ugly code and fixing it up later is necessary in order to get shit out the door, why is that bad?
- dchichkov 14y agoYou know, there is nothing wrong in picking up code from stack overflow. If you are very efficient in picking up good, well written snippets that fit the style of the project and work without debugging and any time waste - more power to you. Personally, I consider google search (and stack overflow) as an extension of my development environment and I'd recommend using it and melding your dev env with google search as much as possible. It really helps and speeds things up.
- bphogan 14y agoI agree - there's nothing wrong with picking up code from SO if you trust it and understand it. But that takes experience . I've come across lots of situations where the accepted answer isn't the best answer. So I'm talking about knowing vs. cargo-culting.