• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:16
CET 16:16
KST 00:16
  • 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
ByuL: The Forgotten Master of ZvT23Behind the Blue - Team Liquid History Book16Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0225LiuLi Cup: 2025 Grand Finals (Feb 10-16)46Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker16
StarCraft 2
General
ByuL: The Forgotten Master of ZvT How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Nexon's StarCraft game could be FPS, led by UMS maker Weekly Cups (Feb 9-15): herO doubles up SpeCial on The Tasteless Podcast
Tourneys
How do the "codes" work in GSL? PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament LiuLi Cup: 2025 Grand Finals (Feb 10-16) Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
Mutation # 513 Attrition Warfare The PondCast: SC2 News & Results Mutation # 512 Overclocked Mutation # 511 Temple of Rebirth
Brood War
General
Tik Tok Parody about starcraft ACS replaced by "ASL Season Open" - Starts 21/02 Ladder maps - how we can make blizz update them? Liquipedia.net NEEDS editors for Brood War Gypsy to Korea
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates Zealot bombing is no longer popular? Current Meta
Other Games
General Games
Nintendo Switch Thread ZeroSpace Megathread Path of Exile Diablo 2 thread Battle Aces/David Kim RTS Megathread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Canadian Politics Mega-thread Russo-Ukrainian War Thread Ask and answer stupid questions here! Things Aren’t Peaceful in Palestine
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
Inside the Communication of …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1681 users

The Big Programming Thread - Page 289

Forum Index > General Forum
Post a Reply
Prev 1 287 288 289 290 291 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
tec27
Profile Blog Joined June 2004
United States3702 Posts
Last Edited: 2013-04-24 03:14:56
April 24 2013 03:14 GMT
#5761
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?

HTML is very easy, and it doesn't make sense to learn PHP without some knowledge of it. But it really shouldn't take you long at all to get your bearings, its just a language for structuring content so it doesn't have the complexity of an actual programming language (CSS, however, has some weirdness that programmers often have trouble understanding, but you won't really need to delve into that at the very beginning).
Can you jam with the console cowboys in cyberspace?
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
Last Edited: 2013-04-24 05:22:43
April 24 2013 05:22 GMT
#5762
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?

HTML can be learned in a few minutes if you have a good resource. It's very simple. PHP is an actual programming language and is a lot more complex, and you'll need to know html before you can actually use it much. You can learn the two fairly well in a summer in my opinion.
FFGenerations
Profile Blog Joined April 2011
7088 Posts
April 24 2013 08:33 GMT
#5763
hey, i have to rush off now, but perhaps one of you would fancy answering a question?

i am printing contents of my product table to a webpage (menu of food items)

my tutor used While to do this but i dont really know why, or why you cant use Foreach

i dont need a 100% answer, just a very general answer would be sufficient for me to see how my understanding lacks (i am total beginner). something like "they both work completely different and you need to study up on them properly to know why and how"

+ Show Spoiler +



<?php

$connection = mysql_connect("localhost", "jon1", "password");

mysql_select_db("takeaway");

$result = mysql_query("SELECT * FROM products");

while($row = mysql_fetch_array($result))
{

echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}

foreach($row = mysql_fetch_array($result))
{
echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}


?>


(the foreach doesnt work fyi. i have to fuck off now for 2 hours but will be back to have another look)
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2013-04-24 08:58:28
April 24 2013 08:55 GMT
#5764
I never really understood what is "learning HTML". Like, it's a markup language, some way to structure data, in order to be visually represented, and only that. There isn't much to do with it or be understood, unless you delve into some advanced stuff.
What you should learn is the full combo "HTML + Javascript + CSS" or "HTML + PHP". You mainly have to learn a language that can use or produce HTML, otherwise it's pretty pointless.
tec27
Profile Blog Joined June 2004
United States3702 Posts
Last Edited: 2013-04-24 08:57:37
April 24 2013 08:55 GMT
#5765
On April 24 2013 17:33 FFGenerations wrote:
hey, i have to rush off now, but perhaps one of you would fancy answering a question?

