Yet again; programers, your opinions please.

I’ve been a moderately adept computer know-it-all for a long time. I’ve done a bit of web work and have recently started learning PHP in order to introduce some interactivity to what I’m able to do. It seemed that PHP/MySQL would be good things to know. It still does.

But, as time goes on, I’m wondering if PHP was the best choice. Is it going to limit me to web applications? Are other languages as convenient for implementing web interactivity?

Also, in reading through older threads here on “what language is the best,” a lot of folks have emphasized learning about the way programs work and are built over the specific language. Does anyone have any suggestions on books/places to go that would have good insight into that end of things? I have no doubt that with reading and practice I can get the syntax down, but it’s the method of thinking/attacking a problem were I feel a little in over my head.

So, a two parter:

What language makes sense for a beginner who works a lot with websites?

Where (aside from going back to school) can I find wisdom about the design aspect of programming?

Java might make sense as your choice in language. It’s used quite a bit in web applications; though I must admit I know nothing about it myself.

As far as design, you might want to pick a copy of Code Complete

Hope this helps.

Depends on how your site would be hosted–are you running your own server, or using a hosting service? A hosting plan will generally support a relatively small set of server-side languages. If you’re running your own server you can use whatever you want. I just set up two hosting accounts for simple web sites I maintain. One is hosted on Windows and supports ASP; the other is Linux and supports PHP. I learned basic ASP very quickly; I haven’t had the time to look at PHP at all yet, though. I just finished a graduate class in web technologies and we developed a web site using JSP and Java servlets using Tomcat. (I have a BS in Computer Science and over 25 years of industry experience, though I’ve never done web programming professionally.)

I’ll bet ASP is a good language (essentially HTML with embedded VBScript) for someone without much programming experience, although I don’t know of compatibility with MySQL.

What it takes to learn good design depends somewhat on complexity. You realize, of course, that many people make a professional career of software design after having years of formal education on the topic. That doesn’t mean you can’t write software (I guess some people pull their own teeth) but the more complex your application gets, and the greater the need for high usability, good performance, high security, etc., the more you’re likely to get in the weeds.

That being said I’m sure there are good books on the topic, though I’m not familiar with any that are aimed at someone with your background and objectives. Check out your favorite online or brick & mortar bookstore in the Programming section. Borders has a good in-store selection, for example.

Don’t rule out taking a class or two. That’s a very effective way to learn this stuff. Most books I have used, even good ones, eventually leave me scratching my head at something that leads me to conduct “experiments” to figure out how something works, when an instructor could have answered a question in minutes.

C is the only programming language worth learning.

(Yes, it is still 1985 in ym world, why do you ask?)

Seriously, the advice you are hearing is correct. Learn the principles of structured programming and algorithmic design first, and you will be able to pick up most languages quickly after that. Syntax is easy (especially with today’s development suites). An order n! algortithn will still kill you, regardless of what language in which you choose to encode it.

For what it’s worth, I agree that java/XML are pretty good choices to make for a language in which to do your lab work while learning the concepts. The .NET enviornment would also be a good choice. The above assumes that you have an eye toward commercial applications development in the future. If you just wannt to twist your head around and stretch your abstractual muscles, then try LISP.
:smiley:

I have used many languages professionally and there’s a lot to like about Java. I think it’s difficult for someone with no programming background to teach himself Java, but that’s just my opinion (I distinguish between learning programming and learning a programming language; in your case you’re going to be doing both). Beyond that, beware that if you learn Java, you haven’t necessarily learned how to use Java for web applications. I learned Java independently and passed the Sun Java Programmer Certification, but taking a class in using Java for the web opened a new dimension. I have done conventional programming for a long time and there are a lot of issues introduced in designing for web applications that are non-obvious and non-trivial to deal with.

Code Complete is a great book, highly recommended.

Oh, don’t tease!! I used LISP for a project in school and never saw it again. I never quite got what kind of application it would be natural for even though it is (or was) supposedly used a lot for AI.

If you are looking for a language to learn that will help you understand concepts, I highly recommend Python (www.python.org). Although it’ll take flack as only being a scripting language, it’s got many Pros over Java, .NET, or C/C++.

First, it’s extremely easy to learn. It is objected-orientated but can still be used to write procedural code. It’s object model is easy to use and understand. It can be used to write powerful CGIs that’ll kick the crap out of PHP or ASP. It’s fast. Coupled with something like wxPython (www.wxpython.org) it can be used to make full-fledged GUIs. It’s many, many modules make it extremely powerful (wanna do socket-programming, check, xml, check, binary to ascii conversion, check, etc…)

I do a lot of web-programming for my job and all it is done using Python or Perl.

Of course, it you ever want to be a “serious” programmer you’ll have to tackle C/C++. I ended up learning C years after other languages. I wish I had started with it.

I shudder when I think about writing something in Java.

I’ve had my own Web design business since 2001. I came in only knowing HTML and how to apply (not write) JavaScript.

Since then, the skills I’ve had to learn to be successful are:

HTML (just more advanced)
ASP/vbscript
SQL (using MS SQL and Access)
JavaScript
CSS
DHTML (a combination of the above 2)
XML/XSL

