473,714 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the learning curve for PHP?

Hello,

A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like
bash shell scripting for Linux?

Thanks
KJW

Mar 30 '07 #1
26 9307
K.J.Williams wrote:
Hello,

A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like
bash shell scripting for Linux?
Since you already know the basics of programming - conditional
loops, operators, scope, data types, etc - it should be
relatively quick to learn PHP.

The only part that might gum up the works is if you're not
well-versed in HTML/JavaScript.
Mar 30 '07 #2
K.J.Williams wrote:
Hello,

A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like
bash shell scripting for Linux?

Thanks
KJW
Hi,

You have both a good background to start learning PHP fast.
In PHP you can work procedural. If you are confortable with the language,
you can start OOP too (no need, just another way of programming, cleaner in
some aspects).

PHP is easy to pick up.

Things to focus on from the start (in my humble opinion)
- Understand HTML forms
- Understand how PHP receives information (superglobal $_GET[] and $_POST[])
from the forms.
- keep paying attention to php.ini. It may seem like a dull piece of
settings in the beginning, but you'll understand more of it as you learn
more PHP. Just keep coming back there. :-)
- use www.php.net always to lookup functions.
Pay attention to the often usefull comments by other users.
- Get a good book (O'Reilly has a few good ones)
- If you recycle other people's code, never copy/paste, but just
rebuild/retype it yourself, using the examplecode only as a reference.
(This increases understanding in my opinion)
- If you plan on using a database, beware SQL injection. This involves
understanding of the database, php.ini (magic_quotes and such), and make it
a habbit of echo'ing all your SQL untill you are comfortable you know what
happens.
- Get a nice editor with syntax highlighting.
- important: make sure you let PHP see all the errors/notices/warning/etc.
(Again in php.ini: error_reporting )
- When confused, come to comp.lang.php, but you found that place already.
;-)
We have an active helpfull community here. This group is one of the
friendliest and helpful usenetgroups I have seen. You never have to wait
long for a response.

And of course: Enjoy!

Regards,
Erwin Moller
Mar 30 '07 #3
K.J.Williams wrote:
A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?
PHP's syntax is fairly like C.

- Function calls are "function_name( )"

- Lines end in semicolons

- Whitespace is mostly insignificant

- "if", "for", "while" and "switch" syntax is pretty much
the same

- Most of the mathematical, boolean, assignment and comparison
operators are the same

The biggest difference in syntax is that variables in PHP always begin
with a dollar sign, e.g. $foo.

However, PHP is a much higher level language than C. You rarely need to
worry about casting variables to a different type, and never have to deal
with pointers. Strings are a basic data type in PHP, and don't need to be
treated as an array of characters. Indeed, there isn't a character data
type -- characters are just strings with length 1.

PHP has a lot more functions built in to the language, compared to C where
a lot of functionality (e.g. database connectivity, regular expressions,
networking functions) needs to be imported through libraries.

PHP4 has a certain amount of OO support, and PHP 5 has almost as much OO
support as Java does; however, you don't have to use it!
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like bash shell scripting for Linux?
Assuming that your previous programming experience is with GUI or
command-line programming in C/VB, then probably the biggest change you'll
need to make is not the new programming language that you'll need to
learn, but the paradigm shift of moving from desktop programming to web
programming.

With desktop programming, you're drawing objects to the local screen, and
you can draw these objects whenever you like really. With web programming,
your program has no direct access to the screen, keyboard or mouse of the
client machine. All you get told is that someone has requested page X with
query string Y and post data Z. Your program has a few seconds to figure
out what data it needs to send back, assemble that into some HTML and
output that. Then the data goes back to the client, whose machine renders
it to their screen using a mechanism that is beyond your control. Fun, eh?

Seriously, I think the desktop->web paradigm shift is a much bigger leap
than the change of programming language. I'd suggest at first writing a
CGI program, such as a small web forum, in a language you're familiar with
(e.g. C, or bash scripting) at first, and getting a feel for how web
programming as a whole works, and then make the shift to doing it with
PHP, which will then be comparatively easy.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 30 '07 #4
Toby A Inkster wrote:
K.J.Williams wrote:
>Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?
With a good background in C, PHP is very easy.
PHP's syntax is fairly like C.
<snip>

Variable scope is worth looking at before you start:
http://uk2.php.net/manual/en/languag...bles.scope.php
The biggest difference in syntax is that variables in PHP always begin
with a dollar sign, e.g. $foo.
He, that's always the gotcha when you switch to PHP from C.
PHP has a lot more functions built in to the language, compared to C where
a lot of functionality (e.g. database connectivity, regular expressions,
networking functions) needs to be imported through libraries.
There are core functions, and then there are functions that need to be
compiled in (but usually are):
http://www.php.net/manual/en/functions.internal.php

It's worth remembering as a PHP noob that chances are, there's already
a function to do it.
PHP4 has a certain amount of OO support, and PHP 5 has almost as much OO
support as Java does; however, you don't have to use it!
If you want OO then it's probably best to go with a language that was
designed that way in the first place.

