# Language Debate (Web)



## Amaroq (Nov 1, 2007)

What language(s) do you prefer to program in? What makes those good languages?

I'm going to be making two topics for this. This one is more for actual web development, and the other one will be for PC programming.

I know topics like this can get really heated, so try to remember this folks: we're all fellow furries, not enemies!


----------



## Amaroq (Nov 1, 2007)

I guess I can start the debate off. I hope double-posting isn't against the rules. If it is, I suppose this can always be merged with the previous post.

I guess it's kind of hard to make any debate about the markup that you use in the pages themselves, as there is really only one option, and that option is HTML. Well, there's also XHTML of course, which is the future standard of HTML.

I prefer XHTML of course. But then again, with that choice comes more choices. Strict DTD, or Transitional DTD? I would like to use strict because it would make me feel like I've written better code and such, but seriously, how far you have to go out of your way to CSS every little thing just makes Transitional DTD seem the best choice for now.

For formatting, I do actually prefer CSS. I'll still use <b> tags and such for the little things since they're easier than using <span>s everywhere with varying IDs or classes for every little word you want to bold or italicise. For the layout as a whole, however, CSS can't be beat. Nor is there really any other choice, that I know of, that offers the ease that CSS has with formatting.

The above points aren't really too debatable though. I mean, what other choices do you have? The real debate begins when you start bringing up scripting and dynamics.

First off, Flash. Flash is good for animations, videos, etc. Especially if you put some actionscript into it. Not that I've ever used Flash before. But either way, when you start developing your entire site in Flash, it ceases to become a nice tool for animators and becomes a shortcut for web developers who have no idea how to code their own website from scratch. I'm fairly certain that anything Flash can do, I can do with DHTML, which of course would be a combination of CSS and Javascript working together, possibly with some server-side scripting as well.

Speaking of which, server-side is probably where the biggest debate here will be. Personally, I prefer PHP for such. It's the first (and only) server-side language I've learned on, so I suppose I may have some bias for it. But it also integrates well with Apache and MySQL and doesn't have a lot of overhead. Some may say they'd rather use something like Perl or Python for server-side scripting, but is that really necessary? Languages like that were made for PC programming, whereas languages such as ASP or PHP were designed specifically for use in server-side scripting.

One argument I've heard against PHP is that it's insecure and [insert language here] provides Prepared Statements for database manipulation. IMHO, prepared statements are just a shortcut for web developers who don't want to (or don't know how to) sterilize or check datatypes on their inputs before storing data in the database. That's something that everybody should know, and if an inexperienced web developer doesn't check his inputs, that's his own fault, not PHP's fault. And if you really want prepared statements, PHP has the mysqli interface.

Well, that's my view on things. Try not to immediately bash me for liking PHP and focus your retort solely around it. There's plenty of other things I argued, such as my aversion to developing a site in flash when DHTML will work just fine and would be more satisfying to code anyway.

EDIT: Oh, and frameworks. If those aren't a big, gigantic shortcut, then I don't know what is. From what I've heard, you'd be hard-pressed to customize a framework to do things that you want it to do that it may have not been designed to do. I don't care what language it is, I would rather use the language in its pure form than use a framework. And when you use a framework, you're adding much unneeded overhead anyway. Just code your site from scratch and lose all the extra code that the server has to process that you'll probably never need if you'd just write it all yourself anyway.


----------



## Xenofur (Nov 1, 2007)

PHP encourages creation of working, but horrible code.

Example: http://wakaba.c3.cx/shii/shiichan3956.zip


----------



## Eevee (Nov 1, 2007)

*HTML/CSS*
Most people should just be banned from touching it, given the sort of garbage I see floating around.  The deprecated tags -- font, b, i, u, various attributes, etc -- should never be used, ever.  Tables should only be used for tabular data.  Everything should be semantic.

I'm not really a fan of the current trend towards putting huge applications online either; HTML is a _bitch_ to do that sort of layout in.  CSS is meant to be a flexible text-markup language, not used for forms and apps.

*Javascript*
Cool language, although most people who use it don't appreciate it for what it is.  DOM is a bit low-level and thus a pain in the ass, but various wrappers take care of that.  Still greatly overused; any page that requires me to have Javascript had better have a damn good reason for it.  AJAX is similarly overused and might as well be <blink> for the 21st century.  Fucking up my browser controls pisses me off, and trying to emulate them but screwing it up is even worse.

*Flash*
Cartoons and animations and I guess videos.  Cool.  Other than that, wish it would die.

*Etc*
I'd like to see more done with SVG, <canvas>, MathML, etc; they are cool technologies that sit by the wayside because they don't work so well or at all in IE.  Since they're not plugins, though, they can be used without thoroughly wrecking chrome, and the source can be read by machines (or people) and used intelligently, indexed by search engines, etc.

~

I guess I'll babble more about these in the general thread since they apply to both...