i am printing contents of my product table to a webpage (menu of food items)

my tutor used While to do this but i dont really know why, or why you cant use Foreach

i dont need a 100% answer, just a very general answer would be sufficient for me to see how my understanding lacks (i am total beginner). something like "they both work completely different and you need to study up on them properly to know why and how"

+ Show Spoiler +



<?php

$connection = mysql_connect("localhost", "jon1", "password");

mysql_select_db("takeaway");

$result = mysql_query("SELECT * FROM products");

while($row = mysql_fetch_array($result))
{

echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}

foreach($row = mysql_fetch_array($result))
{
echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}


?>


(the foreach doesnt work fyi. i have to fuck off now for 2 hours but will be back to have another look)

Firstly, quit using the mysql library, its awful and deprecated. Use mysqli or PDO instead.

Secondly, you can't use foreach here because you don't actually have an array, all you have is a single function return value (which is a single row, although it is an array of *columns*). mysql_fetch_array returns 1 row at a time, and with the while loop version you're calling it over and over again as long as it returns a non-falsy value (so you iterate over all the rows).

Foreach however, instead of evaluating a condition each time, will loop through an array or an iterator. Since all you have here is one row, that clearly won't do what you want. You could, however, construct an Iterator class that makes calls to mysql_fetch_array() to iterate, and then you could get this syntax. Before you run off and do that though, just stop using the mysql functions and move to mysqli, where the result type already implements Iterator and can do this.
Can you jam with the console cowboys in cyberspace?
Rixxe
Profile Joined July 2011
United Kingdom136 Posts
Last Edited: 2013-04-24 08:59:31
April 24 2013 08:58 GMT
#5766
On April 24 2013 17:33 FFGenerations wrote:
hey, i have to rush off now, but perhaps one of you would fancy answering a question?

i am printing contents of my product table to a webpage (menu of food items)

my tutor used While to do this but i dont really know why, or why you cant use Foreach

i dont need a 100% answer, just a very general answer would be sufficient for me to see how my understanding lacks (i am total beginner). something like "they both work completely different and you need to study up on them properly to know why and how"

+ Show Spoiler +



<?php

$connection = mysql_connect("localhost", "jon1", "password");

mysql_select_db("takeaway");

$result = mysql_query("SELECT * FROM products");

while($row = mysql_fetch_array($result))
{

echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}

foreach($row = mysql_fetch_array($result))
{
echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}


?>


(the foreach doesnt work fyi. i have to fuck off now for 2 hours but will be back to have another look)


Generally you can make them do the same thing in the end (not 100% sure with php) however:

One of them is a general purpose loop with pre-condition and another is a dedicated loop operator to loop over ARRAYS.

In general i prefer to use Foreach, purely because i think it produces less bugs and issues, and for me is easier to read when looking through a mass of code.
*bleep* you up in a gangsta style!
Yoshi-
Profile Joined October 2008
Germany10227 Posts
Last Edited: 2013-04-24 09:07:42
April 24 2013 09:05 GMT
#5767
This is because foreach works completely different than while.
Foreach takes an array an iteriates over it.
e.g.:

<?php
$array = array("key1" => "value1",
"key2" => "value2",
"key3" => "value3",
"key4" => "value4",
"key5" => "value5"
);

foreach ($array as $key => $value) {
echo $key . " = " . $value. '\n';
}

Will result in:

key1 = value1
key2 = value2
....

So it loops through the array an execute the code for each element.

While however loops as long as the statement in between the "( )" is true, and than executes the code everytime.

The reason why you cannot use foreach in that case is, that if you have mutiple rows in your Mysql Table the mysql_fetch_* functions will only give you one row, and than put the pointer to the next row.
If mysql_fetch_array, gets called it will give you the first and than move on to the second.
If you call it again it will give you the second row and move the pointer to the third.
To get every row you need to repeat that for every row in your table, and if there are no more rows avaiable mysql_fetch_array will return "false".

The easiest way to do this is witj a while function, like in your example, after every iteration $row, will have a new content and the loop will run until you run out of rows(mysql_fetch_array returns false).

