Which language?

Associate
Joined
13 May 2004
Posts
1,491
Location
Wales, Wrexham
Good day everyone, a few random questions to ask you all, back when i was in college two or so years ago, i was doing a computer programming course, where i learned just past the basics of VB / Java - and of course the fundamentals of programming, variables, arrays and so on.

The problem is, since then only that very basic knowledge remains, none of the syntax for either language etc, and i really want to get into the business path of computer programming if at all possible, and am asking for your advice on which language you think i should pursue, or even start from scratch?

So far i'm thinking perhaps web development would be a better route to follow, although ideally application programming is where i would like to end up eventually.

My brother is a very talented graphics designer, and could help me as far as website layouts and such are concerned - so as a starting point, this is why i mentioned web development, it would be a tremendous help to his business if he could sell pre-coded web pages / templates, and a huge boost to my experience by doing so.

Would you advise i start with the likes of PHP?

I will probably stick to either the cheapest, or freeware compilers for the time being - as i do not want to commit one hundred percent, i simply want a poke in the right direction.

Which language will be the biggest stepping stone into both;

a) Learning further languages
b) Employment

I already have a job currently, and learning either of these languages will be a project of a few hours a night.

Thanks for reading, i look forward to your advice.
 
For smaller scale web development work = PHP/MySQL
For larger scale projects = .NET i.e. asp.net

Thats about as simple as I can put it really. Im sure other opinions will differ though.
 
Hello,

Coming from a background of being self-taught in both ASP and PHP I recommend either of them to you in terms of what you will get out of them. Both have their similarities, yet both have subtle differences which offer advantages and disadvantages.

You can't go wrong with either language for setting up on a local machine, installing Apache server (PHP) is free and as long as you have XP Pro you can install and run IIS (ASP). You can't have both running at the same time mind, if you want both installed one will have to be stopped while the other is running (Administration > Services for IIS). Setting up on the Internet, PHP will be cheaper as it's Linux web hosting whereas ASP will be on a Windows platform.

I find it interesting you said you wished to head into application programming, why is this? Web interfaces are extremely powerful tools in the modern world and there are many great jobs which someone with a wide variety of web design skills can pick up easily.

For me, if I were pushed, I would say start with PHP. It's what I did and then picked up ASP as I went along.
 
As stupid as it will sound, with the limited knowledge i have now i have always thought application programming would be more interesting, although thinking about it a little further - disregarding the power of each possible language, web design probably has more use.

The only comparrison i have is Visual Basic to the likes of HTML though, which is a pretty pathetic comparrisson to satrt with!

I have a question for you regarding PHP then while you are around, i've been reading a book i've had lying around, and one of the excercises is to create two variables, then using comparisson operatives i have to output whether the statement is true or not? If that makes sense... I've read the page a few times and still cant grasp it.

<?php
$integera = 5;
$integerb = 3;

print integera == integerb;
?>

Perhaps its a simple fix, i've tried using inverted comma's everywhere, tried creating a third variable to assign the answer to and print that, but it outputs a blank page.

So far i'm confused, all the past things i have programmed (i.e. VB) i have assigned the variable type as well as the value, obviously 5 and 3 are integers, and when i created the third variable it would be a boolean.

Please help, so i can continue! haha :)
 
I have a question for you regarding PHP then while you are around, i've been reading a book i've had lying around, and one of the excercises is to create two variables, then using comparisson operatives i have to output whether the statement is true or not? If that makes sense... I've read the page a few times and still cant grasp it.

<?php
$integera = 5;
$integerb = 3;

print integera == integerb;
?>

Perhaps its a simple fix, i've tried using inverted comma's everywhere, tried creating a third variable to assign the answer to and print that, but it outputs a blank page.

So far i'm confused, all the past things i have programmed (i.e. VB) i have assigned the variable type as well as the value, obviously 5 and 3 are integers, and when i created the third variable it would be a boolean.

Please help, so i can continue! haha :)

Code:
<?php
$integera = 5;
$integerb = 3;

print $integera == $integerb;
?>

Maybe due to leaving out the $ symbols? Not sure what you are trying to do with the == though
 