--
"Checking identity papers is a complete waste of time. If anyone can
be counted on to have valid papers, it will be the terrorists".
Mar 30 '07 #5
K.J.Williams schrieb:
Hello,

A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
PHP has a C background. A lot of functions that you know from C can be
used with PHP just like you know them. For example, there's the C
coder's much beloved sprintf(). The control strucutres like for() and
if() are also very much like C. PHP also shares with C++ the ability to
mix procedural and object oriented code. As for the VisualBASIC
programmer, there's much logic to gain and there are many oddities to
forget about ;-)
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?
First success is easily obtained. That's why PHP is so popular. And the
quality of the online documentation at php.net is just great. The
hardest thing to understand when coding for the web with PHP is to
understand the oddities of the stateless HTTP protocol. You don't have
your PHP app running all day long! A request comes in, your script runs
and produces output and then the script dies. Persistence surviving a
single request has to be obtained by means of session, databases of the
use of shared memory segments.
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like
bash shell scripting for Linux?
And how IS shell scripting for Linux for you? You can't assume everyone
feeling the same way about this...

OLLi

--
Kajiggers!
Mar 30 '07 #6
Oliver Grätz wrote:
mix procedural and object oriented code. As for the VisualBASIC
programmer, there's much logic to gain and there are many oddities to
forget about ;-)
What comes to mind is that a BASIC programmer might expect this:
if (func1() and func2()) { func3(); }
to evaluate func2() regardless of what func1() returns.

AIUI. IANABP. Well, not for many many years.

--
"Checking identity papers is a complete waste of time. If anyone can
be counted on to have valid papers, it will be the terrorists".
Mar 30 '07 #7
Well my friend who uses VB has a problem , AND IVE TOLD HIM MANY TIMES
about this...

HE USES GOTO.... for all of his jump routines in VB.
I said to him that the practice of using goto, is like
a garotte for programmers. How he lives with the frustration
I dont know - thats why I program in C not VB. My conversion
from BASIC to C long ago was caused by GOTO sphagetti code.
C has GOTO too... but I have avoided GOTO like the plague
ever since then and I hope I never use such a thing.

So my friend's concern is importing his tactics of using goto in PHP
from his practice in VB.

I hope PHP does not have a GOTO - no programmer ( except for those in
assembly ) should ever use a goto statement.

Should I assume PHP doesn't have a GOTO for my friends case?

Thanks again

On Mar 30, 2:30 am, Toby A Inkster <usenet200...@t obyinkster.co.u k>
wrote:
K.J.Williams wrote:
A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?

PHP's syntax is fairly like C.

- Function calls are "function_name( )"

- Lines end in semicolons

- Whitespace is mostly insignificant

- "if", "for", "while" and "switch" syntax is pretty much
the same

- Most of the mathematical, boolean, assignment and comparison
operators are the same

The biggest difference in syntax is that variables in PHP always begin
with a dollar sign, e.g. $foo.

However, PHP is a much higher level language than C. You rarely need to
worry about casting variables to a different type, and never have to deal
with pointers. Strings are a basic data type in PHP, and don't need to be
treated as an array of characters. Indeed, there isn't a character data
type -- characters are just strings with length 1.

PHP has a lot more functions built in to the language, compared to C where
a lot of functionality (e.g. database connectivity, regular expressions,
networking functions) needs to be imported through libraries.

PHP4 has a certain amount of OO support, and PHP 5 has almost as much OO
support as Java does; however, you don't have to use it!
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like bash shell scripting for Linux?

Assuming that your previous programming experience is with GUI or
command-line programming in C/VB, then probably the biggest change you'll
need to make is not the new programming language that you'll need to
learn, but the paradigm shift of moving from desktop programming to web
programming.

With desktop programming, you're drawing objects to the local screen, and
you can draw these objects whenever you like really. With web programming,
your program has no direct access to the screen, keyboard or mouse of the
client machine. All you get told is that someone has requested page X with
query string Y and post data Z. Your program has a few seconds to figure
out what data it needs to send back, assemble that into some HTML and
output that. Then the data goes back to the client, whose machine renders
it to their screen using a mechanism that is beyond your control. Fun, eh?

Seriously, I think the desktop->web paradigm shift is a much bigger leap
than the change of programming language. I'd suggest at first writing a
CGI program, such as a small web forum, in a language you're familiar with
(e.g. C, or bash scripting) at first, and getting a feel for how web
programming as a whole works, and then make the shift to doing it with
PHP, which will then be comparatively easy.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

Apr 2 '07 #8
K.J.Williams wrote:
Should I assume PHP doesn't have a GOTO for my friends case?
There is a proposal for "goto" to be included in PHP 6, but it will
probably not be called "goto". And the one proposed is more like the
Perl concept of goto -- which has virtually nothing in common with the
BASIC goto. The Perl goto is a far more limited statement, which just
allows you to jump out of loops in a particular way.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 2 '07 #9
I was thinking about learning PHP, using PHP+GTK2. Will it let me
write scripts that produce client applications like Java?

Thanks again