This only works with while(well you could make it work with foreach, but that would be retarded).


On April 24 2013 17:58 Rixxe wrote:

Generally you can make them do the same thing in the end (not 100% sure with php) however:

One of them is a general purpose loop with pre-condition and another is a dedicated loop operator to loop over ARRAYS.

In general i prefer to use Foreach, purely because i think it produces less bugs and issues, and for me is easier to read when looking through a mass of code.

You cannot say that one is better than the other, as they have quite different purposes.
FFGenerations
Profile Blog Joined April 2011
7088 Posts
Last Edited: 2013-04-24 10:17:28
April 24 2013 10:15 GMT
#5768
wow thanks, thats just what i wanted to hear. theres so much you dont learn in a class, they give you the code and say "this is how you do it", then you get an assignment in which you copy/paste what you've done in class.

thankfully this is my last assignment for a while (excluding the CCNA, which you can also copy/paste directly off the internet to get a good grade in), as soon as i get it out the way im going to start a proper C++ book/tutorial.

never heard of mysqli - and how would i!? one thing at a time, let me get this submitted with a top grade based on the requirements (which are "paste what you done in class and screenshot it 100 times") then i can start from scratch in detail
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
April 24 2013 10:21 GMT
#5769
On April 24 2013 19:15 FFGenerations wrote:
wow thanks, thats just what i wanted to hear. theres so much you dont learn in a class, they give you the code and say "this is how you do it", then you get an assignment in which you copy/paste what you've done in class.

thankfully this is my last assignment for a while (excluding the CCNA, which you can also copy/paste directly off the internet to get a good grade in), as soon as i get it out the way im going to start a proper C++ book/tutorial.

never heard of mysqli - and how would i!? one thing at a time, let me get this submitted with a top grade based on the requirements (which are "paste what you done in class and screenshot it 100 times") then i can start from scratch in detail

You should hit me up for the C++ stuff
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
April 24 2013 10:33 GMT
#5770
On April 24 2013 19:21 CecilSunkure wrote:
Show nested quote +
On April 24 2013 19:15 FFGenerations wrote:
wow thanks, thats just what i wanted to hear. theres so much you dont learn in a class, they give you the code and say "this is how you do it", then you get an assignment in which you copy/paste what you've done in class.

thankfully this is my last assignment for a while (excluding the CCNA, which you can also copy/paste directly off the internet to get a good grade in), as soon as i get it out the way im going to start a proper C++ book/tutorial.

never heard of mysqli - and how would i!? one thing at a time, let me get this submitted with a top grade based on the requirements (which are "paste what you done in class and screenshot it 100 times") then i can start from scratch in detail

You should hit me up for the C++ stuff

i second this. you should even read his blogs. very easy to understand
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
FFGenerations
Profile Blog Joined April 2011
7088 Posts
April 24 2013 10:38 GMT
#5771
nice, ok;)
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
April 24 2013 10:53 GMT
#5772
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?


www.codecademy.com, there you can learn both!
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
April 24 2013 14:17 GMT
#5773
On April 24 2013 09:12 HadeCiao wrote:
I wanted to share my programming experience with you. I have always been fascinated about computers and algorithms. 1 year ago I downloaded logism, a logic circuit simulator. I wanted to understand computers from scratch. I finnaly was able to build a very small cpu and also a simple assembly language in which I could write pong.

Just recently I could afford more time to spend on learning how computers work. I have been reading now and then (also in this thread) about programming, As far as I knew Java, C and Basic are the most basic and common languages and Basic seemed to be ideal for a beginner like me. After watching a few tutorials, I started with pong then snake and tretris. Finnaly I ended up programming a metroid clone within the last 4 weeks.

The programming process itsself was great, i spend nights and nights solving those little problems and improving the game on a constant basis. After showing the game to a few friends I was suggested to give it a try and uploaded it to steam greenlight. The reactions are quite negative mainly due to the cheap graphics. However I am an aweful painter and now I am stuck a little. Need to calm down a few days :D However I do not regret anything and I want to give a shout how great and fun programming is.

