deamer44

Guest
May 25, 2008
168
0
0
Hello guys, I am fairly comfortable with HTML and CSS, and im wondering if it would be a good tool to learn PHP and/ or JAVA. What benefits will PHP give me over JAVA and vice verser. Also has anyone got any good tips/ links where i could learn from tutorials.

Thanks Tom
 

ChristianV

Member
Feb 5, 2007
65
0
0
You cannot compare PHP to Java ;)
PHP is used for server side scripting, java however is used to create applications. Perhaps you meant JavaScript which is very very different from Java ;).
JavaScript is used for client-side scripting, like manipulating elements and "runtime" (while you're looking at the page)
With PHP, you can make the content of a page dynamically, using databases for instance.
Do you have any programming experience? If so, php.net should be a good site as reference and "tutorial" for you.
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
If you have no programming experience, and you want to go anywhere with programming, PHP5 is just about the worst language to start with.
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: deamer44
What would you suggest then presidentender?

I am 3/4ths of the way through my math/computer science degree and have 1 year of "professional" (by which I mean "paid") PHP5 development, so I am not completely qualified to give advice. When I asked this same question on Slashdot because I intended to teach a young cousin of mine to program, answers were all over the place. A number of people suggested Ruby, which might fit your needs because of the Rails framework for web development, except it's not widely used (which indicates to me that it's never going to be a big deal). Pascal also comes highly recommended, but it has limited usage for web development; however, if you're looking to learn, you can't do much better than a language designed for learning. Java was my first language, which is pretty common, because it gets new programmers into graphics quickly.

Don't touch anything named "basic" until you already know how to program, and a thing or two about at least one paradigm (object oriented, functional, imperative...).

Essentially, the best language depends on what you need. How old are you? What are your goals in learning? What are your goals in developing?
 

deamer44

