Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted October 9, 20195 yr public static function moveCheck( $configuration, $oldConfiguration ) { foreach( array( 'bucket', 'bucket_path' ) as $field ) if ( $configuration[ $field ] !== $oldConfiguration[ $field ] ) { return TRUE; } return FALSE; } @Martin A. dragged me into this brief insanity, he accepted it before I did. It's still just so wrong.
October 9, 20195 yr Never said I accepted it. I only confirmed that it did work, no matter how insane it may be. Is this your new kind of Easter eggs? Or some kind of bet to see how it took for someone to notice? Or did you let Charles or Lindy write that method?
October 9, 20195 yr You don’t need the curly braces. https://stackoverflow.com/questions/8726339/php-if-else-for-foreach-while-without-curly-braces/8726411
October 9, 20195 yr 40 minutes ago, Adriano Faria said: You don’t need the curly braces. https://stackoverflow.com/questions/8726339/php-if-else-for-foreach-while-without-curly-braces/8726411 you don't but its bad form imho, it can make the intention unclear :)
October 10, 20195 yr Is it safe to assume the feedback you're wanting to provide here is that you expected curly braces in the copied code? The post isn't extremely clear.
October 10, 20195 yr 3 hours ago, bfarber said: Is it safe to assume the feedback you're wanting to provide here is that you expected curly braces in the copied code? The post isn't extremely clear. Neither is the code! 🤣
October 10, 20195 yr Author 3 hours ago, bfarber said: Is it safe to assume the feedback you're wanting to provide here is that you expected curly braces in the copied code? The post isn't extremely clear. 10 points Slytherin
October 11, 20195 yr Management I checked with git, and that code pre-dates git. I no longer have access to our svn repo so I can't tell you. If we find out who it is, we will write a strongly worded letter expressing our disappointment to their mother.
October 15, 20195 yr On 10/9/2019 at 5:33 PM, CodingJungle said: you don't but its bad form imho, it can make the intention unclear 🙂 how? it's still very obvious what the code is doing. I could see someone being confused by not knowing it doesn't need them, but once you accept that it can be done that way, there's only one way to interpret what the code is doing in such a simple example.
October 15, 20195 yr 14 hours ago, Midnight Modding said: how? it's still very obvious what the code is doing. I could see someone being confused by not knowing it doesn't need them, but once you accept that it can be done that way, there's only one way to interpret what the code is doing in such a simple example. according to psr2 they are a MUST: https://www.php-fig.org/psr/psr-2/#5-control-structures As well with IPS own internal Coding Standard, they are a MUST (I've also attached IPS internal coding standards to this reply): Any professional developer or professional level software i would EXPECT them to follow at least the industry standards (best practices). In much more complex code, lacking in curly brackets around your control structures can easily lead to bugs and maintenance hell. sure you CAN write you code without them, it doesn't mean you SHOULD write it without them. Any IDE worth its salt, will add them automatically as you are writing the code, so this is really a non-issue that imho can be easily avoided, make your code look cleaner, its intention clear and less likely to lead to potential bugs as you add code or another developer comes along an inherits/adopts your code. Coding_Standards.pdf
October 15, 20195 yr 4 hours ago, CodingJungle said: according to psr2 they are a MUST: https://www.php-fig.org/psr/psr-2/#5-control-structures As well with IPS own internal Coding Standard, they are a MUST (I've also attached IPS internal coding standards to this reply): Any professional developer or professional level software i would EXPECT them to follow at least the industry standards (best practices). In much more complex code, lacking in curly brackets around your control structures can easily lead to bugs and maintenance hell. sure you CAN write you code without them, it doesn't mean you SHOULD write it without them. Any IDE worth its salt, will add them automatically as you are writing the code, so this is really a non-issue that imho can be easily avoided, make your code look cleaner, its intention clear and less likely to lead to potential bugs as you add code or another developer comes along an inherits/adopts your code. Coding_Standards.pdf 143.22 kB · 1 download I'm not saying otherwise. I am simply saying there's no way to be confused by that code, assuming one knows it will work without them.
October 15, 20195 yr 21 minutes ago, Midnight Modding said: I'm not saying otherwise. I am simply saying there's no way to be confused by that code, assuming one knows it will work without them. yes, in that particular code, its not, but i wasn't specifically talk about that piece of code, that should be "clear", as if you looked at the post i was replying to, it wasn't about the OP 🙂
October 16, 20195 yr I have no idea who was responsible or when the missing braces were introduced, and have no appetite to dig through git history to try to figure it out. The braces have been added for the next release to alleviate confusion. This is really one of those things that shouldn't require a 2 page conversation if you ask me. 😛
October 16, 20195 yr Author 10 minutes ago, bfarber said: This is really one of those things that shouldn't require a 2 page conversation if you ask me. 😛 It is if you are trying to bring a little levity into what has become a fairly mature, stable, and well-engineered product (he says after recently looking over mybb among other things...)
October 16, 20195 yr 3 hours ago, bfarber said: I have no idea who was responsible or when the missing braces were introduced, and have no appetite to dig through git history to try to figure it out. The braces have been added for the next release to alleviate confusion. This is really one of those things that shouldn't require a 2 page conversation if you ask me. 😛 this sounds like a distraction to keep us from the #truth #releaseTheLogs
Archived
This topic is now archived and is closed to further replies.