• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:36
CEST 05:36
KST 12:36
  • 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
BGE Stara Zagora 2025: Info & Preview26Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL46Code S RO12 Preview: Cure, Zoun, Solar, Creator4[ASL19] Finals Preview: Daunting Task30
Community News
[BSL20] ProLeague: Bracket Stage & Dates8GSL Ro4 and Finals moved to Sunday June 15th12Weekly Cups (May 27-June 1): ByuN goes back-to-back0EWC 2025 Regional Qualifier Results26Code S RO12 Results + RO8 Groups (2025 Season 2)3
StarCraft 2
General
The SCII GOAT: A statistical Evaluation BGE Stara Zagora 2025: Info & Preview Magnus Carlsen and Fabi review Clem's chess game. Jim claims he and Firefly were involved in match-fixing GSL Ro4 and Finals moved to Sunday June 15th
Tourneys
Bellum Gens Elite: Stara Zagora 2025 Master Swan Open (Global Bronze-Master 2) $5,100+ SEL Season 2 Championship (SC: Evo) SOOPer7s Showmatches 2025 Cheeseadelphia 2025 - Open Bracket LAN!
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 476 Charnel House Mutation # 475 Hard Target Mutation # 474 Futile Resistance Mutation # 473 Cold is the Void
Brood War
General
Will foreigners ever be able to challenge Koreans? [BSL20] ProLeague: Bracket Stage & Dates BGH auto balance -> http://bghmmr.eu/ BW General Discussion I made an ASL quiz
Tourneys
[ASL19] Grand Finals [Megathread] Daily Proleagues [BSL20] ProLeague Bracket Stage - Day 2 [BSL20] ProLeague Bracket Stage - Day 1
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
What do you want from future RTS games? Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Mechabellum
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
LiquidLegends to reintegrate into TL.net
Heroes of the Storm
Heroes of the Storm 2.0 Simple Questions, Simple Answers
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Vape Nation Thread European Politico-economics QA Mega-thread
Fan Clubs
Maru Fan Club Serral Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Cleaning My Mechanical Keyboard
TL Community
The Automated Ban List
Blogs
Cognitive styles x game perf…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Poker
Nebuchad
Customize Sidebar...

Website Feedback

Closed Threads



Active: 9005 users

My colleagues just reminded me why i quit

Blogs > Deleted User 101379
Post a Reply
Normal
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
Hyrule19026 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
Hyrule19026 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)
Integra
Profile Blog Joined January 2008
Sweden5626 Posts
September 10 2012 22:27 GMT
#21
On September 11 2012 07:21 Geiko wrote:
Show nested quote +
On September 11 2012 07:15 Integra wrote:
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 ?

No, not if they used proper OOP encapsulation... which probably is sketchy.... you could do refactoring that comes with any professional editor so it should not be a problem. Also the benefit from keeping the bad code is only short term, the long term effect is that it will cost more time.

There is also a programmers standpoint on this. The code becomes "dumb" and you won't be able to read anything from it. Every time someone uses a string it's understood that its suppose to be used in some sort of output, thus you can predict what the code does, it becomes more easy to read and navigate in it. Once you start mixing it up you don't know wtf people are intending with the codes anymore. it becomes impossible to actually understand it. Never mind even trying to debug or add more code to it later... Further Strings takes more memory and process power to process compared to booleans.
"Dark Pleasure" | | I survived the Locust war of May 3, 2014
Loser777
Profile Blog Joined January 2008
1931 Posts
September 10 2012 23:12 GMT
#22
I don't think you could get through the first class of any programming major at any school like that... Given that most schools teach the boolean type before strings and that one often needs to use some sort of string library before that kind of code will even compile.

I'm just going to turn a blind eye and pretend that those kinds of coders only exist in web design for now.


6581
tofucake
Profile Blog Joined October 2009
Hyrule19026 Posts
September 10 2012 23:58 GMT
#23
lol

it's PHP

a variable is any type

