|
manero posted:Hey, does anyone know why everything on the page stopped worki This is dedicated trolling.
|
# ¿ Dec 28, 2010 21:10 |
|
|
# ¿ Apr 28, 2024 03:39 |
|
EDIT: Nevermind, I see the differences now. I'm the coding horror.
|
# ¿ Sep 10, 2011 00:09 |
|
OriginalPseudonym posted:Is that like "I don't know PHP so I'll make PHP in Javascript"? No, it's like "I don't know javascript, so I'll make javascript in PHP": http://code.google.com/p/phpquery/
|
# ¿ Nov 20, 2011 19:29 |
|
Beef posted:Dear GOD The part you quoted is the worst part but jesus christ, everything in that markup is awful. I guess it was a couple years ago, so maybe they've learned their lesson?
|
# ¿ Dec 5, 2011 22:13 |
|
tef posted:
Is this how you say "Come at me, bro" in PHP?
|
# ¿ Dec 31, 2011 19:30 |
|
Chopper posted:But it's GOOGLE, they do no evil... right? I have a feeling Google has a lot easier ways to "steal" your online messages.
|
# ¿ Apr 23, 2012 03:09 |
|
I don't get it. That's how all my professors' code looks at the university I'm at right now. Turns out the people who teach you how to code don't know how to code themselves.
|
# ¿ Jun 4, 2012 22:44 |
|
Thermopyle posted:I'm really embarrassed to say that I use git and didn't really know this. This is due to me first learning the minimum I needed to know about git during a time crunch and then lazily not ever reading about it more. Since it came up, I might be good to mention git add -p, which allows for staging hunks. So even if it's the same file, you could commit the different changes to different branches.
|
# ¿ Jan 3, 2013 01:48 |
|
Ephphatha posted:
Sorry, this is from last page, but this stands out to me as a serious coding horror in PHP. I really don't understand this, but it really seems like PHP devs are extremely adverse to using templating engines and instead there ends up being disgusting html string building and printing. I used to do it, too, but I even see some bigger projects straight up echo out html. Is there something inherently flawed about templating engines that I'm not aware of?
|
# ¿ Jan 5, 2013 20:52 |
|
nielsm posted:Odd, seeing that PHP itself is a templating engine, that has massively grown out of its original purpose. Oops. That's what I get for knowing PHP and not Perl. I just thought the code tags always said "Perl code." I must be misremembering something.
|
# ¿ Jan 6, 2013 04:19 |
|
I'd usually agree with you both, but maybe I have a bias after using Flask/Jinja and Symphony/Twig for a lot of projects lately. Even for simple html pages, I've always found something like:Python code:
HTML code:
Perl code:
I'm not saying this is the one true way. I just think devs should be less averse to using it for code clarity. But then again, I've only been using them for the past few months, so maybe I'm the horror.
|
# ¿ Jan 6, 2013 05:28 |
|
Freakus posted:Html in code is bad, but code in templates is bad. There's more code than html in all rewrites I've seen - really, what's the point either way? I'd argue that for debugging purposes, you know exactly where to look. If some HTML renders weird or there's some weird typo, you know that it's something wrong with the presentation logic in the template so you can easily go to that exact point and follow any explicitly mentioned macros from there. When it's in the controller or view logic where you build the HTML, then you need to first find where you build that HTML at, since it could be spread across a lot of other logic before it gets echo'd. There's not much of a difference, but it seems like a good idea to separate controller/view logic from actual presentation logic. And code in templates is a little bit better than interrupting HTML with weird breaks into <?php ?>. Most people don't use the construction syntax and then you get things like: PHP code:
|
# ¿ Jan 6, 2013 23:14 |
|
DAT NIGGA HOW posted:You're telling me its impossible to create a completely cryptographically secure communication application in the browser? Thats an interesting claim. Are you copy-pasting from Hacker News right now or are you serious? Have you ever used a computer before?
|
# ¿ Jul 7, 2013 08:25 |
|
Deus Rex posted:fix that opening brace and it is perfect Yeah, why put a space between the `else` and the `{` and not between the `if` and the `{`? I imagine that's a typo. Unless you were talking about putting the opening brace on the next line. In which case, gently caress you.
|
# ¿ Jul 9, 2013 06:36 |
|
pokeyman posted:Just probate everyone who continues a tabs v. spaces (or similar) argument beyond the third consecutive reply. As long as you make sure the probation message is within 80 characters.
|
# ¿ Jul 10, 2013 23:17 |
|
Scaramouche posted:I'm not going to post code because it would just be a nested series of statements, but I've inherited a farrago of snakes Modz pls rename me farrago of snakes
|
# ¿ Jul 25, 2013 02:51 |
|
Isilkor posted:Is there a reason they can't just replace (what I assume is) their own implementation of HMAC with a small wrapper around OpenSSL, since they're already recommending that and it's part of the standard library? Why bother with continuously updating the wrapper when it shouldn't be there in the first place? I imagine they want to just totally yank this out of the next version.
|
# ¿ Jul 31, 2013 02:07 |
|
Does not compile? Looks like someone needs a testsuite and presumbit hooks. Seriously, I'd rather someone get mad at my tests and linter that keeps being a dick to them about whitespace and lack of backwards compatibility than rollback and blame for every dumb push.
|
# ¿ Aug 14, 2013 15:25 |
|
Extortionist posted:I wish I could dump large bits of my company's codebase on here, because I could demonstrate quite clearly the ways in which dumb people use whitespace. Should've use Go and gofmt, scrubs
|
# ¿ Aug 16, 2013 09:52 |
|
Wow, someone doesn't write tests. 20 restarts is a whole lot of money lost. Are you the only user or something?
|
# ¿ Aug 31, 2013 07:57 |
|
I really don't understand why anyone would find git harder to use than any other VCS or DVCS. Like, what are you guys doing? Cloning, merging, forking, pulling, cherry-picking, and blaming are dead simple. And all git UIs suck save for Github/Bitbucket because a simple alias is nicer than a totally different UX workflow. Even github talks about a bunch of features it has available but find difficult to expose through the UI.
|
# ¿ Sep 7, 2013 06:49 |
|
I dunno, I remember going to the ACM Socal programming competition like 3 times and Harvey Mudd beating us up.
|
# ¿ Sep 13, 2013 05:55 |
|
Uh, hate to break this to you, but that's not even a lot of imports in python. Also, I hope you never have to write something that uses tons of included dependencies like C/C++.
|
# ¿ Sep 24, 2013 06:04 |
|
BigRedDot posted:Not quite the same thing, but how about a while-else? http://docs.python.org/2/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops. The only problem I have with for-else in python is that some templating engines use for-else to check if the loop condition isn't true on the very first iteration. Like what Twig does: http://twig.sensiolabs.org/doc/tags/for.html#the-else-clause. So when I switch from writing Twig templates to Jinja templates, I always have weird display errors.
|
# ¿ Oct 30, 2013 02:31 |
|
Ithaqua posted:Of course, the actual horror there is unit testing private methods. Unless you're teaching a programming class, and want some automated testing. I don't understand the need for the extra #undef private, am I missing something?
|
# ¿ Dec 11, 2013 07:17 |
|
If people hate Javascript, why not write code in Coffeescript and pretend it's python? Unless you're actually upset that the answer to "4 < '4'" is not what you expect.
|
# ¿ Jan 14, 2014 22:04 |
|
College courses that teach programming all vary wildly in structure in content with the only constant being that their structure and content almost assuredly sucks. Please do not ruin my world view with stories of your Stanford, MIT, and CMU CS courses, those obviously do not count. For a related coding horror, I present some mime-type checking code I wrote for a school project where we had to make an application with the minimal functionality of Google Docs: code:
Speaking of compiler horrors in uni, we had to write an Android->JS transcompiler, so I chose to generate Coffeescript and compile that into JS using the `coffee` tool. To support overloaded functions in Coffeescript (since we used an ANTLR Java grammar and didn't know anything about Android), I mapped all function names of a class to a set of definitions of different argument lengths and parameter lists and in the generated Coffeescript I defined each class function by switching on argument length and then doing type checking on each argument for each length case. Basically, the following code in Java: code:
code:
|
# ¿ Jan 27, 2014 04:10 |
|
FamDav posted:a set. I'm referring to actually populating that set to catch the correct video formats. It seemed like a "video/" filetype would be a catchall for videos. I just added the four other on, but I never tested whether any vulnerabilities could happen and I found out a couple of years later (with the site running on my linode still for some reason) that it was vulnerable to this old PHP hack since I couldn't think of better ways to find out if a file was really a video/audio file or not.
|
# ¿ Jan 27, 2014 07:50 |
|
With that last example, I almost feel like we're talking past each other. Just because your compiler figures it out fine on your particular architecture, it doesn't mean the behavior is defined by the language specification. I'm sure gcc4.6+ won't blow up on the snippet posted, but that's probably because the forward-propagate RTL pass is turned on by default at every optimization level. But it's even strange to assume two different C/C++ compilers would return the same results for that snippet, although they might.
|
# ¿ Feb 5, 2014 19:10 |
|
Don Mega posted:One of my old coworkers loved to put for loops on one line. Looks like they are compensating for something.
|
# ¿ Feb 14, 2014 04:07 |
|
Coding horrors thread: throwing shoes at 15 year olds
|
# ¿ Feb 23, 2014 00:21 |
|
Yeah, that's right, I compile with -Wall and -pedantic Then I get mad and type `python` 'cause I ain't got time for semantics
|
# ¿ Feb 23, 2014 22:59 |
|
apseudonym posted:Lack of code review considered harmful. Honestly, I doubt that given a code review for this, which was probably one of many files, you would have caught the error on a first pass. Especially since the code is so logically simple. It's like when someone writes the the word "the" twice and your eyes kind of just combine them.
|
# ¿ Feb 25, 2014 03:12 |
|
PHP: The Good Parts
|
# ¿ Mar 8, 2014 08:11 |
|
revmoo posted:coworkers that read HackerNews 24/7 This is the real horror, no need to blame a perfectly fine DVCS.
|
# ¿ Apr 24, 2014 07:17 |
|
http://cpprocks.com/what-if-c-looked-more-like-python-or-coffeescript/ As a person who likes to write C/C++, Python, and Coffeescript, I am deeply offended.
|
# ¿ May 9, 2014 05:31 |
|
I just wish people used the auto keyword responsibly.
|
# ¿ May 9, 2014 05:57 |
|
The Insect Court posted:The "argument" for NodeJS was that there were a shitload of JavaScript "developers" and NodeJS let them spread to doing server-side stuff without using a sensible language. Ah, yes, the sensible languages to write server-side code in: Python, Ruby, PHP, and Java.
|
# ¿ May 14, 2014 16:55 |
|
WHERE MY HAT IS AT posted:Why yes, that is a 19,000 line source file. Is that supposed to be uncommon or something?
|
# ¿ May 15, 2014 00:06 |
|
|
# ¿ Apr 28, 2024 03:39 |
|
I don't understand how if Javascript/Node/NPM are bad, you suggest Python/Django/Pip and Ruby/Rails/RVM|Gems are somehow a better alternative. All of these toolchains seem to have mostly the same problems, except the JS toolchain excels in lack of maturity and doesn't have enough C bindings to be included on your lovely OS by default. Well, I do understand, it's probably because you get paid to write in it and it fits your world view for some reason.
|
# ¿ May 15, 2014 14:49 |