Someone gives you a bug. “The light in the conference room on the 26th floor is on. It needs to be off.”
A note on the bug says, “This will take you like 5 minutes. It’s just flipping a switch.“
You go to the conference room on 26. The light is on, but there’s no light switch in the room.
So you prepare to install one. But the designer says it would ruin the room’s aesthetic. Plus, the walls are concrete. With the proper tools, you could install the switch. But no one will approve the purchase of the proper tools. Without the proper tools it will take two days. And they want it done now, because they’re afraid that any minute the CEO might decide to go to the 26th floor and happen to walk by the conference room and ask why the hell that light is on.
And now you’re getting emails asking why the light isn’t off yet.
So now you have to stop and send a group email to explain the situation, and several people start up a panicked email chain.
You know if you wait for the problem to be resolved by anyone discussing it in the email chain, it won’t get fixed. The bug has your name on it, and it’s dated today, so you’re the one in trouble if it isn’t resolved. So you go up into the hallway ceiling on 26, find the wires leading to the light, cut and cap them. Finally. Problem solved.
In order to quell the panic in the email thread, you report back how you solved the issue.
You don’t hear anything for a while. When you do, everyone is concerned that now the light can’t be turned on and off. What if the CEO wants to have a meeting in there? So here’s what they ask you to do: They want you to run wires from the light down into the basement. When someone needs the light to be on or off, they’ll contact you, and have you run to the basement and either connect or disconnect the wires.
You protest the ridiculousness of this solution. Your boss says, “Yeah, I know it’s not ideal. But it’s the only solution we have right now.”
At this point you realize you have a choice. You could do this. Or you could quit in protest, and find another job. But you realize that once you start that new job, they’re likely to ask you to do something just as idiotic, if not more so.
So you go run the wires from floor 26 down to the basement. When you get to the basement, you see dozens of wires hanging out of the walls, from all the people who have had to do this exact same thing before. (So that’s where the idea came from.) You set up the wires and label them as best you can, with a short apology to whoever has to deal with this next.
When you get back to your desk, you have a message. QA has reopened the bug. It says, “I see light.“
You head back up to the conference room on 26. The light is off. You go back to your desk and close the bug, reporting that you checked on it in person.
QA reopens the bug again. “Room still lit” it says. After looking at the unlit bulb one more time, you tell your boss, who suggests you go back down to the basement and check the wires. You protest that you are looking at the light right now and it’s off. “I know, but this way you can tell QA you checked out absolutely everything.”
So you sigh and head to the basement. Sure enough, the wires are not connected. The ends are capped. They are not resting on anything that could conduct electricity.
You report back to QA that you checked the wires, which are not connected, and that you looked at the bulb, which was unlit.
“I didn’t mean the bulb,” says QA. “The bug is about light in the room. There’s still too much light. Shouldn’t you close the blinds?“
You respond that the blinds don’t fall under your control, and that the bug specifies the light being turned off.
Not believing you, QA sends out a group email asking if the blinds are covered by the bug.
Some time passes before you hear from anyone. Finally someone from the email chain calls you.
“Theoretically,” they ask, “could someone participating in a meeting in the conference room on 26 open or close the blinds by themselves if it was too bright or too dark?”
Yes they could, you reply.
“Like, an ordinary person? They wouldn’t need you to do it?“
Yes, an ordinary person. No, they wouldn’t need you. Anyone can do it.
“Great. Excellent. Then we’ll leave that for now. I’ll schedule a stand-up meeting about the blinds issue.”
So the bug is closed. Now, the CEO, possibly having caught wind of all the discussion and furtive activity surrounding the conference room on 26, wants to have a meeting there. You get several panicked emails that they need the light on.
You go to the basement, connect the wires, and return to your desk, to find 32 new messages in your inbox. “Something’s wrong—the light’s not on!” “There’s a problem — no light!” “Are you getting these emails?” and so on.
The 32nd email says, “Nevermind—the light’s on.“
This process is repeated more or less exactly when it’s time to turn the light off again.
But if there’s any good news, it’s this: after the meeting, everyone forgets that there even is a conference room on 26, so you never have to do anything about it again.
via: /r/ProgrammingHumor
Hoy el día comenzó de una manera jovial y virtuosa, como siempre, tuve un meeting con mi manager para ver básicamente como me sentía con la gente nueva y con la gente vieja por que el proximo año habrán cambios que dices tú: “Ok.”
Pasa que a lo largo del día tuve unos cuantos encuentros de Super Smash Brothers Wii U el cual no es de mi total agrado pero pues en fin, como siempre, no es por presumir (pero si, básicamente estoy presumiendo) terminé ganando la mayor parte de las retas porque siento que al jugar smash estoy controlando una extension de mi cuerpo (el mamón, el mamón).
En fin, terminé el día laboral como debe de ser: con unas cervecitas coquetas con mi buen amigo Isaac Z. y el Hector Y. y sus alumnos ó no sé como llamar a los piltros bodegueros que traen en este “Nearsoft Apprentice”. Buenos chamacos y un poco risueños.
Después de todo este arguende, me fui a platicar con mis amigos Charlie, Dors y Jessi sobre la vida, el viaje que harán a Tucson y sobre cierto correo electrónico que envié para despedirme de todos los tacuaches de la empresa, obviamente no me podia despedir de la raza sin mandar un correo extremista e insultante para todos, pues así soy yo.
El dia terminó con la cereza del pastel, subí a platicar y por el cigarrito coqueto nocturno con el Pistolas y uno de mis mentorados, a discutir y arruinar sus temas de conversación filosoficos con premisas absurdas y falacias que ellos mismos no entenderian por que soy un ser muy “simple” para ellos y pues, por lo mismo no pueden comprender cuando les digo que no me importa, todo esto para esperar a Piltro Valle, mi amigo Alex, alias el Chepe.
¿Nuestro destino?,
Liverpool. La gran tienda, la gran venta nocturna.
Por supuesto que primero tuvimos que pasar por mi casa ya que el inútil piltro tacuache bodeguero de mi mismo dejó su tarjeta que fue patrocinada por el buen Nearsoft Inc ó como lo conocemos los amigos: C CUBE TECHNOLOGIES Y ASOCIADOS.
Tomé mi gift card y salí corriendo para poder tomar el expreso a Liverpool, pero antes tendríamos que hacer una parada en la casa de nuestro amigo Pulidoman, la casa del amigo Chepe. Aquí es donde empieza lo interesante de la historia, Pulidoman aka PM, estaba sufriendo de una agotante fiebre por que decidió comerse una manzana un poco… mala.
En fin, decidimos tomar el expreso a Liverpool y nos fuimos excelentemente rumbo a Galerias Mall, donde no se encuentra Liverpool por que estúpidamente pensábamos que ahí encontraríamos una tienda Liverpool donde gastar nuestros gift cards de 1000 pesos cada quien.
Oh sorpresa!, no hay tienda Liverpool, es un Sears, mientras salimos del maldito estacionamiento sonó una alarmante cantidad de fuegos pirotécnicos los cuales hicieron que nuestros cerebros lanzaran una alerta y nos asustáramos de una manera horrible y gritáramos como las niñas que somos.
Buscamos con nuestros poderosos aparatos electrónicos llamados “smartfons” ó smart phones para los altruistas de la nueva era, como diablos llegar a nuestro ultimo destino, la tienda Liverpool y entre unas cuantas calles en sentido contrario, llegamos a un 7eleven por que estábamos valiendo como 3 pargos zarandeados de verga por que el GPS al parecer no sirve muy bien en Hermosillo o no están actualizados los mapas, que se yo.
Compramos unas bebidas refrescantes sabor té de limón y coca cola y un encendedor para el cigarro coqueto y seguimos a nuestro destino al cual si llegaríamos para buscar un Play Station 4, un Wii U, unos audífonos para la novia de Chepe y ¿por que no?, unos juguetes para mi sobrino.
Llegamos al estacionamiento y había una cola del diablo para entrar, cuando estábamos en la fila me pregunto Chepe: ¿por que diablos no nos estacionamos en el Sanborns? y yo contesté: awanta, ¿hay Sanborns en Hermosillo?!.
Total, después de unos minutos, entramos al estacionamiento y no sé por que subimos al 2ndo piso, decidimos que sería mas fácil encontrar lugar ahí por alguna extraña razón, pero los tiburones de lugares estaban muy oportunistas y robaban los lugares hasta que encontramos un lugar, justo enfrente de la entrada del estacionamiento. ¿Destino?, Si.
Al entrar a esta hermosa tienda Liverpool, nos llegó el aroma del consumismo, es ese olor como una mezcla de perfumes… si, lo conocen bien, subimos al 2ndo piso buscando la juguetería pero encontramos rapidamente la parte donde venden televisores.
No encontramos nada de consolas ahí ni nada por el estilo, tuvimos que rebajarnos a preguntarle a un piltro cualquiera sobre donde encontrar estos aparatos mágicos del destino.
El buen mozo de rufián nos guió através de la tienda hasta la jugueteria que se encontraba en un piso intermedio entre el 2ndo y el 1ero, muy extraño lugar que no contenía ninguna consola, y no podíamos ver los juegos ni nada por el estilo.
“Al diablo” se escuchó de mi parte y agarré un Lego para mi sobrino, al salir de la juguetería me desesperé y dejé el juguete sarra ahi tirado.
Regresamos al area de televisores y vimos audifonos, encontré unos audifonos hermosos: Skullcandy Crusher, tienen bajo y todo el roio y estaban a $1300, con la hermosa promoción del 30% de Liverpool, me salieron basicamente en $910.
Mi amigo Chepe destruyó un puesto de telcel y nos decidimos bajar al primer piso, donde Chepe encontraria el amor de una dama que atendia la tienda Aeropostale que hay dentro de Liverpool, pero para antes, fuimos a comprar un libro llamado: “El Arte de Amar” de Erich Fromm, un libro hermoso que habla sobre como amar es como aprender cualquier otro arte, como la carpinteria.
Cuando acudimos al area de libros, nuestro amigo Chepe le preguntó al vendedor que si tenia alguna copia del famoso libro del Arte de Amar, el vendedor solo nos dijo: “es un libro muy dificil de conseguir” y fue a la decena de copias del Arte de Amar que tenia y nos preguntó que si leiamos mucho, por supuesto que contestamos que sí y entonces nos repitió que era un libro muy dificil de conseguir, luego nos dio un “top 40” de los libros que venden en Liverpool y nos repitió una vez mas: “es un libro muy dificil de conseguir”.
Recibimos una llamada de mi amigo PM, preguntándonos por un “expreso a Hogwarts”, le dijimos que no estuviera chingando y que volviera a dormir y por su agotadora fiebre.
Para esto, el piltro Chepe se midió unas camisetas en Aeropostale y unos “sweaters” y acudimos a pagar, la joven jovial que atendía “Brenda” muy amablemente nos atendió y al parecer quería salir de esa pocilga bodeguera para tener alguna clase de aventura sexual con nosotros, estuvimos apunto de irnos pero pues, ella salía mas tarde, nosotros no teníamos tiempo pues no podíamos desvelarnos (y aquí estoy escribiendo).
En fin, salimos de la tienda y una joven que trabajaba ahí nos quiso guiar al estacionamiento como si fuéramos unos inútiles, creo que les interesamos a las 2 mujeres de Liverpool, quien sabe, nunca sabremos si ellas eran capaces de amar.
Nos aventamos el cigarrito coqueto, un joven se nos unió por que “no traia cigarros y queria uno”, le ofrecimos de los nuestros porque no somos tacuaches bodegueros y sacamos cigarro.
Fue una noche bonita y terminamos cenándonos unos tacos.
I’ve been working on a feature since January… I’ve been working on the entire UI and middleware of this feature.
We use SpringMVC for the HTTP endpoints on our web application and we dispatch all the requests via a Controller.
That’s easy right?
But… there is this anti-pattern used where we try to make our controllers lighter because Controllers should not handle business logic right?!
It is called: The Helper class.
That’s right, we have these Controllers that handle the request but instead of using the underlying business services, we add this ControllerHelper class that will handle all the logic and will only call services for almost all of these tasks:
That’s right, we only do that and Ohhh I hate that so much.
Let’s see an example:
This is what the old code looked (I modified some stuff of course!), why would someone actually work on that code? and even worse… the unit tests for THAT controller were testing that you setted the correct info in the correct object…
Oh but here it came, someone had the idea to create this:
The Oh God Why Helper class, now our Controllers are clean of “logic” right?
Yeah I know, so, if you read the code you noticed that there are some “userService” there… oh right, those services are defined right now like this:
Yup, those services logic is only to call another service or just the database.
Well, I think that the “Helper” classes should not exist.. it should not handle all that logic… so I rewrote the Controller and deleted some (because there are like… A LOT OF THOSE Controller/Helper classes) of the Helper class methods and got something like this:
So, all the logic is now at the bussiness layer and the controller only handles the bad request (if there is an error on the business layer it is handled there and return something that the controller can interpret)
Basic stuff but still mostly all of the team doesnt understand this, I just wanted to rant.
The singleton pattern is used when you want to make sure there is exactly one instance of something in your program. If you were making a Lord of the Rings game, you would want to make sure that the One Ring was only instantiated once! We have to give Frodo a chance!.
The most important thing to remember about sorting is that it takes O(n log n) time. (That is, the fastest sorting algorithm for arbitrary data takes O(n log n) time.)