Home Links
Home Page
How to us to correct the person who has entered
Yandex - like search by the hands
Stemmer.
Creation of sites - model of qualitative imposition
Entrance parameter of function is the file from six elements
Promotion of a site in Rambler
The good design should make a profit
Validnost` HTML
Perenapravlenie mistakes in a browser - 100 % as in PHP
Terrible animal the traffic
Cajt with help HTML:: Mason
Choice of the module
Bases of
Creation of a site
Adjustment of a site
TT - the counter of the traffic
GetCurrBytes
OnOverflow
Small improvements of our counter
 

Validnost` HTML

I about what I shall speak can is not right also, is not of great importance, but me nevertheless surprises, why very few people adheres to standard HTML. Has walked on several very known portals with the purpose of check of correctness HTML of a code: any site is not validnym. Yes, I know that all conducting{leading} manufacturers of browsers aspire to add something, receding from the standard that the documents made under their browsers were correctly looked only in their product. But the most interesting, that generally sites not validnye not because they use what that features of browsers, and simply do not observe standards. Moreover, all is done{made} so that was correctly displayed everywhere. It is asked: unless it is difficult to achieve correctness in that case?


It appears, all is simple enough. As it was found out at testing sites by service http://validator.w3.org/, the most part of mistakes is attributes tegov, absent in the standard, and also not khvatka attributes tegov. Situations when is missing tegi, too are present, but them is smaller. And more often they arise because of laziness of the designer instead of because someone did not know, that they need to be closed (logic of the idler: what for to put </p> if the following teg <p> will close previous automatically). The same laziness forces to leave values of attributes without inverted commas though under the standard they should be practically everywhere.

Let's consider an example. The rectangular area in height of 30 points is necessary for us. We on a habit write:



<div height = "30"> the text </div>


Actually it is not correct. At tega div there is no attribute height though as appeared, all browsers of it{him} support. How to be, if such height is necessary? There is nothing easier. It is necessary to specify height in style:



<div style = " height: 30px "> the text </div>


Absence tega arises on tegakh img and script more often. According to the standard, the attribute alt for tega img is obligatory and even if to the image any inscription is not necessary, it{he} all the same needs to be specified, how an empty line. The forum made on forumnom a cursor came across me. The person has simply established it{him} and has changed a pair of pictures. The cursor has been written competently in the plan validnosti and two wrong pictures "have simply dropped" all correctness.


One more category nevalidnosti when the designer does not pay attention to concepts block and line tegov, to be exact that block tegi it is impossible to put in line. An example of incorrect arrangement tegov:



<font size = "2">

<p> Paragraph 1 </p>

<p> Paragraph 2 </p>

</font>


Here we try block teg p, to enclose in teg font which can be applied only by the line. The output{exit} is simple. It is necessary to define{determine} besides the container inside which the set font is established:



<div style = " font-size: 10pt; ">

<p> Paragraph 1 </p>

<p> Paragraph 2 </p>

</div>


If nevertheless you have decided to make the site "correct", it is necessary to take into account, that the site can include foreign pieces of a code which do not satisfy to standards. It is every possible counters more often. Each counter is desirable for checking up, and if he not in the standard to try to modify itself it{him}. It not always is possible{probable}. For this reason I, for example, have refused counter SpyLog. And at top.mail.ru counter correct. In a case with denezhkoj a Yandex, I have simply cleaned{removed} the link, having left only a picture.


And more. Get for check by the Opera. In her by the right button it is possible to start validator, not being engaged in tiresome copying and an insert.


We pass with PHP on Perl as it is sad...

PHP, certainly, language good... Anyway, syntax at him{it} on the order is easier and clearer, than at Perl. And it is less than designs / instructions. This advantage. For example, in Paskale it is even less than designs, but it does not prevent him to be called almost that as one of most algoritmiziruemykh languages.

With what very unpleasant each programmer who passes on Perl collides{faces}? Certainly, with that, that mistakes of a script are deduced in log'? the server, instead of is direct in a browser. Also it is impossible to switch in any way it (is, the truth, one standard module with loud parameter fatalsToBrowser, but in browser he deduces only these most fatals, and preventions{warnings} - still in broad gullies). In PHP mistakes are by default deduced there, where also the usual data.

Following vile property Perl - constantly to give out 500-? a mistake. For details, ostensibly, address to broad gullies of the server. Aga, now... And this most 500-n a mistake is given out that any print has slipped before a conclusion of heading "Content-type". In PHP nobody will slip earlier it{him}. Because there it is traced: if something is printed, and the heading no, in the beginning peredaets I heading "Content-type".

Now about management of variables. In PHP any variable begins with "$". Any there vile, "%", "?" and other symbols for variable different types. They - vestiges JUniksovskogo shell-? (who has not experienced, see the adjusting file Apache written on csh - he borrows{occupies} about 100 KB). What for they to the interpreter? He in fact and so knows who is who.

Processing of forms. Perhaps, in PHP she works almost ideally. And it is fast. And with support of files (the truth, only one-dimensional). And also with support zakachki - now for the organization upload-? it is necessary to do{make} in general anything - sit and wait, while the file will not come, and then take away it{him} from a time directory.

Databases. To address to databases, it is necessary to use modules, many of which have simply phenomenally big size, that, certainly, affects speed. And in PHP support of a DB is built - in. There is practically full set of functions for job with almost all databases known to mankind. For all occasions.

If the soul would like universality, very quickly you refuse deducing{removing} pages by means of scripts through the operator print. For example, so:



print " Content-type: text/htmlnn ";

print " <html>

<body> n ";

print " <h1> Hello! </h1> nHere is the numbers: ";


for (my $i=0; $i <10; $i ++) {

print $i;

}

print " </body> </html> ";


This variant, certainly, does not climb in any gate. And what if it is necessary to make redesign? It is better to be hung up at once. At the same time, in PHP it is possible to combine usual html-takst with a code of a script. For example:


<html>

<body>

<h1> Hello! </h1>

Here is the numbers: <? for (my $i=0; $i <10; $i ++) {print $i;}?>

</body>

</html>


I think, to list{transfer} enough, than PHP it is better Perl-?. It will be more interesting to see, where he is worse. So...

Surprising sluggishness. So, the empty cycle in PHP is carried out in 70 times more slowly, than in Perl. eguljarnye expressions work in 10 times more slowly. Line operations - approximately in 5 times more slowly. And as soon as they have managed so to write?..

In general any support modul`nosti. To tell the truth, she{it} can be organized all the same manually, and then to work with "modules", almost as in Perl. But it turns out very slowly. The basic execution time of a script appears spent on connection of modules.

Little bit unfinished interpreter. So, if function returns a file, we cannot address to it{him}, say, to the fifth element with help Func (10,20 [5] - only through an intermediate file. But, by the way, it is not too burdensome.

Perhaps, all. Only two large lacks, but what...

More recently I was convinced, that all advantages PHP can be realized on Perl (unless clear syntax we never shall receive). Similar, did not remain anything such in what PHP would be irreplaceable. In brief I shall list the basic realized opportunities: