• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:32
CEST 16:32
KST 23:32
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Power Rank - Esports World Cup 202537RSL Season 1 - Final Week9[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16
Community News
BSL Team Wars - Bonyth, Dewalt, Hawk & Sziky teams4Weekly Cups (July 14-20): Final Check-up0Esports World Cup 2025 - Brackets Revealed19Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission re-extension4
StarCraft 2
General
Power Rank - Esports World Cup 2025 RSL Revival patreon money discussion thread RSL Season 1 - Final Week The GOAT ranking of GOAT rankings Esports World Cup 2025 - Final Player Roster
Tourneys
Esports World Cup 2025 Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation #239 Bad Weather Mutation # 483 Kill Bot Wars Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava
Brood War
General
ASL20 Preliminary Maps BSL Team Wars - Bonyth, Dewalt, Hawk & Sziky teams BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Flash Announces (and Retracts) Hiatus From ASL
Tourneys
[Megathread] Daily Proleagues [CSLPRO] It's CSLAN Season! - Last Chance [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread [MMORPG] Tree of Savior (Successor of Ragnarok) Path of Exile CCLP - Command & Conquer League Project
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI Stop Killing Games - European Citizens Initiative
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
[\m/] Heavy Metal Thread Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Socialism Anyone?
GreenHorizons
Customize Sidebar...

Website Feedback

Closed Threads



Active: 739 users

My colleagues just reminded me why i quit

Blogs > Deleted User 101379
Post a Reply
1 2 3 Next All
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 10 2012 10:01 GMT
#1
Non-programmers will most likely not understand a word i'm writing here but maybe those with a programming background will get a laugh from it:

Today we released our mobile VOD platform and as with any big release, there was some trouble. Less than expected considering that half the backend was changed but gits great merging kept a lot of trouble away from us.

However, there was one bug that my colleagues couldn't figure out so i had to jump in to help. I spent 20 minutes searching for it, tracing through several functions, the huge if($action == 'asdf') {}elseif ($action == 'bvcx') {}... block, etc. and at first i couldn't find it either. It looked as if he went into a block where the if condition was a constant defined as false compared to true.


if (MOBILE_TEMPLATE == true)
{
// the code he shouldn't reach in this case
}


Apart fromt he fact that "== true" doesn't make sense anyways, the code shouldn't enter this block in the situation we were testing. My colleague showed me the debug output of MOBILE_TEMPLATE which clearly showed that it's false.

After going through everything step-by-step and testing the variables myself i found this gem in my debug output:
string(5) "false"


Checking the declarations i found the source of the bug:

if ($product_id == 1)
{
define('MOBILE_TEMPLATE', 'false');
}
else
{
define('MOBILE_TEMPLATE', 'true');
}


If you know your PHP, you will know that the string "false" evaluates to true in a boolean comparision since it's not an empty string.

Now i ordered the two guys responsible to fix that ASAP. They started with changing the code to:

if (MOBILE_TEMPLATE == 'true')
{
...
}


I wanted to punch them sooooo hard.
Luckily i'm out of here at the end of the month...


***
gaymon
Profile Blog Joined April 2011
Germany1023 Posts
Last Edited: 2012-09-10 10:42:38
September 10 2012 10:42 GMT
#2
Are those guys students or what ? Can't imagine people with a finished degree are doing such facepalm-worthy things.
Catch]22
Profile Blog Joined July 2009
Sweden2683 Posts
Last Edited: 2012-09-10 10:44:32
September 10 2012 10:43 GMT
#3
Good luck finding a job where noone ever make mistakes.
Rannasha
Profile Blog Joined August 2010
Netherlands2398 Posts
September 10 2012 10:44 GMT
#4
And this is exactly why I prefer languages that are more strongly typed than PHP (which is pretty much every language).
Such flammable little insects!
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 10 2012 10:53 GMT
#5
On September 10 2012 19:42 gaymon wrote:
Are those guys students or what ? Can't imagine people with a finished degree are doing such facepalm-worthy things.


They finished their degrees but this company doesn't exactly look for the brightest employees, only the cheapest, which is why we ended up with a team of programmers that write such bad code on a daily basis. I spend more time helping them to fix their messes than i spend actually doing my work.

There isn't a single day where they don't ask me "How can i do <stupid thing>?" and i have to go over and find out what mess they produced to get into a situation where they would want to do <stupid thing>.

When i started programming professionally a decade back i thought i'd be amongst the most intelligent people working on expanding their knowledge to write perfect code.
Reality hit me hard.
divito
Profile Blog Joined January 2011
Canada1213 Posts
September 10 2012 13:39 GMT
#6
"Perfect" code takes far longer than companies are willing to allow. You're dealing with less knowledgeable people because skilled coders cost too much, and shorter time frames to meet deadlines, meaning you get generic and mangled code that works, rather than spending the time to find a more elegant solution.

Sure, there are plenty of programmers that look for solutions in their spare time, or make it their goal to find elegance in projects, but they are likely freelancing or simply working by themselves. Finding such skill in someone attached to a company (that isn't a start-up) is rare. Companies are getting the ones who slugged it out in college/university and can hack together some code to do the basic stuff they need; they're far from the passionate people that end up becoming entrepreneurs most of the time.
Skype: divito7
ParkwayDrive
Profile Joined July 2011
United States328 Posts
September 10 2012 14:07 GMT
#7
hows the view from up there?
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
September 10 2012 14:42 GMT
#8
How much do these guys earn? I'm wondering because I myself am a bad coder but still I couldn't code as poorly as this. Earning anything more than you would earn at fast food in programming with no knowledge on php boolean doesn't make sense.
"windows bash is a steaming heap of shit" tofucake
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 10 2012 15:13 GMT
#9
On September 10 2012 23:42 Djagulingu wrote:
How much do these guys earn? I'm wondering because I myself am a bad coder but still I couldn't code as poorly as this. Earning anything more than you would earn at fast food in programming with no knowledge on php boolean doesn't make sense.


Of course i can't give exact numbers but it's far below industry average of anyone coming fresh from university. I earn around 75% of what any programmer fresh from university would earn and i'm the highest paid programmer in the team by quite a big margin.

There are only 2 reasons why people work here:
1. Every other job didn't want them (me)
2. They don't know better

I don't expect them to be great programmers, i can live with
... their 500 line if-elseif-elseif-...-else functions
... the fact that they write every number as "123" (with quotes)
... that they can't differentiate between a file_get_contents on an URL or a file
... their 5000+ line functioncollection files
... the fact that they couldn't debug their way out of a recursion if their life depended on it
... that they repeatedly try to use variables that were never defined
... their complete lack of object-oriented code or even understanding
but this example of complete lack of understanding of basic types today just made me facepalm, especially since instead of correcting the mistake they merrily went ahead to make it worse until i stopped them.

Just for the laughs, another example that popped up today while fixing the bugs in the release:

if ((...) && !$_SERVER['SERVER_NAME'] == '....' )
{
}


I told them a hundred times "Better to use a few paranthesis too much than have an expression that doesn't do what you think it does".
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2012-09-10 19:38:52
September 10 2012 19:26 GMT
#10
I'm pretty bad at php.

When you define do you have to do something like


if ($product_id == 1)
{
define('MOBILE_TEMPLATE', FALSE);
}
else
{
define('MOBILE_TEMPLATE', TRUE);
}

?

edit: yeah that looks right to me. You should tell your friends to get a syntax highlighting text editor. Then they won't define something as a string when they mean to define it as a bool.

Why do you need to use define? Can't you just set a variable to true or false? Or is define just used for case sensitivity?


if (MOBILE_TEMPLATE == 'true')
{
...
}

Missing a $sign.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 10 2012 21:32 GMT
#11
On September 11 2012 04:26 obesechicken13 wrote:
I'm pretty bad at php.

When you define do you have to do something like


if ($product_id == 1)
{
define('MOBILE_TEMPLATE', FALSE);
}
else
{
define('MOBILE_TEMPLATE', TRUE);
}

?

edit: yeah that looks right to me. You should tell your friends to get a syntax highlighting text editor. Then they won't define something as a string when they mean to define it as a bool.

Why do you need to use define? Can't you just set a variable to true or false? Or is define just used for case sensitivity?


if (MOBILE_TEMPLATE == 'true')
{
...
}

Missing a $sign.


A define is PHPs version of a constant, i.e. a variable that can't be changed once it is set. They don't have a $ in front of their name and it's customary to write them in all caps to differentiate them from PHP keywords.

They are usually used to set configuration values that are required throughout the whole project. In 90% of the cases they are used wrong though, bad programmers abuse them to break encapsulation and have their functions depend on those defines instead of using function parameters, which makes stuff like unit testing almost impossible.

You could use a variable and define it as global everywhere you use them but you can't rely on them keeping the value you expect, other functions might change it.

Also, they are already using a syntax highlighting editor - they are bad programmers, not (completely) stupid - and luckily they are not my friends, i already have enough reasons to hate my life, i don't need such friends.
Integra
Profile Blog Joined January 2008
Sweden5626 Posts
September 10 2012 21:51 GMT
#12
So basically they assigned the text "true" or "false" to a variable and mistook it for the Boolean value true and false, and then they tried to compare the variable with a true false comparison in which case it would always come true since both "true" and "false" where an actually string and therefore it would be true no matter what.

That's brilliant.
"Dark Pleasure" | | I survived the Locust war of May 3, 2014
tofucake
Profile Blog Joined October 2009
Hyrule19049 Posts
September 10 2012 21:54 GMT
#13
I prefer to do something like
if ($product_id == 1)
{
define('USING_MOBILE', 1);
}

...

if(defined(USING_MOBILE))
{
whatever
}
Liquipediaasante sana squash banana
tofucake
Profile Blog Joined October 2009
Hyrule19049 Posts
September 10 2012 21:55 GMT
#14
On September 10 2012 23:42 Djagulingu wrote:
How much do these guys earn? I'm wondering because I myself am a bad coder but still I couldn't code as poorly as this. Earning anything more than you would earn at fast food in programming with no knowledge on php boolean doesn't make sense.

Bad coders can be had for about $20/hour in most places....
Liquipediaasante sana squash banana
zatic
Profile Blog Joined September 2007
Zurich15325 Posts
September 10 2012 22:04 GMT
#15
On September 10 2012 23:42 Djagulingu wrote:
How much do these guys earn? I'm wondering because I myself am a bad coder but still I couldn't code as poorly as this. Earning anything more than you would earn at fast food in programming with no knowledge on php boolean doesn't make sense.

Oh don't worry there are very highly paid programmers who do worse things.

I don't find it excusable either, but so many people just don't give enough fucks to actually learn programming before or while they are programming.
ModeratorI know Teamliquid is known as a massive building
Geiko
Profile Blog Joined June 2010
France1939 Posts
September 10 2012 22:10 GMT
#16
On September 10 2012 19:01 Morfildur wrote:

Now i ordered the two guys responsible to fix that ASAP. They started with changing the code to:

if (MOBILE_TEMPLATE == 'true')
{
...
}


I wanted to punch them sooooo hard.
Luckily i'm out of here at the end of the month...


So, not being a programmer myself, why doesn't their solution work ?
geiko.813 (EU)
Integra
Profile Blog Joined January 2008
Sweden5626 Posts
Last Edited: 2012-09-10 22:18:45
September 10 2012 22:15 GMT
#17
On September 11 2012 07:10 Geiko wrote:
Show nested quote +
On September 10 2012 19:01 Morfildur wrote:

Now i ordered the two guys responsible to fix that ASAP. They started with changing the code to:

if (MOBILE_TEMPLATE == 'true')
{
...
}


I wanted to punch them sooooo hard.
Luckily i'm out of here at the end of the month...


So, not being a programmer myself, why doesn't their solution work ?

The problem is that they are using string operators when they should be using boolean. It clearly demonstrates that they have no fucking idea of what they are doing.

EDIT; let me clarify.

When you want to actually want to type something, like some sort of output to the user for example you would use a string, like this:

$string =' hello this is a message to the user';
echo $string;

However in this case they are simply to evaluate what path to take in a condition:

IF ($condition==true) {

}

In this case using a string makes no sense and a boolean should be used instead.

"Dark Pleasure" | | I survived the Locust war of May 3, 2014
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2012-09-10 22:24:10
September 10 2012 22:17 GMT
#18
On September 11 2012 07:10 Geiko wrote:
Show nested quote +
On September 10 2012 19:01 Morfildur wrote:

Now i ordered the two guys responsible to fix that ASAP. They started with changing the code to:

if (MOBILE_TEMPLATE == 'true')
{
...
}


I wanted to punch them sooooo hard.
Luckily i'm out of here at the end of the month...


So, not being a programmer myself, why doesn't their solution work ?

It's still comparing to a string rather than a bool, so that's just bad practice. Not only that, but whatever they want the revised code to do is not what the original code was supposed to do. That's just bad logic.


On September 11 2012 06:32 Morfildur wrote:
Show nested quote +
On September 11 2012 04:26 obesechicken13 wrote:
I'm pretty bad at php.

When you define do you have to do something like


if ($product_id == 1)
{
define('MOBILE_TEMPLATE', FALSE);
}
else
{
define('MOBILE_TEMPLATE', TRUE);
}

?

edit: yeah that looks right to me. You should tell your friends to get a syntax highlighting text editor. Then they won't define something as a string when they mean to define it as a bool.

Why do you need to use define? Can't you just set a variable to true or false? Or is define just used for case sensitivity?


if (MOBILE_TEMPLATE == 'true')
{
...
}

Missing a $sign.


A define is PHPs version of a constant, i.e. a variable that can't be changed once it is set. They don't have a $ in front of their name and it's customary to write them in all caps to differentiate them from PHP keywords.

They are usually used to set configuration values that are required throughout the whole project. In 90% of the cases they are used wrong though, bad programmers abuse them to break encapsulation and have their functions depend on those defines instead of using function parameters, which makes stuff like unit testing almost impossible.

You could use a variable and define it as global everywhere you use them but you can't rely on them keeping the value you expect, other functions might change it.

Also, they are already using a syntax highlighting editor - they are bad programmers, not (completely) stupid - and luckily they are not my friends, i already have enough reasons to hate my life, i don't need such friends.

Ah thanks.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
zatic
Profile Blog Joined September 2007
Zurich15325 Posts
September 10 2012 22:17 GMT
#19
It does work. But instead of fixing the initial mistake they introduced another mistake which kinda masks the initial mistake on the surface. It'll work, it's just ugly and not the way it's supposed to be done.
ModeratorI know Teamliquid is known as a massive building
Geiko
Profile Blog Joined June 2010
France1939 Posts
September 10 2012 22:21 GMT
#20
On September 11 2012 07:15 Integra wrote:
Show nested quote +
On September 11 2012 07:10 Geiko wrote:
On September 10 2012 19:01 Morfildur wrote:

Now i ordered the two guys responsible to fix that ASAP. They started with changing the code to:

if (MOBILE_TEMPLATE == 'true')
{
...
}


I wanted to punch them sooooo hard.
Luckily i'm out of here at the end of the month...


So, not being a programmer myself, why doesn't their solution work ?

The problem is that they are using string operators when they should be using boolean. It clearly demonstrates that they have no fucking idea of what they are doing.

EDIT; let me clarify.

When you want to actually want to type something, like some sort of output to the user for example you would use a string, like this:

$string =' hello this is a message to the user';
echo $string;

However in this case they are simply to evaluate what path to take in a condition:

IF ($condition==true) {

}

In this case using a string makes no sense and a boolean should be used instead.



Ok that's what I thought too.

But after making the mistake to use strings instead of booleans, isn't it faster to fix the bug like they did, rather than change the type of the variable and risk having bugs every other place where the variable was used ?
geiko.813 (EU)
1 2 3 Next All
Please log in or register to reply.
Live Events Refresh
Esports World Cup
10:00
2025 - Day 2
Reynor vs MaruLIVE!
herO vs Cure
Serral vs Classic
EWC_Arena11426
ComeBackTV 2506
TaKeTV 593
Hui .562
3DClanTV 379
Rex244
EnkiAlexander 234
CranKy Ducklings166
mcanning164
Reynor137
UpATreeSC124
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
EWC_Arena11153
Hui .562
Rex 244
mcanning 160
Reynor 148
UpATreeSC 121
StarCraft: Brood War
Bisu 4153
Barracks 2002
Flash 1844
BeSt 1507
Jaedong 1452
EffOrt 1067
Mini 568
Stork 503
ggaemo 401
Snow 340
[ Show more ]
Soma 270
GuemChi 262
ZerO 257
Soulkey 245
ToSsGirL 194
Rush 131
Hyun 109
Dewaltoss 85
soO 60
TY 58
Sacsri 35
scan(afreeca) 26
Movie 14
Terrorterran 11
Yoon 11
Bale 9
ivOry 7
Britney 0
Dota 2
syndereN339
420jenkins290
XcaliburYe287
Counter-Strike
sgares624
flusha99
edward64
Super Smash Bros
Westballz34
Other Games
singsing2077
hiko1292
B2W.Neo1004
crisheroes423
Fuzer 172
ArmadaUGS77
QueenE49
KnowMe48
ZerO(Twitch)17
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 7
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH273
• Adnapsc2 2
• intothetv
• IndyKCrew
• AfreecaTV YouTube
• sooper7s
• Migwel
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 1297
• WagamamaTV523
League of Legends
• Nemesis3928
• TFBlade734
Upcoming Events
Esports World Cup
19h 28m
TBD vs Zoun
TBD vs SHIN
TBD vs ShoWTimE
TBD vs Rogue
Esports World Cup
1d 20h
CranKy Ducklings
2 days
BSL20 Non-Korean Champi…
2 days
CSO Cup
3 days
BSL20 Non-Korean Champi…
3 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
FEL
3 days
BSL20 Non-Korean Champi…
3 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Sparkling Tuna Cup
5 days
[ Show More ]
Online Event
6 days
Liquipedia Results

Completed

CSL Xiamen Invitational
Championship of Russia 2025
Murky Cup #2

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Esports World Cup 2025
CC Div. A S7
Underdog Cup #2
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
HCC Europe
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.