Here is the promotion vid for those who are interested.

This looks pretty cool.
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.
tec27
Profile Blog Joined June 2004
United States3702 Posts
April 25 2013 05:35 GMT
#5774
On April 24 2013 19:15 FFGenerations wrote:
never heard of mysqli - and how would i!? one thing at a time, let me get this submitted with a top grade based on the requirements (which are "paste what you done in class and screenshot it 100 times") then i can start from scratch in detail

Well, its quite simple to hear of it. Any time you go to the documentation for the mysql crap on the php site, they have a nice big warning bar telling you not to use it and to use mysqli instead, e.g.: http://www.php.net/manual/en/function.mysql-result.php

If your class is focused on copying and pasting, you should immediately stop going to that class and do something useful with your time instead.
Can you jam with the console cowboys in cyberspace?
billy5000
Profile Blog Joined December 2010
United States865 Posts
Last Edited: 2013-04-25 09:49:26
April 25 2013 08:11 GMT
#5775
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?


Any reason why you want to learn php?

I'm not here to criticize--I'm fairly new to web development myself (getting the hang of play framework atm)--but I'm just wondering what made you choose php over other popular frameworks, such as rails and django.

I for one chose play because I was learning scala on the side. Thought it would be a good idea to do something with what I've learned. I also have a project in mind.

Note: I know it's wrong to consider php a web framework, but you know what I mean . I'm just not familiar with any popular php frameworks.
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2013-04-25 10:35:28
April 25 2013 10:29 GMT
#5776
On April 25 2013 17:11 billy5000 wrote:
Show nested quote +
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?


Any reason why you want to learn php?

I'm not here to criticize--I'm fairly new to web development myself (getting the hang of play framework atm)--but I'm just wondering what made you choose php over other popular frameworks, such as rails and django.

I for one chose play because I was learning scala on the side. Thought it would be a good idea to do something with what I've learned. I also have a project in mind.

Note: I know it's wrong to consider php a web framework, but you know what I mean . I'm just not familiar with any popular php frameworks.


There is one reason why PHP is a common choice to learn:
It's what everyone uses, so it provides the best job opportunities.

Yes, it's a horrible language and i don't like it but if you look at it from a real-world perspective, making code look pretty doesn't matter, results matter. That is what PHP has: Results.

I recommend to read PHP Sucks, But It Doesn't Matter from the blog of Jeff Atwood who explains it better than i can.

PHP, Python, Ruby, Scala, the choice of language doesn't matter in the end, only results do. Bad coders write bad code in every language.

On April 24 2013 17:55 tec27 wrote:
Show nested quote +
On April 24 2013 17:33 FFGenerations wrote:
hey, i have to rush off now, but perhaps one of you would fancy answering a question?

i am printing contents of my product table to a webpage (menu of food items)

my tutor used While to do this but i dont really know why, or why you cant use Foreach

i dont need a 100% answer, just a very general answer would be sufficient for me to see how my understanding lacks (i am total beginner). something like "they both work completely different and you need to study up on them properly to know why and how"

+ Show Spoiler +



<?php

$connection = mysql_connect("localhost", "jon1", "password");

mysql_select_db("takeaway");

$result = mysql_query("SELECT * FROM products");

while($row = mysql_fetch_array($result))
{

echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}

foreach($row = mysql_fetch_array($result))
{
echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}


?>


(the foreach doesnt work fyi. i have to fuck off now for 2 hours but will be back to have another look)

Firstly, quit using the mysql library, its awful and deprecated. Use mysqli or PDO instead.

***snip***


I wholeheartedly agree. PDO is so much better than the standard mysql_* functions and only a tiny bit more complex. Coming originally from Perl with it's DBI library, it feels a lot more natural to me as well. Anyone who still uses mysql_* deserves a strong kick in the lower body region.
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
April 25 2013 10:39 GMT
#5777
On April 25 2013 19:29 Morfildur wrote:
There is one reason why PHP is a common choice to learn:
It's what everyone uses, so it provides the best job opportunities.

