• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 08:56
CET 14:56
KST 22:56
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
ComeBackTV's documentary on Byun's Career ! Team TLMC #5: Winners Announced! What's the best tug of war? The Grack before Christmas Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies
Tourneys
OSC Season 13 World Championship $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BW General Discussion How soO Began His ProGaming Dreams Klaucher discontinued / in-game color settings BGH Auto Balance -> http://bghmmr.eu/ Recommended FPV games (post-KeSPA)
Tourneys
[BSL21] LB SemiFinals - Saturday 21:00 CET [BSL21] WB & LB Finals - Sunday 21:00 CET Small VOD Thread 2.0 [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Mechabellum Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile
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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
12 Days of Starcraft US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread How Does UI/UX Design Influence User Trust?
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1240 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
Next event in 6h 4m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Rex 159
LamboSC2 118
trigger 63
SKillous 39
StarCraft: Brood War
Britney 56752
Rain 2781
Jaedong 1984
Shuttle 1819
hero 441
ggaemo 369
firebathero 352
Hyuk 280
Rush 264
Larva 187
[ Show more ]
Last 156
Sharp 140
Mong 58
Movie 51
JYJ 28
Terrorterran 27
ToSsGirL 26
Rock 20
Sexy 14
JulyZerg 14
SilentControl 8
eros_byul 0
Dota 2
qojqva1983
XcaliburYe897
BananaSlamJamma259
Fuzer 238
febbydoto57
League of Legends
C9.Mang0359
Counter-Strike
allub280
Heroes of the Storm
Khaldor211
Other Games
Grubby6016
singsing2113
B2W.Neo1659
Hui .280
Lowko279
ArmadaUGS6
RushiSC6
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 61
• 3DClanTV 8
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2635
• Nemesis2043
Upcoming Events
BSL 21
6h 4m
Sziky vs eOnzErG
Sparkling Tuna Cup
20h 4m
Krystianer vs Classic
TriGGeR vs SKillous
Percival vs Ryung
ByuN vs Nicoract
OSC
1d 4h
BSL 21
1d 6h
Cross vs Dewalt
Replay Cast
1d 19h
Wardi Open
1d 22h
OSC
2 days
Solar vs MaxPax
ByuN vs Krystianer
Spirit vs TBD
OSC
5 days
Korean StarCraft League
6 days
OSC
6 days
Liquipedia Results

Completed

Escore Tournament S1 - W1
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL Season 21
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1 - W2
Escore Tournament S1 - W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 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.