Computers and people: which has more accurate formatting?

Computers and people: which has more accurate formatting?

Author
Discussion

dilbert

7,741 posts

232 months

Wednesday 13th February 2008
quotequote all
Globulator said:
I'm not sure I 100% understand what your app is, would I be right is guessing it is a client-server document access system, via http, akin to the web but using a different protocol to the usual HTML/CSS?

If it powers a website I'd be interested to have a look-see!
That's pretty much the size of it. It could be HTTP, but it's not, although it might yet be!!!

The FIR Stuff hasn't been compiled recently, it's a way off being finished and not on the critical path at the moment. I'm just going through the first compile since I've been working with Vista and a new compiler, so I've had to clean up a bit. I have posted a screenshot here before, but another might appear here in a while, and it has changed a bit as a result of the move to vista.

Edited by dilbert on Wednesday 13th February 16:49

cottonfoo

6,016 posts

211 months

Wednesday 13th February 2008
quotequote all
Globulator said:
Perl of course enforces brackets
How and when?

Globulator

Original Poster:

13,841 posts

232 months

Wednesday 13th February 2008
quotequote all
ginettag27 said:
Globulator said:
For instance, an italic item will be [i]this is italic[].

I agree that you cannot do something like:
<b>bold <i>and italic</b> or just italic</i>

- but no one ever does that. To get the same effect you would just use:
[b]bold [i]and italic[][][i] or just italic[].
consider the following :

<b> this is in bold<i> this is in italic and bold</>this is in?</><i> this is in italic</>

How do you know what to render "this is in?" in? is it in bold or italic or neither?

The only way around that would be to make compulsory start tags, which would be a pain and a backwards step imo.

Alternatively why have a fullstop at the end of a typed sentence? Why don't you just say that a typed sentence ends when you come across a capital letter?

Apologies if I've got the wrong end of the stick...
It isn't the wrong end of the stick at all - it is in fact the problem!

This thread was opened in website feedback - someone moved it here instead.

The problem I see is that this website (PH) uses end tag names. Except it doesn't check them, and reject the post, it just munges through.

So my observation was:

Why bother assigning any meaning to end tags at all?
Particularly as they are not checked, but lay dormant.
- I realise they are checked to add the effect, their syntax is never checked.

i.e.
Either A) Check the end tags and reject syntax errors
or B) Do not check the end tags and just use the start tags + a stack.

Outside of this thread I'd be intrigued to see any intentional and correct tag overlap in the whole site. So we all dutifully type in our closing tags - but when we are talking with a giant computer, easily capable of doing that for us, why do we have to do it?

<b> (turn on bold)
this is in bold
<i> (turn on italic)
this is in italic and bold
</> (turn off the last one (italic))
this is in?
</> (turn off the last one (bold))
<i> (turn on italic)
this is in italic
</> (turn off the last one (italic))

I was going to accent the above with formatting, but it seems the formatting does not go multi-line for the [i] and [b] codes.

[b]bold
fails[/b]

Sheesh!!

Globulator

Original Poster:

13,841 posts

232 months

Wednesday 13th February 2008
quotequote all
cottonfoo said:
Globulator said:
Perl of course enforces brackets
How and when?
Try:

if ($a == 0) $b = "hello";

in Perl, and you'll see smile

cottonfoo

6,016 posts

211 months

Wednesday 13th February 2008
quotequote all
Globulator said:
Try:

if ($a == 0) $b = "hello";

in Perl, and you'll see smile
You mean braces rather than brackets? For simple statements:

$b = "hello" if $a == 0;

No brackets or braces smile

Globulator

Original Poster:

13,841 posts

232 months

Wednesday 13th February 2008
quotequote all
cottonfoo said:
Globulator said:
Try:

if ($a == 0) $b = "hello";

in Perl, and you'll see smile
You mean braces rather than brackets? For simple statements:

$b = "hello" if $a == 0;

