|
Wheany posted:I once used Δx and Δy (or similar) variable names in Java in a toy project. Writing a chess program I really wanted to use the unicode chess symbols as enum values, sadly* C# wouldn't allow it (although it will allow them in the comments). *wisely
|
# ? May 10, 2013 18:53 |
|
|
# ? Jun 8, 2024 08:19 |
|
zergstain posted:How do I linked list? Your code is chock full of horrors.
|
# ? May 10, 2013 18:57 |
|
Thanks for letting him know.
|
# ? May 10, 2013 19:01 |
|
Dren posted:Your code is chock full of horrors. This code was written in 1998 with tabs, and in 2003 it got changed to spaces. I committed a version that isn't broken today.
|
# ? May 10, 2013 19:48 |
|
zergstain posted:This code was written in 1998 with tabs, and in 2003 it got changed to spaces. I committed a version that isn't broken today. Which one did you pick? Does your place have a standard?
|
# ? May 10, 2013 20:13 |
|
Dren posted:Which one did you pick? Does your place have a standard? Standard is tabs, but it either wasn't always this way, or a lot of people don't care. I always just use what the rest of the file uses because mixing them is just awful. So I changed that code to tabs. As well as made it not crash when you have more than 1 item to insert in the list.
|
# ? May 10, 2013 20:33 |
|
I'm not sure which is worse, that code or the fact it's been broken for 15 years.
|
# ? May 10, 2013 21:52 |
|
HappyHippo posted:Writing a chess program I really wanted to use the unicode chess symbols as enum values, sadly* C# wouldn't allow it (although it will allow them in the comments). this is an amazing idea.
|
# ? May 10, 2013 23:50 |
|
I love really weird SE questions: My customer wants me to record a video of how I develop his software product.
|
# ? May 11, 2013 06:38 |
|
Sometimes I like to search github... https://github.com/search?q=fwrite+extension%3Aphp+%24_REQUEST&type=Code&ref=searchresults
|
# ? May 11, 2013 09:21 |
|
SplitDestiny posted:Sometimes I like to search github...
|
# ? May 11, 2013 09:25 |
|
Volte posted:https://github.com/search?q=extension%3Aphp+md5+password+mysql_query+%24_GET&type=Code&ref=searchresults Pfffhahha
|
# ? May 11, 2013 09:31 |
|
Jewel posted:Pfffhahha Heh, I had to do a double-take when I saw that username. I actually know that guy. He's dyslexic, so he has a good excuse for misspelling things.
|
# ? May 11, 2013 11:15 |
|
"indput" is a perfectly valid Danish-ified English word, though. Not so much "acces"
|
# ? May 11, 2013 12:51 |
|
HappyHippo posted:Writing a chess program I really wanted to use the unicode chess symbols as enum values, sadly* C# wouldn't allow it (although it will allow them in the comments). You may not be able to directly interact with the unicode symbols, but ToString() doesn't give a poo poo about it. var piece = Chess.Piece.BlackPawn; var piece = Enum.Parse(typeof(Chess.Piece), "♟"); gibbed fucked around with this message at 13:32 on May 11, 2013 |
# ? May 11, 2013 13:28 |
|
Sebbe posted:Heh, I had to do a double-take when I saw that username. I actually know that guy. He's dyslexic, so he has a good excuse for misspelling things.
|
# ? May 11, 2013 15:11 |
|
Volte posted:https://github.com/search?q=extension%3Aphp+md5+password+mysql_query+%24_GET&type=Code&ref=searchresults https://github.com/search?q=extension%3Acpp+%2F%2F+gently caress+poo poo&type=Code&ref=searchresults E: hahaha bucketmouse fucked around with this message at 17:49 on May 11, 2013 |
# ? May 11, 2013 17:43 |
|
Plorkyeran posted:I think if you're dyslexic you really should be using a compiled language with a strong type system. Nah, then you get nothing but compile errors and it takes ages to get anything done.
|
# ? May 11, 2013 17:55 |
|
bucketmouse posted:https://github.com/search?q=extension%3Acpp+%2F%2F+gently caress+poo poo&type=Code&ref=searchresults code:
Not the worst error handler I can think of.
|
# ? May 11, 2013 19:24 |
|
I had to support an ancient PHP app back in the day (think like php 3.0) and I had no exposure to php before that. I basically had to learn it in one weekend and make this monstrously awful billing app that served millions of customers work. In my frustration I had several variables called things like gently caress, FUCKKK, and FUCKKKKKKKKYOOOOOOOOOUUUUUPHP but the thing eventually got working. A couple weeks ago one of the guys I used to work with got hold of me on LinkedIn and the first thing he told me was that they were all still there 'because if we tried to change one it broke everything'.
|
# ? May 13, 2013 02:07 |
|
Scaramouche posted:I had to support an ancient PHP app back in the day (think like php 3.0) and I had no exposure to php before that. I basically had to learn it in one weekend and make this monstrously awful billing app that served millions of customers work. In my frustration I had several variables called things like gently caress, FUCKKK, and FUCKKKKKKKKYOOOOOOOOOUUUUUPHP but the thing eventually got working. A couple weeks ago one of the guys I used to work with got hold of me on LinkedIn and the first thing he told me was that they were all still there 'because if we tried to change one it broke everything'. The horror is coming from inside the thread
|
# ? May 13, 2013 02:27 |
|
Scaramouche posted:I had to support an ancient PHP app back in the day (think like php 3.0) and I had no exposure to php before that. I basically had to learn it in one weekend and make this monstrously awful billing app that served millions of customers work. In my frustration I had several variables called things like gently caress, FUCKKK, and FUCKKKKKKKKYOOOOOOOOOUUUUUPHP but the thing eventually got working. A couple weeks ago one of the guys I used to work with got hold of me on LinkedIn and the first thing he told me was that they were all still there 'because if we tried to change one it broke everything'. This is a form of immortality. Your legacy will live on. In the year 2100 someone will see those variables and do a git blame on them and remember you. Because I'm sure this app was completely version controlled.
|
# ? May 13, 2013 03:56 |
|
Scaramouche posted:I had to support an ancient PHP app back in the day (think like php 3.0) and I had no exposure to php before that. I basically had to learn it in one weekend and make this monstrously awful billing app that served millions of customers work. In my frustration I had several variables called things like gently caress, FUCKKK, and FUCKKKKKKKKYOOOOOOOOOUUUUUPHP but the thing eventually got working. A couple weeks ago one of the guys I used to work with got hold of me on LinkedIn and the first thing he told me was that they were all still there 'because if we tried to change one it broke everything'. The real coding horror is that you can't change a goddamned variable name in PHP without everything breaking.
|
# ? May 13, 2013 04:12 |
|
Volmarias posted:The real coding horror is that you can't change a goddamned variable name in PHP without everything breaking. More like PHP jockeys trying to refactor without an IDE and missed half the files.
|
# ? May 13, 2013 14:03 |
|
Hughlander posted:More like PHP jockeys trying to refactor without an IDE and missed half the files. Or globally replacing every instance with names that were already in use.
|
# ? May 13, 2013 16:22 |
|
php:<? function doReports() { /* Just when I thought it couldn't get any worse... */ ?> (Turns out that it's a "reports" dispatch function because some brilliant predecessor decided that the way to maintain multiple user-sites was to have a bunch of files which called dispatch functions, and then copy the files to a new directory every time you want to set up a new user site. This means that "adding a new feature" means "find an appropriate-ish dispatch file and shoe-horn it in there") gently caress.
|
# ? May 14, 2013 11:51 |
|
php:<? if($dates)foreach($dates as $key => $value) { $year = addslashes($value['y']); $month = addslashes($value['m']); $day = addslashes($value['d']); $hm = addslashes($value['i']); $date = "$year-$month-$day $hm"; $this->data[$key] = $date; //$this->data[$key] = $date; } ?>
|
# ? May 14, 2013 12:28 |
|
bobthecheese posted:
|
# ? May 14, 2013 13:29 |
|
Pilsner posted:Has anyone ever seen a method in code named Do____ (for example DoEmails) that wasn't crap? I assume it's a holdover from VB or something. DoItInTheButt(...)
|
# ? May 14, 2013 13:42 |
|
Volmarias posted:DoItInTheButt(...) Depending on implementation, a lot of crap.
|
# ? May 14, 2013 13:48 |
|
bobthecheese posted:
Cool, I see your coder copy-pasted the same php foreach tutorial as our did. Meaning he used foreach($dates as $key => $value), then $value['y'] instead of foreach($dates as $date) and $date['y']
|
# ? May 14, 2013 14:20 |
|
There is so much wrong with this code. So much. Just finding where things are rendered (and how) is a spaghetti mess, because it (appears to be) dependant on all of these inputs which are never actually set, or used, but are supposedly required. For example, this is how that particular report page gets rendered: Step 1: a call to "endcustomer/admin/reports.php?rp=2 "rp=2" refers to "report page number 2" because this is the only way to add new pages to the "reports.php" script php:<? // this file sets a the "ROOT_RELATIVE" constant to be... usually '../' or '../../'. Because that could never go wrong include_once ('pathdepth.php'); // this file sets a the "ROOT_RELATIVE" constant to be... usually '../' or '../../'. Because that could never go wrong include_once ('../rtoid.php'); // this is a file which defines which end customer the code is meant to run as. It sets an ID. // include some application build-up junk doReports(); ?> php:<? function doReports() { /* Just when I thought it couldn't get any worse... */ // a bunch of stuff until we get the report page - most of it isn't used in this function at all $reportpage = getInt('rp',REPORTPAGE_GROUP); if ($reportpage == REPORTPAGE_HOMEPAGE) { // a bunch more stuff, and a poo poo-load of else-ifs for different reports } elseif ($reportpage == REPORTPAGE_STUDENT || $reportpage == REPORTPAGE_GROUP) { // oh wow, two unrelated reports share the same function... and model require_once(ROOT_RELATIVE . 'model/admin/report_student_results.model.php'); $request = HTTPRequest::getInstance(); $view = new StudentResultsReport(); // this part is a decoy because nothing ever sets this action. Anywhere. $action = $request->get('form_action'); // OK, so we call "execute" on this model... that sounds straight forward echo $view->Execute($action); die(); //doStudentReport(); } } ?> php:<? class StudentResultsReport extends FooController { function getCollatedResults( $groupId=null, $search=null, $assess_types = Array(), $showAll=false ) { // a bunch of poo poo which runs bad queries. } var $templates = Array( "view" => "student_results" ); } ?> php:<? class FooController { function Execute($action=null) { // if the action isn't set, it automatically becomes "view" $action = $action ? $action : 'view'; // looks to see if there's a tempalte for that action $request = HTTPRequest::getInstance(); if(isset($this->templates) && is_array($this->templates) && array_key_exists($action, $this->templates)){ $template = $this->templates[$action]; $handler = new PHPTemplate($template); return $handler->render($request, $this); } // no template? maybe we have a function... should we use that "hasAction" function below? nah... $call = "do_$action"; if(is_callable(Array($this, $call))) return $this->$call($request); else return $this->render($request); } function hasAction($action) { $call = "do_$action"; return (is_callable(Array($this, $call))); } } ?> php:<? if( $request->rp == REPORTPAGE_GROUP ) { // a bunch of report stuff } else if ($request->rp == REPORTPAGE_STUDENT ) { // hey look, more, but different stuff } else // a function call to build a different report... ?> This was actually a pretty tame one. I found another where it was pulling templates from the database, so if you didn't have an "up to date" database, certain pages wouldn't work. Pages with hard-coded URLs. That depend on the database to tell them which source files to read. gently caress fuckity gently caress gently caress gently caress. To be clear, none of that code has ACTUAL comments, except for the one that I posted earlier. The comments were put in by me to skip a lot of the unpleasantness.
|
# ? May 14, 2013 15:07 |
|
Volmarias posted:DoItInTheButt(...) DoTheNeedful()
|
# ? May 14, 2013 20:54 |
|
Scaramouche posted:DoTheNeedful() Oh my god yes, now you need to work "I have a doubt" in there somewhere as I heard that one quite a bit as well
|
# ? May 14, 2013 20:57 |
|
No Safe Word posted:Oh my god yes, now you need to work "I have a doubt" in there somewhere as I heard that one quite a bit as well That's from Spanish speakers, since the word we use when we are uncertain of something is "duda" which is literally translated as doubt. I believe that native English speakers interpret doubt as something negative so it seems weird to use it in place of the word question.
|
# ? May 14, 2013 21:05 |
|
code:
Summit fucked around with this message at 21:19 on May 14, 2013 |
# ? May 14, 2013 21:17 |
|
Hard NOP Life posted:That's from Spanish speakers, since the word we use when we are uncertain of something is "duda" which is literally translated as doubt. I believe that native English speakers interpret doubt as something negative so it seems weird to use it in place of the word question. "I have a doubt" is a bad translation of "I have a question," which, if I'm not mistaken, would use "pregunta" instead of "duda." I've only seen "I have a doubt" from Indians. The reason it's weird isn't connotation, it's the fact that using "doubt" as a singular noun in English is extremely uncommon.
|
# ? May 14, 2013 21:24 |
|
GrumpyDoctor posted:"I have a doubt" is a bad translation of "I have a question," which, if I'm not mistaken, would use "pregunta" instead of "duda." You're technically correct about "pregunta", but at least in Mexico it's just as common to use "duda". Also thanks for introducing me to the term singular noun, it's frustrating to try and talk about a something where your vocabulary is limited on the subject.
|
# ? May 14, 2013 22:11 |
|
Wheany posted:Cool, I see your coder copy-pasted the same php foreach tutorial as our did. Meaning he used foreach($dates as $key => $value), then $value['y'] instead of foreach($dates as $date) and $date['y'] it's possible the data looks like PHP code:
Deus Rex fucked around with this message at 23:21 on May 14, 2013 |
# ? May 14, 2013 23:14 |
|
|
# ? Jun 8, 2024 08:19 |
|
"Sure, I'll just dig in there and find out why searches aren't working like they should in this goddamn software we pay way too much money for!"PHP code:
Edit: I just found this in the same code. PHP code:
Tad Naff fucked around with this message at 23:41 on May 14, 2013 |
# ? May 14, 2013 23:27 |