you can do
$foo = true;
$foo = 12.381;
$foo = "bar";
$foo = 4;
$foo = array()

and get no errors...not even any warnings
Liquipediaasante sana squash banana
dartoo
Profile Joined May 2010
India2889 Posts
September 11 2012 00:26 GMT
#24
lol.I've certainly seen stuff like that at my job too. and my first reaction was...oh these guys must be entry level programmers/just getting off the block, and often when you correct them..in a maybe slightly harsh tone they really start to lose their stuff .
Release
Profile Blog Joined October 2010
United States4397 Posts
September 11 2012 02:45 GMT
#25
LOLOLOLOL

I'm in my first month of Comp Sci at school and i understand this...
☺
The_LiNk
Profile Blog Joined July 2010
Canada863 Posts
September 11 2012 05:20 GMT
#26
I've been learning PHP over the course of the month and it's entertaining to be able to read the codes and shake my head to this. I can't imagine making such...mistakes.
Deleted User 61629
Profile Blog Joined March 2010
1664 Posts
September 11 2012 05:29 GMT
#27
--- Nuked ---
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 11 2012 08:45 GMT
#28
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 ?


Their solution works but next time another programmer works with that and gets told "that constant is always either true or false" he writes "if (MOBILE_TEMPLATE == true)" and wonders why it doesn't work the way he thinks it would.

Yes, changing true to "true" fixes this bug initially but by not fixing the original problem you invite a huge mess of possible future bugs that are hard to trace. Suddenly you never know if anything is true or "true" and the whole code becomes a mess where every time you add or change a line of code you have to triple-check to make sure it actually works.
Talin
Profile Blog Joined September 2010
Montenegro10532 Posts
September 11 2012 12:10 GMT
#29
At first I was thinking like "well this happens all the time due to carelessness, it's just funny that they couldn't find it", but then I read the last part and the "solution" and it did make me chuckle.
cascades
Profile Blog Joined October 2009
Singapore6122 Posts
Last Edited: 2012-09-11 14:33:22
September 11 2012 14:33 GMT
#30
Is entertaining want more. Will give cookie and stars.
HS: cascades#1595 || LoL: stoppin
BrTarolg
Profile Blog Joined June 2009
United Kingdom3574 Posts
September 11 2012 15:20 GMT
#31
I have never even studied programming beyond being forced to write stupid bits of excel VBA and making othello and java

And i can still understand this lol

Though i made some waaay more horrible mistakes when i first wrote othello hahahaha

But its mainly because nobody taught me anything so i didn't know where to even start, to get a working piece of logic together was already a miracle for me
teamamerica
Profile Blog Joined July 2010
United States958 Posts
September 11 2012 18:03 GMT
#32
PHP lol. There used to be a bug in their md5 digest function where when you passed a string and a salt, it just returned the salt.
RIP GOMTV. RIP PROLEAGUE.
13k
Profile Joined November 2009
Brazil16 Posts
Last Edited: 2012-09-11 19:18:51
September 11 2012 19:05 GMT
#33
Coming from the Ruby community and seeing many noobs adopting Rails (kinda) successfully, I'd mostly advocate towards using easy to use frameworks that are opinionated enough to force people to not make certain mistakes (avoids mistakes by doing things right instead of letting inexperienced programmers do it).

Such platforms that presents concepts like DRY, convention over configuration and MVC to the newcomer, in a easy way, are doing a great job educating while being useful. Even following tutorials that do not explain shit about what's going on already does good by practicing those concepts blindly.

Another point is to use languages/frameworks that does most things for the user. Less code from inexperienced people equals less bugs.

