Hard typing

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

Post Reply
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Hard typing

Post by OldnGrey »

Here is an eScript feature request that might just polarise the whole community- hard typing.
I just had a potential scripter tell me he didn't want to learn eScript because it doesn't have hard typing and it is an omission that caused him to have a lot of troubles debugging a script. I thought he was a bit severe in his assessment, but then I started thinking about variables in general and how we declare them. It certainly wouldn't hurt to have an optional compile feature that forced us to state the type of variable when we declare it.

We can certainly give initial values already - eg var Name := ""; and var Members := array;
but then the compiler doesn't care what you assign that variable name later and it's only really useful for you as a reference.

So, would it be worth it? I realise it's a huge task, but maybe we can have it enabled script by script so we can convert slowly.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Hard typing

Post by CWO »

This would be a disaster in certain scripts such as prop editors and such where the type isn't known before getting it. You'd have to add more functions like GetObjPropertyType and I'm sure some others for other types of variable returns. Plus with the addition of props, the compiler never knows what is in the prop so what would you do in that case?
Targun
Neophyte Poster
Posts: 30
Joined: Wed Jul 23, 2008 8:03 am

Re: Hard typing

Post by Targun »

Naaah, that's pointless. It wouldnt give PoL any new abilities as UO emulator.
It would be only useful to newbie scripters who have problem with debugging var type problems.
In my opinion implementing hard typing is just waste of time that could be spent on
making a decent escript guide for newbies.
Luth
Former Developer
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am

Re: Hard typing

Post by Luth »

I tend to agree; typeless variables is a design feature of the language, used to extend usability and functionality. That's what high-level languages are supposed to do. :) If the script he was writing was so buggy that type-checking was a major problem, then I think you'd be better off finding someone else to write for you. ;)
Post Reply