Yes, it's a horrible language and i don't like it but if you look at it from a real-world perspective, making code look pretty doesn't matter, results matter. That is what PHP has: Results.

I recommend to read PHP Sucks, But It Doesn't Matter from the blog of Jeff Atwood who explains it better than i can.

PHP, Python, Ruby, Scala, the choice of language doesn't matter in the end, only results do. Bad coders write bad code in every language.

It certainly provides the most job opportunities, but the best ones? I read an article several years back showing that Ruby web developers on average made quite a bit more money than PHP developers.

Obviously, PHP is still worth learning if you want a lot of opportunities, but I think the trend is to move away from PHP and there's far more opportunities now in other languages... and finding a job in pretty much any discipline shouldn't be a huge issue, it's more dependant on what you want to work with... Ruby for innovative upstarts, ASP/JSP are probably also very easy to find work in as part of bigger companies.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
April 25 2013 11:02 GMT
#5778
On April 25 2013 19:39 Tobberoth wrote:
Show nested quote +
On April 25 2013 19:29 Morfildur wrote:
There is one reason why PHP is a common choice to learn:
It's what everyone uses, so it provides the best job opportunities.

Yes, it's a horrible language and i don't like it but if you look at it from a real-world perspective, making code look pretty doesn't matter, results matter. That is what PHP has: Results.

I recommend to read PHP Sucks, But It Doesn't Matter from the blog of Jeff Atwood who explains it better than i can.

PHP, Python, Ruby, Scala, the choice of language doesn't matter in the end, only results do. Bad coders write bad code in every language.

It certainly provides the most job opportunities, but the best ones? I read an article several years back showing that Ruby web developers on average made quite a bit more money than PHP developers.

Obviously, PHP is still worth learning if you want a lot of opportunities, but I think the trend is to move away from PHP and there's far more opportunities now in other languages... and finding a job in pretty much any discipline shouldn't be a huge issue, it's more dependant on what you want to work with... Ruby for innovative upstarts, ASP/JSP are probably also very easy to find work in as part of bigger companies.


Average salary is a very wierd statistic since it only shows half the picture.

Ruby developers might earn more on average but that is because most of them are experienced programmers working in a company that is financially secure enough to take a risk with the language, so they have the freedom to pay more.

The huge amount of novice PHP programmers in low paying startups pulls the average salary down a lot. Good PHP programmers will earn as much as good Ruby programmers in the same context.

While there are jobs for all languages, the amount of PHP jobs is still higher than that of any other web language, especially for novice programmers. Experienced programmers will program in any language anyways, so they don't have to care about that.
mcc
Profile Joined October 2010
Czech Republic4646 Posts
April 25 2013 12:20 GMT
#5779
On April 25 2013 19:29 Morfildur wrote:
Show nested quote +
On April 25 2013 17:11 billy5000 wrote:
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?


Any reason why you want to learn php?

I'm not here to criticize--I'm fairly new to web development myself (getting the hang of play framework atm)--but I'm just wondering what made you choose php over other popular frameworks, such as rails and django.

I for one chose play because I was learning scala on the side. Thought it would be a good idea to do something with what I've learned. I also have a project in mind.

Note: I know it's wrong to consider php a web framework, but you know what I mean . I'm just not familiar with any popular php frameworks.


There is one reason why PHP is a common choice to learn:
It's what everyone uses, so it provides the best job opportunities.

Yes, it's a horrible language and i don't like it but if you look at it from a real-world perspective, making code look pretty doesn't matter, results matter. That is what PHP has: Results.

I recommend to read PHP Sucks, But It Doesn't Matter from the blog of Jeff Atwood who explains it better than i can.

PHP, Python, Ruby, Scala, the choice of language doesn't matter in the end, only results do. Bad coders write bad code in every language.

Show nested quote +
On April 24 2013 17:55 tec27 wrote:
On April 24 2013 17:33 FFGenerations wrote:
hey, i have to rush off now, but perhaps one of you would fancy answering a question?

i am printing contents of my product table to a webpage (menu of food items)

my tutor used While to do this but i dont really know why, or why you cant use Foreach