On Mar 30, 2:30 am, Toby A Inkster <usenet200...@t obyinkster.co.u k>
wrote:
K.J.Williams wrote:
A friend and I want to learn PHP but we have two totally different
programming backgrounds.
I have experience with procedural programming in C, and he has
experience with Visual BASIC.
Well we wanted to know, what type of learning curve ( of difficulty )
we would have trying to learn PHP?

PHP's syntax is fairly like C.

- Function calls are "function_name( )"

- Lines end in semicolons

- Whitespace is mostly insignificant

- "if", "for", "while" and "switch" syntax is pretty much
the same

- Most of the mathematical, boolean, assignment and comparison
operators are the same

The biggest difference in syntax is that variables in PHP always begin
with a dollar sign, e.g. $foo.

However, PHP is a much higher level language than C. You rarely need to
worry about casting variables to a different type, and never have to deal
with pointers. Strings are a basic data type in PHP, and don't need to be
treated as an array of characters. Indeed, there isn't a character data
type -- characters are just strings with length 1.

PHP has a lot more functions built in to the language, compared to C where
a lot of functionality (e.g. database connectivity, regular expressions,
networking functions) needs to be imported through libraries.

PHP4 has a certain amount of OO support, and PHP 5 has almost as much OO
support as Java does; however, you don't have to use it!
Also, What will be the most significant changes for us to adapt to? I
wanted to know if PHP is like bash shell scripting for Linux?

Assuming that your previous programming experience is with GUI or
command-line programming in C/VB, then probably the biggest change you'll
need to make is not the new programming language that you'll need to
learn, but the paradigm shift of moving from desktop programming to web
programming.

With desktop programming, you're drawing objects to the local screen, and
you can draw these objects whenever you like really. With web programming,
your program has no direct access to the screen, keyboard or mouse of the
client machine. All you get told is that someone has requested page X with
query string Y and post data Z. Your program has a few seconds to figure
out what data it needs to send back, assemble that into some HTML and
output that. Then the data goes back to the client, whose machine renders
it to their screen using a mechanism that is beyond your control. Fun, eh?

Seriously, I think the desktop->web paradigm shift is a much bigger leap
than the change of programming language. I'd suggest at first writing a
CGI program, such as a small web forum, in a language you're familiar with
(e.g. C, or bash scripting) at first, and getting a feel for how web
programming as a whole works, and then make the shift to doing it with
PHP, which will then be comparatively easy.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

Apr 2 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
2148
by: Marco | last post by:
Ive been using front page but it starts to anoy me when i need to change in the source things that i cant change while in the "normal" mode, specialy when working with tables its soo hard to tell him what we realy want with out going to source and change it there. heh heh probably some while say use the mighty notepad ;) , its not good for i use it only when its to change a few things and not to start pages from scratch.
23
2814
by: darwinist | last post by:
What PHP Represents There is no shortage of complaints one could make about php as a language, and although the list does shrink with each release, some of them are inherent to the origins and development process of this, the most popular of the web-based, server-side, glue-languages. That said, most descriptions of what is good about php, fail to do it justice. Although they are generally enthusiastic and sometimes fanatical, no...
28
4823
by: Admin | last post by:
I am doing some research for a Python framework to build web applications. I have discarted Zope because from what I've read, the learning curve is too steep, and it takes more time to build applications in general with Zope. I have kept the following: - PyWork - http://pywork.sourceforge.net (Not sure if it's mature) - Django - http://www.djangoproject.com (Looks interesting) - CherryPy - http://www.cherrypy.org (Unsure)
8
4048
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ; Intermediate/Advanced Database designer . Because of the requirements , I must create Web Application . Access Pages is not suitable for that so I think about learning VB Net / ASP Net . I am
8
2781
by: scorpion53061 | last post by:
Hi, I am a vb.net guy......(I know boo hiss LOL) I was thinking of learning C# as well. Can I expect a hard road of it as far as a learning curve? As as side note, what made you choose C# over vb.net?
8
3167
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that basically entitled to us to just about every .Net development tool you can imagine. I cant even begin to mention them. To begin with, my background is not that of a programmer, but a systems engineer and the closest I have come to "programming"...
7
1017
by: dgk | last post by:
I'm trying to persuade my company to use ASP.NET for a development effort but I'm pretty weak in both ASP.NET and web development. I've explained that ASP.NET works by turning the controls on the page into html and java script so we don't have to write html and javascript ourselves but clearly we need to write some js anyway since I have to do that just to set the focus to the first control on the webpage. As an example, how can I do...
8
2860
by: Chris Asaipillai | last post by:
Hi there I have some questions for those experienced Visual Basic 6 programmers out there who have made the transition from VB6 to Vb.net. How long did it take you to learn at least the basic elements of VB.net....so that you were confident to write a application from scratch. This wouldnt necessarily
11
2488
by: Paul Brady | last post by:
Apparently, I have been living on the wrong planet. I have written 15 databases in Microsoft Access in the past 10 years, some of which are split, one uses ODBC interface with a SQL server, one has a many-to-many relationship, and all of which have Basic code to handle events and run functions which I have coded, and all this time have never heard of .Net -- until today. So, I looked it up on Google, asking for Access and .Net and got...
0
8801
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9015
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4464
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2520
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2110
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.