Page 1 of 1

php / asp.net

Posted: Fri Jun 05, 2009 8:47 am
by langy01
Firstly apologies if this is the wrong section.

I started off doing html, then asp, php on my home web server and now doing a small project in asp.net at work.
At the same time I want to upgrade my webserver at home as its running an old version of Linux so now looking at updating my home website.

With recently using asp.net I have seen how much easier it is to drag and drop controls like gridviews and calendar controls etc. Has php upgraded over the last couple of years (shows how long ago I initially learnt it) to work in the way that asp.net works? Its not that I don't like the coding but after using asp.net its far easier to create a control and link to a database where you just need to write your SQL, and even then fir simple queries that is done for you.

If there is where is the best resources to learn more about it for tutorials etc?

Paul

Re: php / asp.net

Posted: Fri Jun 05, 2009 9:16 am
by JAB Creations
Hi Paul,

As a web designer who really knows his stuff learning web development who scares fellow forum members with some of my questions I'm going to have highly recommend PHP. Books just won't help me any more though I do keep them around for reference though rarely use them. When I did I noticed that all the Microsoft books were really off. On the IE blog they call web designers web developers (web developers do serverside, web designers do clientside, if you do both then you're both). The ASP.NET book I have is an utter nightmare. It drowns the reader in clientside code that is not only necessary but uses it from the server to attempt to style the page...from the server! I've read a lot of other ASP.NET tutorials and frankly Microsoft just doesn't have their act together at all.

PHP is just a nifty clean language. Most of the tutorials and reading material that I've come across (for my skill level of course) are simply clean. You have to leave styling to CSS and if you're trying to figure out something serverside related there is no point adding code that has nothing to do with your immediate goal.

As far as drag and drop are concerned...look, Vista blows, why? Because they got rid of all the useful features and put eye candy in front of you. They're all like, 'Hey buddy, look at all this shiny stuff!' I'm all like, 'Hey buddy, the My Documents folder can't be moved from the C:\ making it insanely vulnerable to being lost from the unavoidable format within the next two to three months.' Microsoft just doesn't have their ducks in a row because they're too busy trying to monopolize and strangle everything.

If you're serious about being successful with web programming PHP is the only way to go. If you want to be confused about what code does what and be temporarily entertained by drag and drop features while having no actual skill set because the language and tutorials for it are crap then you're not going to be able to offer anything unique which in turn wouldn't be the most desirable approach to the job market.

Take your personal position in to consideration. If everything in your area is Microsoft then yeah, you're going to need to mess with ASP.NET most likely but you're not going to get very far. Learn PHP as PHP doesn't try to be CSS and you'll find yourself learning a lot faster on a language that is more effective in it's role then destructive to correlating languages (in example CSS). The ramifications go all the way to web design, standards, and coding practices in general.

Re: php / asp.net

Posted: Fri Jun 05, 2009 9:30 am
by langy01
Ummm, did that actualy answer my question or was that just a blow out on Microsoft?

Let me put you a little more in the picture, my IT role is in a MS environment but I'm always looking to learn more things. That is why I use an old computer at home stick Lunux on it, run apache, php, mysql and have my own reliable web server.

The last time I looked to learn php was about 2 years ago, so my question was more based on has it developed further like asp has moved in to the .net controls?

I work in a varied IT role where I do anything from Support, build PC's and develop where I have to. That means that over the years on programming alone I have learnt Cobol, VBA, VB, HTML, css, ASP, ASP.NET, Java script, PHP and various other scripting languages that are specific to one application.

I know that a couple of years ago when I learnt php I found it far easier and nicer to use than asp so you don't really need to try and convert me but due to my role I have and do prefer to learn new things.

Paul

Re: php / asp.net

Posted: Fri Jun 05, 2009 11:53 am
by mikemike
In answer to your question: yes and no.

It's not so much PHP or ASP that is moving forward, the code is still the same for the tools, it's a case that the IDE's/Editors are more advanced allowing you for quicker integration. There are IDE's for PHP, just as there are for ASP, that allow you to drag and drop grids and database-populated forms onto a WYSIWYG. I believe Dreamweaver does this (although I've never used it).

I'd highly recommend against this method. There are lots of reasons why, but here are a few:
- PHP is very versatile. You can create pretty much anything with it. If you only have the skills to use drag and drop tools though, you're very limited
- You're likely to be using code that's far too over-complicated than what it needs to be using a drag and drop tool
- If you don't keep your IDE up to date you may be using deprecated functions

Take this example which I came across a few months ago. I am head developer for a company in the UK. We were looking at taking on a Junior developer so it was my job to do some of the interviews. As part of the selection process I decided to have the candidate write a simple application in PHP, off the top of my head I think it was a comment system or guestbook. Anyway, a guy came in, seemed quite intelligent, good for the job. I sat him down at a computer and gave him the brief but he said he couldn't use anything other than Dreamweaver to code. Most of our machines have a few IDE's on like Eclipse, phpDesigner and Notepad++, but Dreamweaver isn't free so we tend to steer clear (plus I hate it) - never the less, I put him on a machine with it on and gave him a chance. Two minutes later he called me over because he couldn't connect to the database. It turns out that he could only use the drag and drop functions, which requires a connection to the database.

Now - as I'm sure you can appreciate - most production web servers with a database running on the same machine will ONLY allow access to the database locally. This is for several security reasons. In that example it cost him the job, and I highly doubt anywhere else worth their due would take someone on who can only do drag and drop stuff.

I do realise that you're probably not looking to make a career out of this or anything like that, but it is handy to know, especially if you're in the IT industry. If you know one programming language it's only the syntax that you really have to learn to get to grips with another.

Another valid point is what happens when the code doesn't work and you get errors? The drag and drop system isn't going to just fix it for you, that's down to you, and if you don't understand what it's doing you're not very likely to get very far and people won't be as willing to help.

In conclusion; learn PHP and steer clear of drag and drop systems. :)

Re: php / asp.net

Posted: Fri Jun 05, 2009 4:48 pm
by langy01
Many thanks for the reply, just the sort of answer I was after.

Even with my varied role I have always sought to try and learn to do things the correct way. I started web development many years ago using Word. Yeah you can laugh but it was a start until I wanted to add the java script like onmouseover etc which word just stripped it out. Then went to Notepad which eventually became a real pain with nested tables etc. So I tried Front Page which at the time was pretty good until I eventually came across Dreamweaver which was far better. Even now I still use Dreamweaver as it is ideal for certain area like where you create a template page that on a simple change like a menu item will go through and update all your pages. However for the coding like creating reports etc from myswl I tend to use PSPad which is far better than Notepad as the syntax is all colour coded.

OK now for the next step then.

I'm quite happy with the basics of PHP, yes I'm no master but keen to move on to better content. If you look at my website, link in my signature below (don't worry about the content) you will see that I have created (well what I think is) a professional looking site. Its plain with no gimicky things flashing away etc to confuse the user. However I would like to add to the site to make things look that little better.

Can you recommend any links where I could find some tutorials etc to create that better formatting? I suppose what I'm looking for is a way to create that better report layout, the change from typing in a date to creating a calendar control etc etc.

Again many thanks for the reply. Not many people are lovers of MS as we all slate them but at the end of the day we have to use a lot of their software for certain things so I didn't really need someone to rant on about MS on this question. After all I was asking for the equilavent to move away from MS.

Paul

Re: php / asp.net

Posted: Fri Jun 05, 2009 7:32 pm
by mikemike
Hi Paul,

Firstly I'd like to say that your site looks fine, especially considering your experience. Thumbs up.

Your thinking of the Dreamweaver templating is well placed but I would like to make light of my findings over the years. I, like a lot of web developers, began by using Dreamweaver (well, HotMetal Pro first). I too dabbled with the templating system, and it worked great at first. I did find though that in the long term it caused me more hassle than it was worth. Template files were lost, leaving me to edit each individual page in Notepad (DW won't let you edit the content outside of the set areas), a strenious task, especially when the reason I was using template files in the first place was because it was a huge site. A few similar experience were had by me over the years.

In any case, I have moved away from that a long time ago. For smaller sites that don't require a framework I tend to use my own sort of templating system. Due to the nature of my work 99% of the websites I make are all in the same sort of format - they may look completely different, but as far as the HTML layout goes, they're relatively similar. Just like yours my pages are broken down into:
- META info (title tag, keywords, description, etc)
- Top part of the design
- A menu
- Content
- Bottom half of the design / footer

The only thing that changes from page-to-page is the content in the main div, and from what I can tell from your DW templates in the source code, your do too. So what I tend to do is put these chunks of code into seperate files. I normally just have 'designtop.php' which includes the meta info, top half of design and the menu, and 'designbottom.php', which has the bottom part of the design / footer. You can break it up into as many files as you want. I then include the two files into each content page and put my content in between them. So, instead of...

Code: Select all

<html>
<head>
  <title>.....
  <meta ...
  <meta ..
</head>
<body>
  <layout divs>...
    <menus />...
      <content />...
  </layout divs>...
</body>
</html>
I'd simply have:

Code: Select all

<?php
include('includes/designtop.php');
?>
blah blah blah content here
<?php
include('includes/designbottom.php');
?>
Then when I need to make a change to the layout I just edit one of two files (and the stylesheet).

As for your user-interface. I'm no expert, I'd be the first to admit that, but I do know the principles. Your website seems to be made up of primarily one colour, the pale green. Normally you would select a pallette of 3-5 colours and use them throughout. I'm not saying use green, red, blue, yellow and orange, simply different shades. Something like Kuler may be of use to you.

If you're used to Notepad then you'll find any half-decent IDE a great help. Personally I use Eclipse or phpDesigner - Eclipse is free and so far I haven't a bad word to say about it.

As far as tutorial sites go, when I first started I bought myself a book on the abolsute basics - but you're well passed that stage by the sounds of things. I then went on and did a few PHP and MySQL tutorials so I could begin to get to grips with things even more. I used various sites back then and I have no idea of any of their names I'm afraid - it's probably all outdated now anyway. I found the best way to learn was to give myself a project and to make sure I completed it. There's no worse habbit to get in than leaving projects unfinished.

Hope some of this has helped

Re: php / asp.net

Posted: Fri Jun 05, 2009 8:11 pm
by langy01
Thanks for the reply Mike.

At the moment I'm quite happy with the template files, yes I know it is a pain altering the non editable parts but I mainly use Dreamweaver for the templates, css, sync the site so I have a local copy and just the visual changes. Its easier to type the content in Dreamweaver in the design view and leave the codeing sie to PSPad. I will make a note of the way you do it as I need to use the included side more at a later date.

I also take your point about the colours. I do prefer the green as it suits the subject matter. I have used a darker green for the mouse over on the menu and a lighter green on the google ads. Other than that I couldn't really think of where else to use different shades. Its back to the old saying "simpler is often better" as it is far too easy to start doing too much and the site then looks too gimaky and a mess.

The main question about the tutorials was because of the 2 latest pages I have added, the 2008/9 models. The report still looks a mess, I didn't want to have everything in a bordered table as there are far too many lines, so I have used list views and borderless tables. I'm not happy with the result so may go for a larger table as yet and maybe use different background colours for the headings and nest the models in a seperate table that can then be bordered.

At the moment I have no use for a calendar control but it looks like I will have to google on how to do it just so I can see how the code creates the control and maybe get ideas for other things.

Thanks again.

Paul

Re: php / asp.net

Posted: Sat Jun 06, 2009 10:44 am
by mikemike
As far as your lists go, one of the main criticisms would be they're too large. I don't want to have to go scrolling and scrolling to look for something. Perhaps break them down into categories and have them click through to a list of products purely for that category? Maybe add a search bar? Pretty easy to do if it's already stored in a database.

Re: php / asp.net

Posted: Sat Jun 06, 2009 3:31 pm
by langy01
I think what I may do is put on links at the top of the page so that you can go directly to a Manufacturer. The whole point of the list was to be able to see everything all at once. There is already an extensive search on the What Caravan page.

At the same time I'm also trying to get in with the google ratings which is a long slow process, but another idea there along with this issue may be to include the google search on the site as it grows more.

Paul

Re: php / asp.net

Posted: Sat Jun 06, 2009 6:27 pm
by mikemike
If you want to increase your SEO (search engine optimisation) then having a well laid out website will help a lot. Google doesn't see a massive page of content and think "Excellent! Bump him up a bit", it'll prefer it if it was nicely categorised. It's also easier for search engines to work out whats in each page if they're categorised and linked correctly. Also, if SEO is on your mind, you should check out mod_rewrite for clean URLs. Just Google it and there will be loads of tutorials. It's dead easy and helps a lot.