I took a weekend workshop in college in 2000 on PHP, while I was becoming an “Advanced Beginner” at ASP. I found the two languages to be almost exactly the same in theory but just different in execution. My friend who took the class with me, who was a CS major and is now a programmer, couldn’t grasp the concept of PHP and databases at all.

Not sure how useful C or any OOP is in web work, if you’re just doing web work. The more “powerful” languages associated with the Web right now are Java, XML and C#.

PHP is very newbie-friendly, IMO – lots of library calls, very tolerant of errors, lots of support. There are far worse choices.

Practice, practice, practice. :slight_smile: Also, expose yourself (if only briefly) to other languages and technologies; JSP, for instance, is very close to PHP, and doing some learning of JSP will let you see how similar issues are tackled from a different directive.

Languages aren’t as important as how they’re used.

LISP has quite a few applications outside of the academic realms, including game desing and simulation packages, but I certainly was teasing about LISP as a good starting point for someone wanting to get into web development.

Still, I may have been one of the few folks who actually enjoyed the standard “LISP Project” back during school. I find functional languages to actually be quite elegant in a number of ways.

I use Java, PHP, ASP, ASP.NET, and even good ol’ Perl CGIs. IMO, there is nothing wrong with PHP and it will serve you well. It’s supported on many commercial hosts and will solve pretty much any problem you have. Of course, the same can be said of lots of other languages. I think anyone who says “this language is best”, even in a limited context, is either too ignorant to see the capabilities of other languages or too afraid to admit the limitations of their skills.

Personally, I prefer Java for the range of things it’s useful for. I can bang out a quick stand-alone java app that will run from the command line to do administrative tasks. I can use basically the same code with a GUI slapped on to provide functionality to other users who need handholding. I can use minimalist JSP and servlets for basic web work, and I can use full-blown J2EE application servers to handle sites with more intensive requirements. This leads to good code reuse. You can do the same with almost any other language, but some languages don’t handle the whole range quite as well (e.g. PHP as a command-line or GUI app) but maybe I’m just ignorant of their capabilities. Even given this preference, I often end up using something else like PHP, C# or C depending on the particular requirements of a situation.

This one just seems to be opinion-based, although factual opinions.

Moved to IMHO.

samclem GQ moderator

I remember reading somewhere that PHP doesn’t handle unicode, which makes its viability as a universal platform somewhat limited. Still, if you’re going to be doing web development for an American audience, it’s good to know.

PHP/ASP/JSP and all the other web scripting languages are more or less the same, so if you know one, you can probably pick up the others pretty easily.

C/C++ are good languages because they will torment you mercilessly, and force you to understand what your code actually looks like in memory as it’s being run. Java is still the Next Big Thing, but it’s pretty similar to C++.

Software design is more of an art than a science. Code Complete is a wonderful book and everyone should read it, but it’s not going to make you a great designer. Only experience can do that.

There’s nothing “wrong” with PHP, but it is intended largely for web-based applications, and I wouldn’t put it in the same category as Java, C/C++, or even Python. If you’re interested in different types of programming (and different types of applications), PHP won’t be able to take you everywhere you’d want to go. It’s a scripting language meant to facilitate presentation of markup (web pages). A full-on programming language is a different, bigger, more complicated beast.

I second those recommending Java. But again, we’re not exactly comparing apples to apples here. To place it in context, the Java equivalent of PHP would be JSP. ASP would be yet another equivalent. They all are based on the same goal: to make web pages more powerful and dynamic than (D)HTML/JavaScript/CSS alone can do.

Python–a powerful scripting language–is also a wonderful thing, and I would say it’s unique in the sense that it’s pushed the paradigm of scripting language further than any other scripting language. It’s also enjoying a lot of support right now. But it’s still not quite in the same class as Java or C/C++. A prime example of the difference would be the ability to design GUIs, windowed applications and such. Java and C++ provide support for doing this as part of the platform, whereas Python must be coupled with other components to achieve this goal.

I taught myself Java; I know others that have done the same. Most people I know came to Java after working extensively in C/C++ for years; in my case, it was the opposite, and I have to say I found C/C++ much more difficult to learn, especially C++. I have to (reluctantly, cuz he’s a smart dude) disagree with ultrafilter that Java and C++ are similar. Perhaps from a distance, in that they cover the same ground in an object-oriented way, but looking at C++ code side-by-side with Java can be quite frustrating for me. Frankly, I find Java to be much more elegant. ::ducks::

That said, Microsoft has seen fit to move beyond C++ to a “friendlier” (read: more Java-like) language, which they call C#. I get the sense that they encourage beginning developers to hop on that train rather than become C++ programmers at this point. And from everything I’ve seen, I’m of the opinion that C# is basically a knockoff of Java, which brings us back to square one.

I say, learn Java first, if for no other reason than the vast amount of free resources available to Java programmers. Download the JDK from Sun, and then go get Eclipse, and you’ll already have a pretty powerful java-based IDE without having spent a cent. Most people start by writing applets, since they can easily be run inside of web pages.

