PHP on the client side of the browser

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Z3RO21
Forum Contributor
Posts: 130
Joined: Thu Aug 17, 2006 8:59 am

Re: php scripts

Post by Z3RO21 »

The Phoenix wrote:
No one here would like that? That will be sweet.
No, that would be a security nightmare. I wouldn't like that at all.
This sums up my opinion on this matter. I don't mind learning more than one language. When I build web applications I usually use 5 languages. XHTML, CSS, JS, PHP, and SQL. Sometimes I even throw some C++ in there when I develop web applications for controlling remote computers. Personally I like javascript it has some great capabilities like hashing data before it is sent.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Do have a look at the "JavaScript corner" on this blog post. Javascript is probably one of the best and more important languages with a couple of major flaws. PHP is not really a particularly impressive language but a very strong platform. Admittedly the idiot who wrote the Pro-PHP hasn't really done a very good job of promoting PHP.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Browser compatibility with JavaScript is it's only flaw, in my opinion. The majority of that is Microsoft's fault, however, because Microsoft didn't come up with JavaScript. So, to make up for it, they decided to "make it better." No offense to them or anything, because some of their ideas were useful, but most of them are just a hassle. Several IE-only things in JavaScript (particularly the DOM and how it's manipulated) are the same thing as the standards, just a different name. They couldn't make it easy. :P

The way JavaScript works... I feel it's innovative. Just like Java, it's all OOP. From a number to a string to an array to a function, everything is an object. I didn't come to the realization until I delve deeper into ActionScript (one of my favorite languages to program in ^_^) and it's similarities with it's parent language, JavaScript, and saw the way that the data types were laid out. JavaScript is OO from the first time you write a script, even if it doesn't feel like it, and can be easily built upon after you know what you're doing.

JavaScript has gone through multiple versions with many changes and improvements, and has grown to be a very powerful language. Other client-side scripting languages would have a tough time competing.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Re: what I hate about js

Post by CoderGoblin »

yacahuma wrote:Maybe JS and I started on the wrong foot.

What I hate about JS(not JS fault) is that each browser is different and behaves different. I find it a waste of my time making up for those differences.

The web developer should not have to care about it.
Javascript isn't too bad to get working on all browsers especiallly when you get familiar with any differences if they exist. The main developer nightmare between the different browsers is CSS.
User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Re: PHP on the client side of the browser

Post by The Phoenix »

The Phoenix wrote:
yacahuma wrote:Why do we keep using javascript? It is a terrible language in my opinion.
What makes it a terrible language in your opinion?
You haven't really answered this question, and I'm honestly interested in hearing what your dislikes of it are.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Javascript is a beautiful language. Seriously, it's hawt. What you hate is DOM scripting.

Even now, though, DOM scripting can be fun. Check out jQuery (look in sig) and see if that tickles your fancy. Be warned though: jQuery is a gateway drug that will likely lead you to Ruby or Lisp, then it's all downhill from there.

For an awesome intro to javascript, check out a couple of Douglas Crockford's articles on the subject [*nods to ole]:

http://javascript.crockford.com/javascript.html

http://javascript.crockford.com/survey.html
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Javascript is a beautiful language. Seriously, it's hawt. What you hate is DOM scripting.
A truthful statement if ever there was.
Even now, though, DOM scripting can be fun. Check out jQuery (look in sig) and see if that tickles your fancy. Be warned though: jQuery is a gateway drug that will likely lead you to Ruby or Lisp, then it's all downhill from there.
I tried jQuery the other day and I was impressed. I can see why you are addicted. Only thing I didn't like so much was the fact that the xpath implementation deviates from the spec, then again I was pretty chuffed that there even was one so it balances out really.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Ha - converted another one! Three more and I win a set of steak knives!
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

WHat happen to livewire

Post by yacahuma »

If javsacript is so wonderful , what happen to something called livewire? I thought it made possible to use javascript on the client and javascript on the server. Then why we waste are time with php? It seem to me that using one language in both places will be the way to go.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

PHP is more than just syntax, it's also a set of pre-built functions that do everything from Aspell to Zlib integration. These would have to be re-built in order for javascript to be an appropriate "glue" syntax to bind them all together. Also, the concept of sessions and other web-server related stuff would have to be integrated as well.

If you end up liking the javascript way of doing things, then check out Ruby on the server side. The two could be cousins. And Ruby's got all that other stuff already.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: WHat happen to livewire

Post by onion2k »

yacahuma wrote:If javsacript is so wonderful , what happen to something called livewire? I thought it made possible to use javascript on the client and javascript on the server.
http://en.wikipedia.org/wiki/Server-side_JavaScript - There's quite a number of server side Javascript engines. LiveWire was the first, but it went the same way as Netscape's browser. Other projects have been more successful.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: WHat happen to livewire

Post by Ollie Saunders »

yacahuma wrote:If javsacript is so wonderful , what happen to something called livewire? I thought it made possible to use javascript on the client and javascript on the server. Then why we waste are time with php? It seem to me that using one language in both places will be the way to go.
There are plenty of great languages that have yet to see serious use - Ruby has been around as long as PHP and is only now beginning to gain popularity, SmallTalk is widely accepted by those in the know to be an excellent language; it has never seen serious use.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: WHat happen to livewire

Post by superdezign »

yacahuma wrote:If javsacript is so wonderful , what happen to something called livewire? I thought it made possible to use javascript on the client and javascript on the server. Then why we waste are time with php? It seem to me that using one language in both places will be the way to go.
Languages each have their place. Some languages are more suited for certain things than others. I'd have fun with JavaScript's object model on the server-side, but PHP has a lot more useful functions and libraries built into it.

When you said LiveWire, I thought you meant me. That's usually my screen name. :P
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Loving Ruby... and Rails. Lisp is next ;-)

Image
Post Reply