*Perl*
In the context of Web programming, still works just fine.  Fairly speedy; faster than Ruby, faster than PHP, lags a bit behind Python.  Has modules for all level of frameworkiness, or if you really want to, you can parse everything from environment variables and stdin yourself.  CPAN is an invaluable resource; CGI.pm is still excellent, Catalyst is coming along well, CGI::Application is a nice middle ground.  Tiny embedded scripts can be done with SSI.  Has its quirks and is probably not for everyone, but the documentation is excellent and most of what it does is more or less consistent within itself.

*Python*
Fast.  Precompilation allows for speedy startup, which is good when that's part of your entire server startup.  Pylons looks solid, and there are several other similar frameworks; there is, of course, also a cgi module.  Solid language, although it has a lot of arbitrary design decisions that I'm not a big fan of.

*Ruby*
Least experience, although it started the whole framework thing with Ruby on Rails, which from what I can tell is still pretty solid.  Kinda slow, but that's supposed to be fixed in 2.0, which will be out this winter sometime.  Nice language from what I've seen.

*PHP*
Sucks balls.  Riddled with inconsistencies, bad design decisions, warts, backwards compatibility that shouldn't exist.  The entire language encourages bad code and forces any good programmer to actively work against it to get anything done.  90% of the features are badly ripped off of Perl, and the rest are badly ripped off of C.  Standard library contains everything, so if you need anything new you get to recompile the whole language.  No namespaces; no importing.  OO system sucks.  Type system sucks.  No true arrays; conversely, no true hashes.  Alias system sucks.  String manipulation has three dozen functions for half a dozen operations.  Parameter order is arbitrary.  Prefixes are arbitrary: array_pop vs implode.  Flags are hacky at best.  Regex implementation of /e sucks.  php.ini is a terrible idea.  Community is full of amateurs who encourage each other to do things badly.  Pretty much a horrendous language all around.

And now I flame the OP.



			
				Amaroq said:
			
		

> For formatting, I do actually prefer CSS. I'll still use <b> tags and such for the little things since they're easier than using <span>s everywhere with varying IDs or classes for every little word you want to bold or italicise.


Do not use these.  Use classes or <strong>/<em>.



			
				Amaroq said:
			
		

> Personally, I prefer PHP for such. It's the first (and only) server-side language I've learned on, so I suppose I may have some bias for it.


Then you don't prefer it; you just don't know anything else.  Learn another language before you develop an opinion.



			
				Amaroq said:
			
		

> But it also integrates well with Apache and MySQL and doesn't have a lot of overhead.


Almost every language I can name has some Apache interface.  Almost every language I can name has a MySQL interface.  The ones I can name that don't are the sorts of languages you don't want to use for anything.



			
				Amaroq said:
			
		

> Some may say they'd rather use something like Perl or Python for server-side scripting, but is that really necessary? Languages like that were made for PC programming, whereas languages such as ASP or PHP were designed specifically for use in server-side scripting.


I hear this a lot, but nobody can ever tell me exactly what advantage this affords PHP.  On the other hand, if you learn Perl or Python then you know a solid language that works equally well for Web scripting, administration, automation, etc.



			
				Amaroq said:
			
		

> IMHO, prepared statements are just a shortcut for web developers who don't want to (or don't know how to) sterilize or check datatypes on their inputs before storing data in the database. That's something that everybody should know, and if an inexperienced web developer doesn't check his inputs, that's his own fault, not PHP's fault.


Except that:
1. Shortcuts are _good_, because they require me to do less work for more gain, prevent me from making mistakes, and require less code duplication;
2. Everyone knows PHP has prepared statements; my complaint is that (a) this is not the default, (b) nobody uses them, and (c) the manual encourages direct string interpolation;
3. Sanity-checking your input is downright stupid if the RDBMS can do it for you and make SQL injection *impossible*.



			
				Amaroq said:
			
		

> Oh, and frameworks. If those aren't a big, gigantic shortcut, then I don't know what is.


I cannot fathom how anyone would ever think shortcuts are _bad_.  Programmer is inherently one colossal shortcut.



			
				Amaroq said:
			
		

> From what I've heard, you'd be hard-pressed to customize a framework to do things that you want it to do that it may have not been designed to do.


Either the frameworks you have heard about suck, or the people using them have no idea what they're talking about.  A framework with no customization is useless.



			
				Amaroq said:
			
		

> I don't care what language it is, I would rather use the language in its pure form than use a framework.


Then you are a terrible programmer.  Modularization, compartmentalization, and code reuse are all extremely important goals to strive for.  Someone else has already done your work for you and combined it with the testing power of thousands of other developers; why would you write it all over again?  If the framework is broken or doesn't do what you want, take the effort you would use writing everything from scratch and pour it into fixing the framework so everyone benefits!

I've been there.  I felt the same way, and I wasted untold amounts of time doing everything myself, from parsing form data to writing SQL to printing HTML.  Then I jumped on board Catalyst and now I just _code_.  Form data is parsed for me, I rarely have to touch SQL, and I have a template language -- and it all _just works_, and it's all arranged for maximum maintainability.


