A silly question :P

BlitzMax Forums/BlitzMax Programming/A silly question :P

Takis76(Posted 2015) [#1]
Hi,

I would like to ask a silly question.

What is the difference between "endif" and "end if"

:)


xlsior(Posted 2015) [#2]
What is the difference between "endif" and "end if"


Functionally, absolutely nothing -- they do exactly the same.


therevills(Posted 2015) [#3]
There are no silly questions :)

As Xlsior stated, there is no difference between "endif" and "end if".

It's up to you to use which ever coding style you like. I prefer using "endif" as I like compact (but readable) code:

If x > 10
    Die()
EndIf



Matty(Posted 2015) [#4]
There is probably one difference (which wont make any difference to the machine code generated) and that is if for some reason you need to use a standard text search on your source code then things like this can be a bugger if you are not able to find what you are looking for because youve been inconsistent in your code.


H&K(Posted 2015) [#5]
There is no fundamental difference, however if the syntax in a language is "endif" then you have to put endif but if the syntax is "End If" you can often miss the if and the language will "end" whatever programming structure you are in.
To complicate it/ or simplify it more the IDE can arbitrarily have decided which is correct or both, and insert one or two tokens.


Yasha(Posted 2015) [#6]
if for some reason you need to use a standard text search on your source code then things like this can be a bugger if you are not able to find what you are looking for because youve been inconsistent in your code.


That's what the gods created regex for.


Takis76(Posted 2015) [#7]
I use blide IDE for Blitzmax and when I am writing the endif it changes it to end if.

Maybe if I change all end if to endif I will save one byte for space character :)


H&K(Posted 2015) [#8]
lol you aint programming on a zx80


Takis76(Posted 2015) [#9]
What is the zx80? (It reminds me a very old computer).


H&K(Posted 2015) [#10]
Deleted


H&K(Posted 2015) [#11]
a very old computer
Go on guess from when.

Its probably most famous now for not being able to run programs and show display at same time :-o
(And after display memory it had 384 ..... bytes for program AND variable space) - Each command(ish) was one byte, Variables were Two plus the value I think, and numbers were Five

Hence one byte was important.

You would change your numbers to variables to save bytes


Xerra(Posted 2015) [#12]
I remember the ZX80 having some strange thing with the display but didn't realise it was that bad. I can't even rationalise how you could get a keypress in a program if the screen was blank while running so the user had no idea what he was meant to do.

To give you an idea of how little the memory was in a ZX80, you can probably just imagine that this post alone would fill it.


H&K(Posted 2015) [#13]
I think one of he problems in allowing you to rationalise it it that nowadays if I asked you to think of a computer you imagine (in general) a tablet, or a laptop, or a monitor and Keyboard.

That isn't the image of a late 70s computer. A late 70s imagining would either talk to you, or ticker tape answers which some secretary would then type into the display.

I think (and I may be wrong) that the Computer before the zx80 didn't even have a keyboard, just eight on/off switches and a button.

Its no more strange than cars without starters motors or you couldn't get citrus flavoured yogurts.


xlsior(Posted 2015) [#14]
I think (and I may be wrong) that the Computer before the zx80 didn't even have a keyboard, just eight on/off switches and a button.


It didn't have a monitor either, just a row of LEDs representing the output of the program.

The Altair 8800, the computer that launched the microcomputer revolution -- the first programming language for the Altair also happened to be the very first program created by Microsoft: Altair BASIC, in 1975.




H&K(Posted 2015) [#15]
It didn't have a monitor either


The point of my post was "Computes didn't have monitors and this one didn't have a keyboard either"
So not having the monitor didn't really need backing up ;)

Also, as its a famous story the first program created by Microsoft wasn't Altair BASIC for the 8800, it was a "virtual" machine software simulator of the Altair 8800 for them to write and test Altair BASIC on


Takis76(Posted 2015) [#16]
And I thought the first Microsoft program was PCDOS.


AdamStrange(Posted 2015) [#17]
Hmm, not strictly true there:
Microsoft first licensed, then purchased 86-DOS from Seattle Computer Products (SCP), which was modified for the IBM PC by Microsoft employee Bob O'Rear with assistance from SCP (later Microsoft) employee Tim Paterson.[8] O'Rear got 86-DOS to run on the prototype PC in February 1981. 86-DOS had to be converted from 8-inch to 5.25-inch floppy disks and integrated with the BIOS, which Microsoft was helping IBM to write. IBM had more people writing requirements for the computer than Microsoft had writing code. O'Rear often felt overwhelmed by the number of people he had to deal with at the ESD (Entry Systems Division) facility in Boca Raton.

IBM didn't want anything to do with creating DOS and went outside to find it.


H&K(Posted 2015) [#18]
@Takis76,
Everyone forgets that microsoft had been in business for eight years (Three as Traf-O-Data), before PCDOS.
Case in point is that they had a version of Unix, called Xenix.