I think understanding how languages truly work is something that can only be learned by working with different languages. If you write a small Java program that you’re happy with, then take a week or two to write the same program in C++, you’ll have learned a lot. If you then try to code up the same functionality using PHP, chances are, you’ll run into limitations that force you to use a different design to accomplish the same goals–also an invaluable lesson.

The water only gets deeper from there, but if you’re like me, you’ll start chiseling out a “rosetta stone” in your mind to keep track of how different programming modalities accomplish similar tasks, and why certain platforms are better suited to certain goals. You’ll start to understand how languages like HTML are really adaptations of languages that preceded them, that they’re not perfectly designed for what they’re being used for; how PHP can be seen as an extension of HTML because it just can’t do everything you’d want.

You could start looking at things like Python and Ruby to get an idea of how the envelope is being pushed right now. And it’s always being pushed. Some of the next generation web interfaces are really opening up some exciting possibilities for what you can do in a web browser–take a look at Laszlo.

Look backwards, too. I recently learned a good deal about assembly language, which, besides giving me a new-found appreciation for how hard the old-timers had it, helped me understand the stack and the fetch-execute cycle–the very nerve center of a computer program. I wouldn’t want to have to write in it, but assembly helped me enormously in being able to visualize how the actual, compiled Java byte-code is executed by the Java Virtual Machine.

It’s a fascinating evolution, and it’s happening right before our eyes. Advancements whose equivalents take years in other disciplines can come together in months for a programming language. And the Open Source community has really dramatically increased the amount of resources available on the net. It’s an exciting time to be in the midst of it, and one can easily understand how in ten years time, the landscape will look a lot different. So I say, don’t just learn the languages; learn how to learn the languages. That’s the skill that will carry you forward.

Two more thoughts:

LISP–while it’s not the language I’d recommend a beginner lean–has its uses. It’s still for many genetic programmers the language of choice because of the way both sets of data and sets of functionality are both structured as tree-nodes. It should also be the remedial language of choice for those who have trouble with nested brackets and parentheses. :slight_smile:

Programming is definitely more art than science; I’d say it’s an art underpinned by a science. Just like music is underpinned by math…have fun with it. Stay interested. Give yourself projects and goals. There’s always more to learn…

This is all awesome, and I have a bunch of questions, but I’m on my way to bed and I’ll leave with this one; what exactly is meant by a “scripting” language? I recognize the things you all have labeled as “scripting” as “those languages that everyone seems to use for web development.” So, is it that they don’t get compiled like a program written in C would be? That they instead are compiled in “real-time”? Am I even using the right terminology here?

Some scripting languages are “compiled” into byte-codes before they are executed. But, in general, scripting languages don’t have looping constructs, or subroutines. Scripting languages generally don’t process data, they are usually used for formatting output.

As far as programming, and all of that, I prefer to write in assembler language, but C/C++ will do.

Damn…why didn’t you just bring up Prolog while you’re at it!!! shudders

I’ve taught Intro to Computer Science, using C++ before, and one of the most important things I emphasized to my students is that there is no such thing as a “perfect” programming language and that it’s far more important to understand good programming principles and things such as top-down design and a good grasp of data structures than to know one specific language. With my current students (non-CS engineers in a programming class, albeit one that focuses more on a problem-solving methodology than them knowing how to code), the Dev-C++ environment through the Bloodshed group provides a nice, simple way to write simple programs without having to create projects, and I’d certainly recommend it to anyone.

That said, I really do like Java as a language. With the basic Sun Java SDK, you’re forced to use a command-line to compile (an essential skill if you plan to move over into the UNIX/Linux world), plus there’s no “implementation-specific” issues that you have to worry about…Java is standard, because if it isn’t then Sun is going to sue your ass and win!!! To be honest, in the real world, I think the structured methodology has run its course, and most of the applications that you will write from here on out will be either object-oriented or event-driven (a paradigm that isn’t covered enough on its own, IMHO), and Java certainly features both of these. Finally, Sun’s documentation of Java using the Javadoc system is unparalled. APIs are neatly organized on the website, with clear definitions of parameters…one of the complaints of my students was that C++ documentation on the web was somewhat spotty at best, and I have to tend to agree with them, but Java’s is top-notch (plus they have such a nice tutorial system on the java.sun.com site).

“C++ is C with object-oriented bolted to the side.” --Me :smiley:

And Java was designed to be syntactically similar to C/C++ to make it easier for people to adopt, but that’s no surprise – a good number of languages these days have adopted the C syntax to ride on its coattails and minimize the learning curve.

Hmm, if by “scripting languages” we mean Perl, Python, Ruby etc., then I’d disagree with that. They are full-blown programming languages, with all the usual constructs (and some not-so-usual ones), object-orientation etc.

Really, scripting languages are intended to be interpreted line-by-line at the time of execution, whereas “proper” languages like C++ are compiled in advance and therefore run faster. In the days when processing power was expensive, this was a big advantage. These days, IMO, the advantage is diminishing rapidly (see Paul Graham’s take on this). And scripting languages are more interactive - you can try things out on the fly and immediately see if they work, rather than tedious write-compile-debug.

You can write pretty damn slick GUI apps easily and quickly with something like larsenmtl’s wxPython. I much rather use that than Java.