----------



## Pi (Nov 1, 2007)

Eevee said:
			
		

> Amaroq said:
> 
> 
> 
> ...



quoted for fucking truth.

Also, though I don't expect most people to understand this, PHP's got a shitty implementation of anonymous functions --- their function "lambda" does nothing of the sort (doesn't capture bound variables in a lexical scope, because PHP doesn't have that). But, once you realize the power of real anonymous functions, it becomes rather difficult to code without them.

One of my friends says, essentially (hi dan, if you're reading this), that the height of programming is abstraction. Think about that for a bit.


----------



## Eevee (Nov 1, 2007)

Well, it's called create_function.  But yes, it's a pathetic excuse for lambdas or closures or whatever the hell they were trying to emulate without actually -- heaven forbid!! -- adding syntax or semantics to the language.

I think that's ultimately their problem: they're trying to cram the functionality of Perl into the syntax of C.


----------



## Rostam The Grey (Nov 1, 2007)

ColdFusion, I can do everything 10 times faster... And with version 8, I can build objects and stuff in .Net if I want to and use it in my ColdFusion pages.


----------



## Eevee (Nov 1, 2007)

Oh, I forgot one.

*ColdFusion*
loooooooooooooooooooooooooool


----------



## js58 (Nov 1, 2007)

I enjoy JavaScript, even though I haven't done nearly enough, really just because it's quick and dirty and it works, and it's not like there are a thousand options for that sorta thing anyway.

Server side all I've tried are Java servlets and a little PHP. Servlets are ok, but very basic and somewhat annoying to build pages with. You have to have a reason to exploit Java or some specific Java-based component, otherwise there's probably a better way. Sun recommends you design pages themselves with JSP, but they don't mention it's impossible to read and instantly results in copy-paste.

I'll be trying out some Perl soon, we'll see how that goes.


----------



## Pi (Nov 2, 2007)

js58 said:
			
		

> I'll be trying out some Perl soon, we'll see how that goes.



Before you try out any perl, you are going to the bookstore and buying a copy of Perl Best Practices, reading it before you type a single line of code, and making it your bible when you are writing any perl code, thinking about writing perl code, reading perl code, or thinking about perl at all.


----------



## Bokracroc (Nov 2, 2007)

Eevee said:
			
		

> *Flash*
> Cartoons and animations and I guess videos.  Cool.  Other than that, wish it would die.



Flash uses ActionScript 2/3. It's cross platform and can be used for Rich Internet applications. YouTube is an example of this.


----------



## net-cat (Nov 2, 2007)

PHP - Good for bashing out quick and dirty throwaway code. It's not hard to write good PHP code, it's just that most people don't. And the community encourages that. (Most of my web programming experience, for better or worse, is in PHP.)

Python - I still find the fact that using a tab instead of a space (or the other way around) throws syntax errors extremely awkward. Other than that, I've really had no problems with it. (It's what we're doing Ferrox in...)

Perl - I haven't used Perl extensively for web development, but I have used it for other things. (It's my defacto shell scripting language, for one.) With a proper toolkit, I can see it being a very good web language. (Although it's just awkward without a proper toolkit. Fortunately, it comes with CGI.) It's rare to see a computer that belongs to me that _doesn't_ have Perl on it. Even my Windows machines tend to have ActivePerl.

---

Flash is like PHP in some ways. There are "good" uses of Flash, like YouTube and Homestar Runner. Most uses of Flash are horrible. Flash is the only reason I installed AdBlockPlus in Firefox. Flash is also not terribly portable. Yes, it works in the major OSs, Linux, Windows and Mac, but if you've ever used, say, FreeBSD or Linux/amd64, it takes a lot of hacking to get it to almost kind of sort of work. (To FreeBSD's credit, most of said hacking can be done by "make install"-ing the appropriate ports for the i386 distro.)


----------



## Eevee (Nov 2, 2007)

Bokracroc said:
			
		

> Flash uses ActionScript 2/3.


Hooray?



			
				Bokracroc said:
			
		

> It's cross platform


fsvo "cross-platform"



			
				Bokracroc said:
			
		

> and can be used for Rich Internet applications. YouTube is an example of this.


YouTube is not a "Rich Internet Application"; it's a video player.  It's even a pretty _shoddy_ video player, as any video that even remotely relies on quality or framerate will make immediately obvious.  I almost miss the days of the 90s when videos could be in any of a dozen formats; at least they were still videos.


----------



## Pi (Nov 2, 2007)

Eevee said:
			
		

> Bokracroc said:
> 
> 
> 
> ...



Actually, my roommate got Flash Player 9 to work on his SPARC boxes running Solaris. That's rather impressive imho.



> Bokracroc said:
> 
> 
> 
> ...



ahahahaha


----------