Its just a simple excercise in the book, i need to compare the two integers, and == can be replaced with <= or => or whatver, it just needs to say if 5 is equal to 3, which it isnt - so i want it to print false (i.e. a boolean value)

I have included the $ signs on the actual code, i just forgot when repeating it here, sorry :)
 
It's printing nothing because the statement is false it's essentially executing "print false;" which in PHP won't output anything, if both 'integera' and 'integerb' were equal it would output 1.

If you wanted to actually print the boolean value you could use a ternary operator...

Code:
<?php
$integera = 5;
$integerb = 3;

print $integera == $integerb ? 'true' : 'false';
?>

Hope that's what you mean. That isn't necessarily the best way to do it though, there are various other ways i.e var_dump($integera == $integerb), I haven't used PHP for quite some time so I don't know what people would consider the 'best' way.
 
Last edited:
Perfect, thank you very much - i understand that now... it makes sense at least!

Wont be the last you hear of me i'm sure, but so far so good, i can continue :)

How long would you say it takes to learn PHP to an acceptable level, if i was to spend a few hours a night on it? And what are the best ways to practice?
 
Perfect, thank you very much - i understand that now... it makes sense at least!

Wont be the last you hear of me i'm sure, but so far so good, i can continue :)

How long would you say it takes to learn PHP to an acceptable level, if i was to spend a few hours a night on it? And what are the best ways to practice?

It depends what you mean by an acceptable level, if you just want to create personal websites with a bit of content loaded from a database then not very long at all, maybe a month or so. if you want to develop large web applications based on MVC etc then you're probably looking at a year or two. It's not about remembering every function, cause you'll always have the docs available as a reference, it's more about discovering ways to approach certain recurring problems.

As with most things, the best way to learn is to have some project in mind, and work towards achieving it with your chosen tool. Think of something useful you could use (maybe a database for recording the media you own?) and you're a lot less likely to get bored half way through.
 
Any books you could reccommend for someone in my position on PHP? I'll go into the book shop in town for lunch today and see if they have any of the reccommended ones in stock.

A decent book with perhaps things to work through would be very handy indeed, i find it hard to read internet tutorials / ebooks and program at the same time, i could always print them out... but hey!

Thanks for the advice so far, i'm looking forward to expanding my knowledge on the subject :)
 
The Wrox series of books (red covers) are pretty good. I have:

Beginning PHP5, Apache, and MySQL Web Development (Programmer to Programmer)
ISBN: 0764579665 / 978-0764579660
 
SQL
ASP.NET using C#
Agreed. It's expensive, but well worth the money. I wouldn't touch any other language with a barge poll these days, despite coming from a java/php/c++ background. I use Oracle PL/SQL at work now, but MS SQL Server 2005 isn't far off. There are far more jobs using MS SQL Server/TSQL, but you tend to get paid money with good Oracle knowledge.
 
Last edited:
Thanks again for the advice so far, i've ordered that book TomWilko :)

I want to ask a simple question now, as i figure its better than making a new thread! I'm learning about if statements in php, and a question about coding ethics or practice

Example 1:

$num = 37;
if ($num < 18) {
print "too young, you are $num, you need to be 18-35";
} elseif ($num > 35) {
print "too old, you are $num, you need to be 18-35";
} else {
print "within age range, you are $num";
}

This code is probably the long winded version, yet does exactly what i want it to, what, aesthetically is the difference between that and

Example 2:
$num = 37;
if ($num < 18 && $num > 35) {
print blabla
else
print blabla2

And so on, i assume example 2 is better practice, but is there really a difference, and is it important?
 
Neither is better than the other.

With the second example you only test if it's between the two values or not, if you need to know on which side it falls if it's outside that range then you have to use the first example.

PS: if you paste code you can use the [ code ] blocks so that it formats as monospaced, keeping your indentation.
 
You can't have both running at the same time mind, if you want both installed one will have to be stopped while the other is running (Administration > Services for IIS).


I have 2 apache servers and IIS running right here on XPpro.. You need to configure them on a different port... so localhost:80 is iis, localhost:3128 is apache1 etc it does work ... :)
 
Back
Top Bottom