i dont need a 100% answer, just a very general answer would be sufficient for me to see how my understanding lacks (i am total beginner). something like "they both work completely different and you need to study up on them properly to know why and how"

+ Show Spoiler +



<?php

$connection = mysql_connect("localhost", "jon1", "password");

mysql_select_db("takeaway");

$result = mysql_query("SELECT * FROM products");

while($row = mysql_fetch_array($result))
{

echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}

foreach($row = mysql_fetch_array($result))
{
echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}


?>


(the foreach doesnt work fyi. i have to fuck off now for 2 hours but will be back to have another look)

Firstly, quit using the mysql library, its awful and deprecated. Use mysqli or PDO instead.

***snip***


I wholeheartedly agree. PDO is so much better than the standard mysql_* functions and only a tiny bit more complex. Coming originally from Perl with it's DBI library, it feels a lot more natural to me as well. Anyone who still uses mysql_* deserves a strong kick in the lower body region.

I disagree with such generalized statement as "bad coders write bad code in any language". Quality of code is not binary measure. And languages influence how bad the code can get. Plus all programmers write bad code to some degree, good language helps you avoid some of that. Bad code is unavoidable, if language can prevent some of it, that language is better. Of course there is balance to be had between how much language constricts you without actually preventing you to use useful techniques.

PHP is terrible language and it matters (even though not to some very big degree). But which languages are used is not based on quality or even pure usefulness of the language, but on factors independent of the language itself (libraries, frameworks, community, support, ...). Basically PHP has results, because it is popular, simple feedback loop.

That is not to discourage someone from learning PHP, but if they are not pressed to start with it by necessity of earning money or something, it is not ideal first language, not even for creating web pages.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
April 25 2013 12:32 GMT
#5780
On April 25 2013 21:20 mcc wrote:
Show nested quote +
On April 25 2013 19:29 Morfildur wrote:
On April 25 2013 17:11 billy5000 wrote:
On April 24 2013 11:51 white_horse wrote:
Is it possible to teach yourself HTML and be pretty good at it? I'm planning on studying intensively on my own this summer.

Also, should I learn HTML first or PHP, or should I study both at the same time?


Any reason why you want to learn php?

I'm not here to criticize--I'm fairly new to web development myself (getting the hang of play framework atm)--but I'm just wondering what made you choose php over other popular frameworks, such as rails and django.

I for one chose play because I was learning scala on the side. Thought it would be a good idea to do something with what I've learned. I also have a project in mind.

Note: I know it's wrong to consider php a web framework, but you know what I mean . I'm just not familiar with any popular php frameworks.


There is one reason why PHP is a common choice to learn:
It's what everyone uses, so it provides the best job opportunities.

Yes, it's a horrible language and i don't like it but if you look at it from a real-world perspective, making code look pretty doesn't matter, results matter. That is what PHP has: Results.

I recommend to read PHP Sucks, But It Doesn't Matter from the blog of Jeff Atwood who explains it better than i can.

PHP, Python, Ruby, Scala, the choice of language doesn't matter in the end, only results do. Bad coders write bad code in every language.

On April 24 2013 17:55 tec27 wrote:
On April 24 2013 17:33 FFGenerations wrote:
hey, i have to rush off now, but perhaps one of you would fancy answering a question?

i am printing contents of my product table to a webpage (menu of food items)

my tutor used While to do this but i dont really know why, or why you cant use Foreach

i dont need a 100% answer, just a very general answer would be sufficient for me to see how my understanding lacks (i am total beginner). something like "they both work completely different and you need to study up on them properly to know why and how"

+ Show Spoiler +



<?php

$connection = mysql_connect("localhost", "jon1", "password");

mysql_select_db("takeaway");

$result = mysql_query("SELECT * FROM products");

while($row = mysql_fetch_array($result))
{

echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}

foreach($row = mysql_fetch_array($result))
{
echo "<strong>Name:</strong> " . $row["productname"] . "<br />";

echo "<a href='item.php?productid=" . $row["productid"] . "'>Details</a><br/>";
}


?>


