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.
Hard typing
Moderator: POL Developer
Re: Hard typing
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?
Re: Hard typing
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.
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.
Re: Hard typing
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.