Details
-
Aboutnewbie
-
Skillsjs, nodejs, Ruby, bootstrap, css, AngularJS
-
LocationHong Kong
-
Github
Joined devRant on 10/2/2016
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Talking to my angry girlfriend is the hardest debugging process.
I can't even find out what went wrong44 -
As a developer, sometimes you hammer away on some useless solo side project for a few weeks. Maybe a small game, a web interface for your home-built storage server, or an app to turn your living room lights on an off.
I often see these posts and graphs here about motivation, about a desire to conceive perfection. You want to create a self-hosted Spotify clone "but better", or you set out to make the best todo app for iOS ever written.
These rants and memes often highlight how you start with this incredible drive, how your code is perfectly clean when you begin. Then it all oscillates between states of panic and surprise, sweat, tears and euphoria, an end in a disillusioned stare at the tangled mess you created, to gather dust forever in some private repository.
Writing a physics engine from scratch was harder than you expected. You needed a lot of ugly code to get your admin panel working in Safari. Some other shiny idea came along, and you decided to bite, even though you feel a burning guilt about the ever growing pile of unfinished failures.
All I want to say is:
No time was lost.
This is how senior developers are born. You strengthen your brain, the calluses on your mind provide you with perseverance to solve problems. Even if (no, *especially* if) you gave up on your project.
Eventually, giving up is good, it's a sign of wisdom an flexibility to focus on the broader domain again.
One of the things I love about failures is how varied they tend to be, how they force you to start seeing overarching patterns.
You don't notice the things you take back from your failures, they slip back sticking to you, undetected.
You get intuitions for strengths and weaknesses in patterns. Whenever you're matching two sparse ordered indexed lists, there's this corner of your brain lighting up on how to do it efficiently. You realize it's not the ORMs which suck, it's the fundamental object-relational impedance mismatch existing in all languages which causes problems, and you feel your fingers tingling whenever you encounter its effects in the future, ready to dive in ever so slightly deeper.
You notice you can suddenly solve completely abstract data problems using the pathfinding logic from your failed game. You realize you can use vector calculations from your physics engine to compare similarities in psychological behavior. You never understood trigonometry in high school, but while building a a deficient robotic Arduino abomination it suddenly started making sense.
You're building intuitions, continuously. These intuitions are grooves which become deeper each time you encounter fundamental patterns. The more variation in environments and topics you expose yourself to, the more permanent these associations become.
Failure is inconsequential, failure even deserves respect, failure builds intuition about patterns. Every single epiphany about similarity in patterns is an incredible victory.
Please, for the love of code...
Start and fail as many projects as you can.30 -
Potential Employer: So your website does not seem to work well in Internet Explorer. A lot of employers might get annoyed with it.
Me: Yeah, I don't want them to hire me or even send me a message.2 -
I recently met a young fella (14yo) playing League of Legends. He asked:
- What do you do for a living?
- I'm a programmer, do you know anything about programming?
- I don't, actually.
Apparently he was playing from a LAN Gaming center 'cause he didn't have a computer at home (his computer had broken and these Lan centers are pretty affordable).
I figured I could explain to him what was it and what super powers you could get from it. Turns out I recommended a JS course in codecademy and now he goes to the LAN center every day to study programming (he got really into it!).
Now he always pings me with questions about JS and apparently he's learning a ton! He had almost no English skills too (we're Brazilian), and because most of the material in the internet is in English he found himself some free English courses and he's now taking them!
Knowledge is free on the internet and I guess he's just realized that.
Not exactly a rant guys, just figured it was a nice story to tell :)
#TeachAKidHowToCode57 -
This code review gave me eye cancer.
So, first of all, let me apologize to anyone impacted by eye cancer, if that really is a thing... because that sounds absolutely horrible. But, believe me, this code was absolutely horrible, too.
I was asked to code review another team's script. I don't like reviewing code from other teams, as I'm pretty "intense" and a nit-picker -- my own team knows and expects this, but I tend to really piss off other people who don't expect my level of input on "what I really think" about their code...
So, I get this script to review. It's over 200 lines of bash (so right away, it's fair game for a boilerplate "this should be re-written in python" or similar reply)... but I dive in to see what they sent.
My eyes.
My eyes.
MY EYES.
So, I certainly cannot violate IP rules and post any of the actual code here (be thankful - be very thankful), but let me just say, I think it may be the worst code I've ever seen. And I've been coding and code-reviewing for upwards of 30 years now. And I've seen a LOT of bad code...
I imagine the author of this script was a rebellious teenager who found the google shell scripting style guide and screamed "YOU'RE NOT MY REAL DAD!" at it and then set out to flagrantly violate every single rule and suggestion in the most dramatic ways possible.
Then they found every other style guide they could, and violated all THOSE rules, too. Just because they were there.
Within the same script... within the SAME CODE BLOCK... 2-space indentation... 4-space indentation... 8-space indentation... TAB indentation... and (just to be complete) NO indentation (entire blocks of code within another function of conditional block, all left-justified, no indentation at all).
lowercase variable/function names, UPPERCASE names, underscore_separated_names, CamelCase names, and every permutation of those as well.
Comments? Not a single one to be found, aside from a 4-line stanza at the top, containing a brief description of that the script did and (to their shame), the name of the author. There were, however, ENTIRE BLOCKS of code commented out.
[ In the examples below, I've replaced indentation spacing with '-', as I couldn't get devrant to format the indentation in a way to suitably share my pain otherwise... ]
Within just a few lines of one another, functions defined as...
function somefunction {
----stuff
}
Another_Function() {
------------stuff
}
There were conditionals blocks in various forms, indentation be damned...
if [ ... ]; then
--stuff
fi
if [ ... ]
--then
----some_stuff
fi
if [ ... ]
then
----something
something_else
--another_thing
fi
And brilliantly un-reachable code blocks, like:
if [ -z "$SOME_VAR" ]; then
--SOME_VAR="blah"
fi
if [ -z "$SOME_VAR" ]
----then
----SOME_VAR="foo"
fi
if [ -z "$SOME_VAR" ]
--then
--echo "SOME_VAR must be set"
fi
Do you remember the classic "demo" programs people used to distribute (like back in the 90s) -- where the program had no real purpose other than to demonstrate various graphics, just for the sake of demonstrating graphics techniques? Or some of those really bad photo slideshows, were the person making the slideshow used EVERY transition possible (slide, wipe, cross-fade, shapes, spins, on and on)? All just for the sake of "showing off" what they could do with the software? I honestly felt like I was looking at some kind of perverse shell-script demo, where the author was trying to use every possible style or obscure syntax possible, just to do it.
But this was PRODUCTION CODE.
There was absolutely no consistency, even within 1-2 adjacent lines. There is no way to maintain this. It's nearly impossible even understand what it's trying to do. It was just pure insanity. Lines and lines of insanity.
I picture the author of this code as some sort of hybrid hipster-artist-goth-mental-patient, chain-smoking clove cigarettes in their office, flinging their own poo at their monitor, frothing at the mouth and screaming "I CODE MY TRUTH! THIS CODE IS MY ART! IT WILL NOT CONFORM TO YOUR WORLDLY STANDARDS!"
I gave up after the first 100 lines.
Gave up.
I washed my eyes out with bleach.
Then I contacted my HR hotline to see if our medical insurance covers eye cancer.32 -
┓┏┓┏┓┃
┛┗┛┗┛┃\○/
┓┏┓┏┓┃ / Friday
┛┗┛┗┛┃ノ)
┓┏┓┏┓┃ Deploys
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┃┃┃┃┃┃
┻┻┻┻┻┻17 -
Girl : I like dangerous men.
Me : I didn't run test cases while committing my changes last night.
Girl : my hero!
Me : *wakes up from the dream*14 -
Well Google.. I have been shouting null at you but you don't seem to respond. WHAT DO YOU WANT FROM ME??2
-
Guy: "We just can't finish this in 1 month!"
Boss: "Yeah you can, I'll hire more people."
Guy: "... You know, a woman can deliver a baby in 9 months but 9 women can't deliver a baby in 1 month."21 -
Real HR policy ...
HR Manager in Heaven!!!
One day while walking down the street a highly successful HR Manager was hit by a bus and she died. Her soul arrived up in heaven where she was greeted by God himself.
"Welcome to Heaven," said God. "
"Well, What we're going to do is let you have a day in Hell and a day in Heaven and then you can choose whichever one you want to spend an eternity in."
"Actually, I think I've made up my mind, I prefer to stay in Heaven", said the woman.
"Sorry, we have rules."
And with that God put the HR Manager in an elevator and it went down-down-down to hell.
The doors opened and she found herself stepping out onto the hell wt beautiful golf course. And a country club and standing in front of her were all her friends - fellow executives that she had worked with and they were well dressed in evening gowns and cheering for her. they talked about old times.
She met the Devil who was really a nice guy and She was having such a good time that before she knew it, it was time to leave.
Everybody waved goodbye as she got on the elevator.
The elevator went up-up-up and opened back up at the Pearly Gates and found God waiting for her.
"Now it's time to spend a day in heaven," he said. So she spent the next 24 hours around on clouds and playing the harp and singing. She had great time and before she knew it her 24 hours were up and God came and got her.
"So, you've spent a day in hell and in heaven. Now u must choose ur eternity,"
The woman paused for a second and then replied, "Well, I never thought I'd say this, I mean, Heaven has been really great and all, but I think I had a better time in Hell."
So God escorted her to the elevator and again she went down-down-down back to Hell.
When the doors of the elevator opened she found herself standing in a desolate wasteland covered in garbage and filth. She saw her friends were dressed in rags and were picking up the garbage and putting it in sacks.
The Devil came up to her and put his arm around her.
"I don't understand," stammered the woman, "yesterday I was here and there was a golf course and a country club and we ate lobster and we danced and had a great time. Now all there is a wasteland of garbage and all my friends look miserable."
The Devil looked at her smiled and said:
...
...
...
....
....
"Yesterday we were recruiting you, today you're an Employee".😁😁😁
☝dedicated to all companies9