No brackets or braces smile
Braces, yes.
I did forget the terminating if, thank-you for reminding me of another reason why I don't go back to Perl biggrin

cottonfoo

6,016 posts

211 months

Wednesday 13th February 2008
quotequote all
Globulator said:
Braces, yes.
I did forget the terminating if, thank-you for reminding me of another reason why I don't go back to Perl biggrin
It can be interesting but I enjoy it. $a and $b are also bad variables to bring into existence, unless you are sorting, because they are majik smile

But anyway, back on topic, I like closing tags because debugging would be a nightmare otherwise. Also possible to overflow the stack.

dilbert

7,741 posts

232 months

Wednesday 13th February 2008
quotequote all
I said I'd post....
It's working now!!!

Globulator

Original Poster:

13,841 posts

232 months

Wednesday 13th February 2008
quotequote all
cottonfoo said:
But anyway, back on topic, I like closing tags because debugging would be a nightmare otherwise. Also possible to overflow the stack.
As someone who has used empty end tags format content exclusively on two websites (and several more sub-sites) I'd have to disagree;- from experience debugging it has been stunningly simple.

If you used an array in PHP (which is what I do) or a linked list in C/C++ then you'd run out of memory for other reasons way before that time.

How many format levels do you use? 100, 200. This post used only 1 smile

I'll admit the concept is a little 'out of the box', but I've tried it now and it works a treat, and is an absolute joy to enter.

cottonfoo

6,016 posts

211 months

Wednesday 13th February 2008
quotequote all
What do you do about self-closing tags like img, input and br? You'd still need a DTD to successfully parse that markup (but perhaps you have one).

Globulator

Original Poster:

13,841 posts

232 months

Wednesday 13th February 2008
quotequote all
cottonfoo said:
What do you do about self-closing tags like img, input and br? You'd still need a DTD to successfully parse that markup (but perhaps you have one).
I merely convert from my forum-text standard (cutetext - albeit a little ad-hoc) into XHTML, I don't go the other way very often (except in JS wysiwig editor, when I go from design mode to cutetext - but that's another thing altogether + it's client side smile)

Globulator

Original Poster:

13,841 posts

232 months

Wednesday 13th February 2008
quotequote all
dilbert said:
I said I'd post....
It's working now!!!
Now THAT is interesting.

Mmmmm. We have product alignment.
Still about 3-4 weeks away, but yes, very close to what I'm doing, but complimentary, not really overlapping. Which is nice.


PM me, we should chat thumbup

zaktoo

805 posts

208 months

Thursday 14th February 2008
quotequote all
Globulator said:
...another reason why I don't go back to Perl biggrin
Yikes! You prefer php to perl? I believe they prescribe pills for that sort of thing! ;-)

Globulator

Original Poster:

13,841 posts

232 months

Thursday 14th February 2008
quotequote all
zaktoo said:
Globulator said:
...another reason why I don't go back to Perl biggrin
Yikes! You prefer php to perl? I believe they prescribe pills for that sort of thing! ;-)
Yes I keep taking the pills smile


It's the little things, all have a way around, but I can't be arsed with a way round when php doesn't need it..

Like..
Local variables that stay local
Function parameters with names
Function parameters you can plop an array in the middle of, and it doesn't break it
Simple references in function parameters
Integrated regular and associative arrays
Functions for preg_grep, preg_match, preg_replace
On the web - a superb manual + examples + discussion at php.net
On the web - errors shown to you in the browser - not in /var/log/warnings
phpinfo();
Proper statements (you always need '{' braces with Perl
A Switch-case statement
Comments with # /* and // all work

It all adds up to a readable program that saves so much time over perl.
I started with perl and wrote quite a lot with it, then I discovered PHP and realised it was a whole lot easier to get results with. It has benefits both for command line scripts and on the web. I just spend far less time debugging the stuff really.

I've never understood why some people think perl is better - please elaborate biggrin