Guest
May 25, 2008
168
0
0
Thanks for the reply, im 17, i really just wanted to know a good language ( not necessarily web development) that will teach me basics of programming (i've heard once you have learned one language the others are easier). So my goal is to become comfortable with a structured programming language( that can be used without maths, as i dont do A level maths) which will allow me to pick up visual basic when i go to uni to do computing management :).
 
Oct 27, 2007
17,009
5
0
As a totally unqualified programming noob (talking about myself, not you!), I would suggest Java for a couple of reasons. It's a strongly-typed language that gives useful compile-time errors. It will require you to learn the object oriented paradigm which by most accounts is where the field is going. I have heard it is a language that is easy to learn but it is also very powerful and widely used.
 
Jun 2, 2008
163
0
0
VB.NET and ASP.NET to start, then maybe C# and ASP.NET.

I would also suggest taking a intro to C++ or any course to help get you into the programming mindset.

I'm a noob too but I got a internship at a company as a .NET programmer.

School wise C++ was my first language I learned. Then VB.NET for a lot of courses. I jumped into C# pretty easily.
 

deamer44

Guest
May 25, 2008
168
0
0
Thanks, anyone got any good websites or books that i could learn vb.net, asp.net or c++.
BTW what do each of the programming languages do differently. (vb.net, asp.net or c++)
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: GodlessAstronomer
As a totally unqualified programming noob (talking about myself, not you!), I would suggest Java for a couple of reasons. It's a strongly-typed language that gives useful compile-time errors. It will require you to learn the object oriented paradigm which by most accounts is where the field is going. I have heard it is a language that is easy to learn but it is also very powerful and widely used.

While Java is a useful tool to have in your repertoire, I wouldn't recommend it as a first language (this is coming from someone whose first language back in High School was Java). A great deal of learning Java is voodoo coding; you start with "Hello World!" and nobody explains what public static void main(String[] args) means, and copy a lot of stuff from the book or the teacher or the website. Yes, no matter what you do, you will copy a lot of stuff. But with many other languages, you'll understand what the stuff you're copying is doing. If I were to do it over, Java would be my second language, but not my first.

Originally posted by: TheEarthWillShake
VB.NET and ASP.NET to start, then maybe C# and ASP.NET.

I would also suggest taking a intro to C++ or any course to help get you into the programming mindset.

I'm a noob too but I got a internship at a company as a .NET programmer.

School wise C++ was my first language I learned. Then VB.NET for a lot of courses. I jumped into C# pretty easily.

VB.NET is a terrible first language for a number of reasons. As GodlessAstronomer noted, one of Java's advantages as a learning language is that it is strongly typed. VB, on the other hand, is 'optionally typed,' meaning that it is extremely forgiving. It's becoming popular as a teaching language because it is easy and people stay around to take courses, not because it is a well-suited teaching language. VB was designed as a rapid application development language for developers who needed to write a simple app quickly; it is a poor teaching language and has very little in common with any other development tool. Again, this is a useful tool to have, but a poor first language. (My university's CS101 course is Visual Basic. It is taught by grad students who themselves learn VB only for the class and then forget it, to students who will almost certainly drop out as soon as they realize that the other classes are much harder).

ASP.NET is not a language. It is a development framework. Stacking it with VB, you get a whole lot of "ooh look what I can do" and very little knowledge of what you are actually doing. Given that this is one of the criticisms of modern CS education, this is a poor place to start.

C# is, to all intents and purposes, Java.NET. If you're going to learn C#, just learn Java. Again, C# insulates you from a great deal that you really ought to be learning; especially when used in conjunction with ASP, it will allow you to create very pretty web pages with absolutely no idea how anything works.

C++ is as bad as Java as a first language, but not as bad as VB. A major problem with trying to learn C++ first: it was designed for C programmers who wished they could do other things. As such, it is almost a superset of C, with a great deal of additional syntax and language features. For reference, "The C Programming Language" by Kernighan and Ritchie, who developed the language, is 274 pages. "The C++ Programming Language" by Stroustrup is 911 pages. Trying to learn C++ first, you put yourself in danger of information overload.

This article, while a bit dated, makes points that are still valid. (There's a small typo [it says if x=1, should say if x==1] under "Regularity"). The author concludes that C is an appropriate first language, passing over Pascal because Pascal doesn't support object object orientation or polymorphism. I tend to agree.

Learning any of the .NET languages will make your life easier in a course that teaches said .NET language. However, you're hurting yourself in the long term by insulating yourself from what your code is actually doing. I advise you to learn C; pick up a copy of K&R.

Finally, there are more considerations than "what language should I learn." A good CS education barely touches on learning languages; usually, they explicitly teach a single language, and then teach you how to learn other languages quickly. Languages come and go; there are no more entry-level COBOL jobs. The theory, though, stays the same. The best thing for you to do, right now, is not to learn to program much beyond "Hello World" and flow control. The best thing is to learn some discrete mathematics and some data structures. You ought to walk in to your first day at class knowing what a stack is, what a queue is, and how to calculate n choose k. I wish I had known these things, and I'd trade having known how to program for having known some theory in a heartbeat.
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
If you want to learn the basics of programming, C++ is absolutely your best bet.

You will learn best practices as far as function naming, indentation, etc, as well as many things that are not necessarily used in other languages but are very important to an understanding of programming: pointers, data types, etc.

C++ was where I started, and when I moved on to other languages for various reasons (PHP for web development, Visual Basic and ColdFusion for rapid application development, and C# for a certain application we're working with), I found that my knowledge of programming in general was such that I was able to adapt to the new syntax of these languages very very easily. My bosses have always commented favorably on my ability to produce clean and efficient code, no matter the circumstance.

Now, when I say that you should learn C++, I do NOT mean that you should try to learn one of the many frameworks out there (MFC, .Net, qt, GTK, whatever). My first two full years of formal programming instruction consisted of writing simple linux commandline applications that accomplished one single task. You should do the same. Don't immediately start programming and think that you're going to write the next 3D engine. You need to hone your funduhmentals first. Write an application that can identify pallindrones from stdin, for example, as an intro to character arrays and control structures. Or a linked list that takes a variable number of student/score sets and then gets the mean and median scores.

These are simple things that have no really practical application, yet will allow you to develop good skills and practices as far as programming goes.

Also, read a book. Ignore any online tutorials and those kinds of things. THey're a waste of time. I recommend "C++ How To Program" by Deitel and Deitel. I used this book, and it was a great resource.
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: drebo
You need to hone your funduhmentals first.

I agree 100%, but why burden yourself with C++ syntax while learning said duh-mentals? C will get you where you need to go, unless you were making an object-oriented palindrome finder :)
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
C and C++ are virtually identical at the lowest levels of programming. The syntax is the same, until you get to things like OOD.

C and C++ have a very logical and token-based syntax, so either would probably be OK...but the differences are so minute that C++ is just the better choice all-around, because now you don't need to worry about it when you decide to change your palindrone finder into a class as opposed to a series of functions.

The point is that you should work with a token-based language first, as opposed to a more verbose language, because you're more apt to learn the concepts behind the programming, rather than just being able to regurgitate words. PHP is also largely token-based, but being that PHP is typeless and unstructured, it makes for a very bad language to learn if you have no prior programming experience.
 

clamum

Lifer
Feb 13, 2003
26,256
406
126
New to programming? I'd start with Java and get the basics of object-oriented programming down (objects, inheritance, polymorphism, etc) first. You won't have to worry about pointers and garbage collection with Java and you can always branch out to C++ or other languages after you get Java down.
 
Oct 27, 2007
17,009
5
0
Originally posted by: drebo
You will learn best practices as far as function naming, indentation, etc, as well as many things that are not necessarily used in other languages but are very important to an understanding of programming: pointers, data types, etc.

I have a quick question. I have seen this word "pointers" thrown around a bit and I'm curious. From what I can tell these are the same as object reference variables in Java, no?
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
Pass by value/pass by reference is very tied to pointers, yes.

Languages generally term them differently, but one would say (theoretically and technically) that in C++ when an object is passed by reference, the child function receives a pointer to that object.

To my knowledge (and I don't program in Java, so I'm not possitive about this), Java does not have pointers, but the background functionality is the same. I know that's the case with PHP, even though PHP does not have pointers either.

In C++, you can create pointers without using pass by reference. For instance, arrays in C++ are nothing more than pointers. To my knowledge, Java's memory management is all built in to the framework.
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: drebo
Pass by value/pass by reference is very tied to pointers, yes.

Languages generally term them differently, but one would say (theoretically and technically) that in C++ when an object is passed by reference, the child function receives a pointer to that object.

To my knowledge (and I don't program in Java, so I'm not possitive about this), Java does not have pointers, but the background functionality is the same. I know that's the case with PHP, even though PHP does not have pointers either.

In C++, you can create pointers without using pass by reference. For instance, arrays in C++ are nothing more than pointers. To my knowledge, Java's memory management is all built in to the framework.

PHP's wonky about pointers - you can't do *$foo and get a pointer, but you can do &$foo and get a reference. I never do it, but it is doable.

You're right about Java. You can't use pointers in your code even if you want to. It's garbage-collected, so you don't worry about memory management at all, but watch out if the GC decides it needs to run just as your airliner is making its final approach, thereby cutting off your pilot's access to his controls.
 

Aikouka

Lifer
Nov 27, 2001
30,383
912
126
Originally posted by: presidentender
While Java is a useful tool to have in your repertoire, I wouldn't recommend it as a first language (this is coming from someone whose first language back in High School was Java). A great deal of learning Java is voodoo coding; you start with "Hello World!" and nobody explains what public static void main(String[] args) means, and copy a lot of stuff from the book or the teacher or the website. Yes, no matter what you do, you will copy a lot of stuff. But with many other languages, you'll understand what the stuff you're copying is doing. If I were to do it over, Java would be my second language, but not my first.

That's because if you just start explaining what the declaration is, you're going to lose people when you start using strange words like classes and all these things that they have no idea what they are. Then you try to explain those and you just end up getting ahead of yourself. The idea is to ignore those for the time being and when you start getting some background on it, you can then discuss the parts that've been lying around for awhile.
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
Originally posted by: Aikouka
That's because if you just start explaining what the declaration is, you're going to lose people when you start using strange words like classes and all these things that they have no idea what they are. Then you try to explain those and you just end up getting ahead of yourself. The idea is to ignore those for the time being and when you start getting some background on it, you can then discuss the parts that've been lying around for awhile.

I strongly disagree with this. Concepts like "public", "static", and "void" are such fundamental concepts in ALL programming languages that they SHOULD be the first things you talk about, before you get in to explaining any functions, any objects, or any classes.

Without an understanding of these fundamental concepts, a programmer is completely doomed to simply copy code without understanding what they're actually doing.
 

Aikouka

Lifer
Nov 27, 2001
30,383
912
126
Originally posted by: drebo
I strongly disagree with this. Concepts like "public", "static", and "void" are such fundamental concepts in ALL programming languages that they SHOULD be the first things you talk about, before you get in to explaining any functions, any objects, or any classes.

Without an understanding of these fundamental concepts, a programmer is completely doomed to simply copy code without understanding what they're actually doing.

To assume that something should be "taught" simply because it appears is silly. You may end up teaching a CS class what all that mumbo jumbo means and then they'll forget about it because it doesn't matter as they don't really have to use it. Teach them more about it when it actually matters! Of course they may use these in other aspects. Such as a public class vs a private class (before they get to delving into methods) or creating void functions. But actually explaining why it's a public static void isn't necessary at that point neither are explaining the terms until it comes around. Jumping around in the material isn't a proper way to teach. You build up when it comes to learning the basics.

Also... "public", "static" and "void" are not concepts that exist in all languages. All OO languages (that I know of)... sure.

But to kind of get back on the topic... I learned PHP after I already had taught myself Visual Basic. It's really not that hard to learn and you can use some tutorials and work with simple examples modifying them to get an idea of how things work. Although, I typically combine PHP with a SQL (MySQL).
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: Aikouka
That's because if you just start explaining what the declaration is, you're going to lose people when you start using strange words like classes and all these things that they have no idea what they are. Then you try to explain those and you just end up getting ahead of yourself. The idea is to ignore those for the time being and when you start getting some background on it, you can then discuss the parts that've been lying around for awhile.

You're absolutely right, and that's what my instructor in the first semester of Java did. If you're going to teach Java as a first language, you have to do it that way. I just don't see a good reason to teach Java as a first language, as opposed to C, C++, Pascal, or Delphi (Object Pascal, whatever).

This article (it's not the primary source; when I try to get to it, it throws a proxy error. This one does link to it, though) gives some of the criticisms of Java as a first programming language.

I'm not saying that C (or C++, for those of you who like C++) is a perfect first language; I'd prefer something like Pascal for reinforcing best practices in new programmers. I am also not saying that you can't have a skilled programmer who learned on Java (I have a vested interest in believing that you can!). I do, however, think that C is a better first language than Java.

 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
Originally posted by: Aikouka
To assume that something should be "taught" simply because it appears is silly. You may end up teaching a CS class what all that mumbo jumbo means and then they'll forget about it because it doesn't matter as they don't really have to use it. Teach them more about it when it actually matters! Of course they may use these in other aspects. Such as a public class vs a private class (before they get to delving into methods) or creating void functions. But actually explaining why it's a public static void isn't necessary at that point neither are explaining the terms until it comes around. Jumping around in the material isn't a proper way to teach. You build up when it comes to learning the basics.

Also... "public", "static" and "void" are not concepts that exist in all languages. All OO languages (that I know of)... sure.

But to kind of get back on the topic... I learned PHP after I already had taught myself Visual Basic. It's really not that hard to learn and you can use some tutorials and work with simple examples modifying them to get an idea of how things work. Although, I typically combine PHP with a SQL (MySQL).

The concepts of public objects, static variables, and functions that do not return a value are most certainly concepts that exist in every single language, from Visual Basic, to ColdFusion, to PHP, to C++, and Java. They are concepts that MUST be mastered for a full understanding of programming. If you don't know the difference between an instance variable and a static variable, you're screwed.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: drebo
Originally posted by: Aikouka
To assume that something should be "taught" simply because it appears is silly. You may end up teaching a CS class what all that mumbo jumbo means and then they'll forget about it because it doesn't matter as they don't really have to use it. Teach them more about it when it actually matters! Of course they may use these in other aspects. Such as a public class vs a private class (before they get to delving into methods) or creating void functions. But actually explaining why it's a public static void isn't necessary at that point neither are explaining the terms until it comes around. Jumping around in the material isn't a proper way to teach. You build up when it comes to learning the basics.

Also... "public", "static" and "void" are not concepts that exist in all languages. All OO languages (that I know of)... sure.

But to kind of get back on the topic... I learned PHP after I already had taught myself Visual Basic. It's really not that hard to learn and you can use some tutorials and work with simple examples modifying them to get an idea of how things work. Although, I typically combine PHP with a SQL (MySQL).

The concepts of public objects, static variables, and functions that do not return a value are most certainly concepts that exist in every single language, from Visual Basic, to ColdFusion, to PHP, to C++, and Java. They are concepts that MUST be mastered for a full understanding of programming. If you don't know the difference between an instance variable and a static variable, you're screwed.

I would generalize it a little bit. The concepts of scope and name resolution are inherent in almost any language. The decomposition of programs into procedural units is also common. But once you get into ideas like public classes and whether a function is different from a procedure I think you're getting closer to implementation dependencies.