For PHP frameworks, anything between CakePHP, CodeIgniter and Symphony are good choices (refer to http://www.phpframeworks.com and http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks for more tho)

Edit: All that said, I understand that the majority of times you don't have the choice to either adopt or not certain technologies (boss won't let, project already started, etc). But you can always try to make it happen next time (and there's always a next time).
Dream is destiny
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 11 2012 19:22 GMT
#34
On September 12 2012 04:05 13k wrote:
Coming from the Ruby community and seeing many noobs adopting Rails (kinda) successfully, I'd mostly advocate towards using easy to use frameworks that are opinionated enough to force people to not make certain mistakes (avoids mistakes by doing things right instead of letting inexperienced programmers do it).

Such platforms that presents concepts like DRY, convention over configuration and MVC to the newcomer, in a easy way, are doing a great job educating while being useful. Even following tutorials that do not explain shit about what's going on already does good by practicing those concepts blindly.

Another point is to use languages/frameworks that does most things for the user. Less code from inexperienced people equals less bugs.

For PHP frameworks, anything between CakePHP, CodeIgniter and Symphony are good choices (refer to http://www.phpframeworks.com and http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks for more tho)


Well, 6 month ago there were talks about our company using a framework for future projects.
Sadly, the head of the department doesn't trust frameworks "because they might have bugs that could be used by hackers" so we still haven't adapted any.

No, i'm not kidding.
PassiveAce
Profile Blog Joined February 2011
United States18076 Posts
September 11 2012 20:25 GMT
#35
You should write a letter about everything you think about the place and the people and tape it to your boss' door when you leave.
Call me Marge Simpson cuz I love you homie
13k
Profile Joined November 2009
Brazil16 Posts
Last Edited: 2012-09-12 10:39:46
September 12 2012 10:32 GMT
#36
On September 12 2012 04:22 Morfildur wrote:

Well, 6 month ago there were talks about our company using a framework for future projects.
Sadly, the head of the department doesn't trust frameworks "because they might have bugs that could be used by hackers" so we still haven't adapted any.

No, i'm not kidding.


oh man... that's so sad in so many levels. employing cheap developers that don't understand boolean logic or operator precedence, for example, is so, so much more dangerous... it's also costs so much more, given that you'll inevitably end up in the dreaded 20% feature / 80% bugfix cycle...

it would make sense if they are talking about paying thousands for licenses, but there are so many professional quality open source / free frameworks out there.

it really surprises me tho, that companies still don't use everything they can to ship as fast and as cheaply as possible... I sometimes thought companies were certainly profiting from open source frameworks and still not "paying back" anything in the form of contribution or sponsoring, etc... I guess I was wrong
Dream is destiny
zatic
Profile Blog Joined September 2007
Zurich15325 Posts
September 12 2012 13:15 GMT
#37
Frameworks are not the solution to shitty programmers though. The same guys will also implement the framework - and do just as much wrong as if they would code stuff themselves.

In the end, you just need able programmers, whether you code from scratch or implement based on a framework.
ModeratorI know Teamliquid is known as a massive building
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
September 12 2012 15:30 GMT
#38
On September 12 2012 19:32 13k wrote:
Show nested quote +
On September 12 2012 04:22 Morfildur wrote:

Well, 6 month ago there were talks about our company using a framework for future projects.
Sadly, the head of the department doesn't trust frameworks "because they might have bugs that could be used by hackers" so we still haven't adapted any.

No, i'm not kidding.


oh man... that's so sad in so many levels. employing cheap developers that don't understand boolean logic or operator precedence, for example, is so, so much more dangerous... it's also costs so much more, given that you'll inevitably end up in the dreaded 20% feature / 80% bugfix cycle...

it would make sense if they are talking about paying thousands for licenses, but there are so many professional quality open source / free frameworks out there.

it really surprises me tho, that companies still don't use everything they can to ship as fast and as cheaply as possible... I sometimes thought companies were certainly profiting from open source frameworks and still not "paying back" anything in the form of contribution or sponsoring, etc... I guess I was wrong

Can you type out that last paragraph again? I don't understand what you said.
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 61629
Profile Blog Joined March 2010
1664 Posts
September 12 2012 15:55 GMT
#39
--- Nuked ---
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2012-09-12 19:45:43
September 12 2012 19:42 GMT
#40
On September 13 2012 00:55 Inori wrote:
Show nested quote +
On September 12 2012 22:15 zatic wrote:
Frameworks are not the solution to shitty programmers though. The same guys will also implement the framework - and do just as much wrong as if they would code stuff themselves.

In the end, you just need able programmers, whether you code from scratch or implement based on a framework.

But they do teach best practices to those that are open to learning.

And worst case scenario with a framework you get semi-working semi-hackish code that at least on some levels is secure and bug-free as opposed to one big security hole, filled with spaghetti code hell that some newbie developers produce.

Some of the vulnerabilities in frameworks become well known whereas with self built code, you don't exactly know the vulnerabilities are. I'm mostly thinking of joomla as a cms because it's written as a framework, and yet it has addons that are vulnerabilities.

I think it's like how people build viruses for Windows.

Frameworks provide a lot of code that you don't have to write though and there are often addons or tutorials to do things in frameworks that are more standardized than starting from scratch. Do you ever find that frameworks are like black boxes though?
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 12 2012 22:10 GMT
#41
Yeah exactly, there is no security benefit from having stupid people using frameworks over stupid people writing their own code.

You'll have few well published vulnerabilities that won't get fixed over many unpublished vulnerabilities that won't get fixed. Pick your poison.
ModeratorI know Teamliquid is known as a massive building
Deleted User 61629
Profile Blog Joined March 2010
1664 Posts
Last Edited: 2012-09-13 11:32:00
September 13 2012 09:12 GMT
#42
--- Nuked ---
Wortie
Profile Joined September 2011
Netherlands212 Posts
Last Edited: 2012-09-13 10:11:32
September 13 2012 10:07 GMT
#43
I had some guys in school too. That wrote if(booleanvariable == true). That fucking makes me cringe. How the fuck can you mess up basic variables? I mean, they're basically the same ones for every language.

btw I'm in my second year of school. So if these guys finished their education they should know this kind of basic shit.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
September 13 2012 11:04 GMT
#44
I sometimes make mistakes like this due to weak fundamentals :/

But I can't understand why a debug step through won't catch errors like that. If you follow the code path, it's pretty hard to miss when you are inside a block when you shouldn't be.
Rillanon.au
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
September 13 2012 13:32 GMT
#45
On September 13 2012 18:12 Inori wrote:
Show nested quote +
On September 13 2012 04:42 obesechicken13 wrote:
On September 13 2012 00:55 Inori wrote:
On September 12 2012 22:15 zatic wrote:
Frameworks are not the solution to shitty programmers though. The same guys will also implement the framework - and do just as much wrong as if they would code stuff themselves.

In the end, you just need able programmers, whether you code from scratch or implement based on a framework.

But they do teach best practices to those that are open to learning.

And worst case scenario with a framework you get semi-working semi-hackish code that at least on some levels is secure and bug-free as opposed to one big security hole, filled with spaghetti code hell that some newbie developers produce.

Some of the vulnerabilities in frameworks become well known whereas with self built code, you don't exactly know the vulnerabilities are. I'm mostly thinking of joomla as a cms because it's written as a framework, and yet it has addons that are vulnerabilities.

I think it's like how people build viruses for Windows.

Frameworks provide a lot of code that you don't have to write though and there are often addons or tutorials to do things in frameworks that are more standardized than starting from scratch. Do you ever find that frameworks are like black boxes though?

Joomla is not a framework, Joomla is a Content Management System.
CMS is a finished product that is limited in extensibility.
Framework is a set of libraries you program the finished product on top of, nearly unlimited extensibility.
You can write sites like google.com, youtube.com, facebook.com with a framework. You can't with a CMS.
CMS: Joomla, Wordpress, Drupal
Framework: Symfony2, ZF2, Laravel

Apples and oranges.

I'm aware that it's not a framework but since it uses a model view control and has default directories and table structrres as well as names, I figure it'd be easier to at least know what's on the backend. So I think joomla as well as all cms, use a framework.

I'm not completely sure if CMS have anything like plugins or addons, but if they do then that's a security vulnerability through commonly used 3rd party code.

I've only dabbled a bit with rails and cakephp and by a bit I mean very little so may be wrong.
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 61629
Profile Blog Joined March 2010
1664 Posts
Last Edited: 2012-09-13 13:59:32
September 13 2012 13:56 GMT
#46
--- Nuked ---
zatic
Profile Blog Joined September 2007
Zurich15325 Posts
September 13 2012 14:05 GMT
#47
On September 13 2012 18:12 Inori wrote:
Show nested quote +
On September 13 2012 07:10 zatic wrote:
Yeah exactly, there is no security benefit from having stupid people using frameworks over stupid people writing their own code.

You'll have few well published vulnerabilities that won't get fixed over many unpublished vulnerabilities that won't get fixed. Pick your poison.

No security benefit?
Can't speak for all frameworks, but Symfony2 is secure from XSS, CSRF and SQL injection - 3 most common vulnerabilities, out of the box. By design it forces on a developer security best practices like not storing plaintext passwords, not outputting errors to users, hiding filesystem layout.

No offense, but claiming that there's no benefit to framework compared to own code on any level (and especially on security), even more so to a newbie developer, just means that you didn't look well enough into frameworks. I recommend you do, they're awesome.

I have looked into Symfony2 extensively actually. I like it a lot.

What I am saying is that any frame work can have vulnerabilities (and, stupid people are VERY creative in still doing stupid shit no matter what a frame work teaches them). And once they are published, there are immediately (possibly automated) exploits for them. The same stupid programmers that make stupid code will download their framework exactly once and never update it ever again. So, few published vulerabilities versus many unpublished ones.

It doesn't really matter if they mess up their own shitty code, or other people's code. In the end the stupid people are the problem.
ModeratorI know Teamliquid is known as a massive building
Deleted User 61629
Profile Blog Joined March 2010
1664 Posts
September 13 2012 14:19 GMT
#48
--- Nuked ---
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
September 13 2012 16:59 GMT
#49
On September 13 2012 22:56 Inori wrote:
Show nested quote +
On September 13 2012 22:32 obesechicken13 wrote:
On September 13 2012 18:12 Inori wrote:
On September 13 2012 04:42 obesechicken13 wrote:
On September 13 2012 00:55 Inori wrote:
On September 12 2012 22:15 zatic wrote:
Frameworks are not the solution to shitty programmers though. The same guys will also implement the framework - and do just as much wrong as if they would code stuff themselves.

In the end, you just need able programmers, whether you code from scratch or implement based on a framework.

But they do teach best practices to those that are open to learning.

And worst case scenario with a framework you get semi-working semi-hackish code that at least on some levels is secure and bug-free as opposed to one big security hole, filled with spaghetti code hell that some newbie developers produce.

Some of the vulnerabilities in frameworks become well known whereas with self built code, you don't exactly know the vulnerabilities are. I'm mostly thinking of joomla as a cms because it's written as a framework, and yet it has addons that are vulnerabilities.

I think it's like how people build viruses for Windows.

Frameworks provide a lot of code that you don't have to write though and there are often addons or tutorials to do things in frameworks that are more standardized than starting from scratch. Do you ever find that frameworks are like black boxes though?

Joomla is not a framework, Joomla is a Content Management System.
CMS is a finished product that is limited in extensibility.
Framework is a set of libraries you program the finished product on top of, nearly unlimited extensibility.
You can write sites like google.com, youtube.com, facebook.com with a framework. You can't with a CMS.
CMS: Joomla, Wordpress, Drupal
Framework: Symfony2, ZF2, Laravel

Apples and oranges.

I'm aware that it's not a framework but since it uses a model view control and has default directories and table structrres as well as names, I figure it'd be easier to at least know what's on the backend. So I think joomla as well as all cms, use a framework.

Literally LOL, that's the funniest thing I've heard in awhile. Joomla follows MVC? You can not be more wrong :D

Joomla has one of the worst code quality out of open-source solutions I know.
There's a reason why Joomla and Wordpress are often used by fanboys from other languages as an example on why they think PHP sucks and PHP developers are amateurs.

Can you elaborate? They don't follow MVC?

Sorry for the derail btw.
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 61629
Profile Blog Joined March 2010
1664 Posts
Last Edited: 2012-09-13 17:38:55
September 13 2012 17:36 GMT
#50
--- Nuked ---
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 20 2012 06:34 GMT
#51
I just stumbled over this function:


function dont_return_80($var)
{
return ($var != '80')?true:false;
}


I don't know what it's for, i actually don't even want to know, but i somehow find it funny...
BigFan
Profile Blog Joined December 2010
TLADT24920 Posts
September 20 2012 06:47 GMT
#52
On September 20 2012 15:34 Morfildur wrote:
I just stumbled over this function:


function dont_return_80($var)
{
return ($var != '80')?true:false;
}


I don't know what it's for, i actually don't even want to know, but i somehow find it funny...

Guessing it checks for a value of 80 and returns false if the variable var is 80? At least, that's what it looks like it does lol. I dunno what the program is about but I'm guessing there must be some input from the user and maybe some calculation? I'm totally guessing here lol.
Former BW EiC"Watch Bakemonogatari or I will kill you." -Toad, April 18th, 2017
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
September 20 2012 14:38 GMT
#53
On September 20 2012 15:47 BigFan wrote:
Show nested quote +
On September 20 2012 15:34 Morfildur wrote:
I just stumbled over this function:


function dont_return_80($var)
{
return ($var != '80')?true:false;
}


I don't know what it's for, i actually don't even want to know, but i somehow find it funny...

Guessing it checks for a value of 80 and returns false if the variable var is 80? At least, that's what it looks like it does lol. I dunno what the program is about but I'm guessing there must be some input from the user and maybe some calculation? I'm totally guessing here lol.

Doesn't it return true if it isn't 80?

Could just be a test function in production. Like you want to try something out but you don't know if it'll work right.
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.
Wortie
Profile Joined September 2011
Netherlands212 Posts
September 20 2012 18:04 GMT
#54
On September 20 2012 15:47 BigFan wrote:
Show nested quote +
On September 20 2012 15:34 Morfildur wrote:
I just stumbled over this function:


function dont_return_80($var)
{
return ($var != '80')?true:false;
}


I don't know what it's for, i actually don't even want to know, but i somehow find it funny...

Guessing it checks for a value of 80 and returns false if the variable var is 80? At least, that's what it looks like it does lol. I dunno what the program is about but I'm guessing there must be some input from the user and maybe some calculation? I'm totally guessing here lol.


No he checks if $var contains the string 80.... then it returns either true or false.

I don't actually know PHP, but I think you shouldn't add ' ' signs to variables if you want to store numbers in them rofl.

And even then, a fucking function to check if a variable is 80 is stupid too, because you can just do $var != 80 and it will do EXACTLY the same as this, without using a function.
BigFan
Profile Blog Joined December 2010
TLADT24920 Posts
September 21 2012 01:16 GMT
#55
^ I don't remember much from php so I just guessed that the variable is a number.

On September 20 2012 23:38 obesechicken13 wrote:
Show nested quote +
On September 20 2012 15:47 BigFan wrote:
On September 20 2012 15:34 Morfildur wrote:
I just stumbled over this function:


function dont_return_80($var)
{
return ($var != '80')?true:false;
}


I don't know what it's for, i actually don't even want to know, but i somehow find it funny...

Guessing it checks for a value of 80 and returns false if the variable var is 80? At least, that's what it looks like it does lol. I dunno what the program is about but I'm guessing there must be some input from the user and maybe some calculation? I'm totally guessing here lol.

Doesn't it return true if it isn't 80?

Could just be a test function in production. Like you want to try something out but you don't know if it'll work right.

Isn't that the same as what I wrote? lol.
Former BW EiC"Watch Bakemonogatari or I will kill you." -Toad, April 18th, 2017
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
September 21 2012 02:05 GMT
#56
On September 21 2012 10:16 BigFan wrote:
^ I don't remember much from php so I just guessed that the variable is a number.


Isn't that the same as what I wrote? lol.

On September 20 2012 23:38 obesechicken13 wrote:
Show nested quote +
On September 20 2012 15:47 BigFan wrote:
On September 20 2012 15:34 Morfildur wrote:
I just stumbled over this function:


function dont_return_80($var)
{
return ($var != '80')?true:false;
}


I don't know what it's for, i actually don't even want to know, but i somehow find it funny...

Guessing it checks for a value of 80 and returns false if the variable var is 80? At least, that's what it looks like it does lol. I dunno what the program is about but I'm guessing there must be some input from the user and maybe some calculation? I'm totally guessing here lol.

Doesn't it return true if it isn't 80?

Could just be a test function in production. Like you want to try something out but you don't know if it'll work right.
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.
Disregard
Profile Blog Joined March 2007
China10252 Posts
September 21 2012 04:07 GMT
#57
Not a programmer or have any experience with PHP but did a bit of basic Java coding, are they trying to use a string to represent a boolean operator?
"If I had to take a drug in order to be free, I'm screwed. Freedom exists in the mind, otherwise it doesn't exist."
Normal
Please log in or register to reply.
Live Events Refresh
SOOP Global
03:00
#21
Creator vs Rogue
Cure vs Classic
LaughNgamezSOOP
LiquipediaDiscussion
Replay Cast
00:00
Showmatches
Liquipedia
BSL: ProLeague
18:00
Bracket Stage: Day 1
StRyKeR vs MadiNho
Cross vs UltrA
TT1 vs JDConan
Bonyth vs Sziky
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft423
RuFF_SC2 184
StarCraft: Brood War
Britney 28631
soO 79
Sharp 77
Mind 16
Noble 12
Icarus 12
Bale 1
Dota 2
NeuroSwarm121
LuMiX1
League of Legends
JimRising 782
Counter-Strike
Stewie2K1754
Heroes of the Storm
Khaldor148
Other Games
summit1g6768
shahzam1390
WinterStarcraft232
ViBE226
Organizations
Other Games
gamesdonequick574
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• davetesta45
• practicex 29
• gosughost_ 13
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Doublelift5314
• Lourlo453
• Stunt157
Other Games
• Scarra903
Upcoming Events
SOOP
5h 24m
Classic vs GuMiho
Sparkling Tuna Cup
6h 24m
AllThingsProtoss
7h 24m
Fire Grow Cup
11h 24m
BSL: ProLeague
14h 24m
HBO vs Doodle
spx vs Tech
DragOn vs Hawk
Dewalt vs TerrOr
Replay Cast
20h 24m
Replay Cast
1d 20h
Replay Cast
2 days
WardiTV Invitational
2 days
WardiTV Invitational
2 days
[ Show More ]
GSL Code S
3 days
Rogue vs GuMiho
Maru vs Solar
Replay Cast
3 days
GSL Code S
4 days
herO vs TBD
Classic vs TBD
The PondCast
4 days
Replay Cast
4 days
GSL Code S
5 days
WardiTV Invitational
5 days
Korean StarCraft League
5 days
CranKy Ducklings
6 days
WardiTV Invitational
6 days
Cheesadelphia
6 days
Cheesadelphia
6 days
Liquipedia Results

Completed

CSL Season 17: Qualifier 1
BGE Stara Zagora 2025
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL Season 17: Qualifier 2
2025 GSL S2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
ECL Season 49: Europe
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025
BLAST Open Spring 2025

Upcoming

CSL 17: 2025 SUMMER
Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Murky Cup #2
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.