(the foreach doesnt work fyi. i have to fuck off now for 2 hours but will be back to have another look)

Firstly, quit using the mysql library, its awful and deprecated. Use mysqli or PDO instead.

***snip***


I wholeheartedly agree. PDO is so much better than the standard mysql_* functions and only a tiny bit more complex. Coming originally from Perl with it's DBI library, it feels a lot more natural to me as well. Anyone who still uses mysql_* deserves a strong kick in the lower body region.

I disagree with such generalized statement as "bad coders write bad code in any language". Quality of code is not binary measure. And languages influence how bad the code can get. Plus all programmers write bad code to some degree, good language helps you avoid some of that. Bad code is unavoidable, if language can prevent some of it, that language is better. Of course there is balance to be had between how much language constricts you without actually preventing you to use useful techniques.

PHP is terrible language and it matters (even though not to some very big degree). But which languages are used is not based on quality or even pure usefulness of the language, but on factors independent of the language itself (libraries, frameworks, community, support, ...). Basically PHP has results, because it is popular, simple feedback loop.

That is not to discourage someone from learning PHP, but if they are not pressed to start with it by necessity of earning money or something, it is not ideal first language, not even for creating web pages.


out of curiosity, what is ideal in creating web pages?
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Prev 1 287 288 289 290 291 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
12:00
King of the Hill #238
iHatsuTV 17
Liquipedia
WardiTV Winter Champion…
12:00
Group B
WardiTV1300
IndyStarCraft 278
3DClanTV 66
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 278
ProTech133
Vindicta 38
StarCraft: Brood War
Britney 34141
Horang2 5023
Hyuk 1811
GuemChi 1419
firebathero 1154
Sea 1127
Shuttle 849
ZerO 772
Larva 674
EffOrt 559
[ Show more ]
Stork 404
BeSt 319
Mini 305
Snow 288
ggaemo 155
Rush 146
hero 141
Hyun 102
Soulkey 94
Mong 93
Pusan 82
Barracks 65
JYJ 44
Mind 39
sSak 39
Hm[arnc] 38
JulyZerg 38
yabsab 38
Movie 27
Free 22
GoRush 22
scan(afreeca) 20
sorry 20
Terrorterran 19
910 16
Yoon 15
Bale 13
Rock 13
Dota 2
Gorgc5458
Dendi524
XcaliburYe82
qojqva30
Counter-Strike
markeloff171
edward120
Heroes of the Storm
Khaldor188
Other Games
singsing2740
B2W.Neo589
DeMusliM355
Lowko292
crisheroes241
Hui .152
Sick131
XaKoH 126
QueenE105
Mew2King82
KnowMe35
ArmadaUGS32
Trikslyr31
Chillindude14
ZerO(Twitch)10
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• LUISG 7
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis6662
• Jankos2387
• TFBlade891
Upcoming Events
Replay Cast
8h 44m
PiG Sty Festival
17h 44m
Clem vs Percival
Zoun vs Solar
Escore
18h 44m
Epic.LAN
20h 44m
Replay Cast
1d 8h
PiG Sty Festival
1d 17h
herO vs NightMare
Reynor vs Cure
CranKy Ducklings
1d 18h
Epic.LAN
1d 20h
Replay Cast
2 days
PiG Sty Festival
2 days
Serral vs YoungYakov
ByuN vs ShoWTimE
[ Show More ]
Sparkling Tuna Cup
2 days
Replay Cast
3 days
Replay Cast
3 days
Wardi Open
3 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV Winter Champion…
4 days
WardiTV Winter Champion…
5 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2026-02-18
LiuLi Cup: 2025 Grand Finals
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
WardiTV Winter 2026
PiG Sty Festival 7.0
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

Escore Tournament S1: King of Kings
[S:21] ASL SEASON OPEN 1st Round
[S:21] ASL SEASON OPEN 1st Round Qualifier
Acropolis #4 - TS5
Jeongseon Sooper Cup
Spring Cup 2026: China & Korea Invitational
[S:21] ASL SEASON OPEN 2nd Round
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
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 © 2026 TLnet. All Rights Reserved.