• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:51
CEST 14:51
KST 21:51
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL62Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event21Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays FEL Cracov 2025 (July 27) - $8000 live event Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Player “Jedi” cheat on CSL SC uni coach streams logging into betting site Flash Announces Hiatus From ASL Practice Partners (Official) ASL20 Preliminary Maps
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Summer Games Done Quick 2025! Trading/Investing Thread Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 624 users

The Big Programming Thread - Page 289

Forum Index > General Forum
Post a Reply
Prev 1 287 288 289 290 291 1031 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 States3696 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 States3696 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
Jollibee19343 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 States3696 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
Jollibee19343 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 1031 Next
Please log in or register to reply.
Live Events Refresh
WardiTV European League
12:00
Swiss Groups Day 2
WardiTV744
TKL 431
Liquipedia
FEL
12:00
Cracov 2025: Qualifier #2
IndyStarCraft 310
CranKy Ducklings79
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 431
IndyStarCraft 310
Rex 119
MindelVK 39
StarCraft: Brood War
Sea 11032
Calm 9514
Rain 7180
Bisu 2849
Horang2 2292
Hyuk 1365
Jaedong 1317
Shuttle 516
Rush 430
EffOrt 300
[ Show more ]
Stork 282
Leta 270
Last 240
PianO 210
Mini 206
ToSsGirL 156
Hyun 140
ZerO 95
Movie 79
hero 55
TY 53
Sea.KH 41
JYJ40
Killer 35
JulyZerg 29
ajuk12(nOOB) 22
HiyA 20
GoRush 19
Free 19
zelot 19
Terrorterran 18
Sacsri 17
Barracks 16
Icarus 6
ivOry 2
Stormgate
NightEnD21
Dota 2
qojqva3057
XcaliburYe452
canceldota102
League of Legends
singsing2904
Counter-Strike
x6flipin739
zeus453
Heroes of the Storm
Khaldor315
Other Games
Gorgc2822
B2W.Neo1375
DeMusliM540
Happy390
Fuzer 389
crisheroes369
Pyrionflax337
XaKoH 263
Hui .243
RotterdaM147
ArmadaUGS70
KnowMe60
ZerO(Twitch)17
Organizations
StarCraft: Brood War
CasterMuse 25
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 38
• iHatsuTV 6
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV749
• Ler42
Upcoming Events
BSL: ProLeague
5h 10m
Dewalt vs Bonyth
Replay Cast
1d 11h
Sparkling Tuna Cup
1d 21h
WardiTV European League
2 days
The PondCast
2 days
Replay Cast
3 days
RSL Revival
3 days
ByuN vs SHIN
Clem vs Reynor
Replay Cast
4 days
RSL Revival
4 days
Classic vs Cure
FEL
5 days
[ Show More ]
RSL Revival
5 days
FEL
5 days
FEL
6 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
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.