basic in the new msx

Pagina 4/12
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9

Van Arjan

Paladin (782)

afbeelding van Arjan

06-07-2005, 23:00

OO *shouldn't* be put in a next MSX-BASIC, since OO is even too hard for the average programmer (I remember fellow students who didn't understand it at all, also says something about the education level Tongue), for starting programmers it would be way too hard. Although simple data structures would be nice to have.

*offtopic*
it seems you would need to look at VB.Net a little better (although, don't do that, just use c# if you need to do something in .Net). VB.Net does have string classes and "myLength = myString.Length" works perfectly fine. Of course, you can still use "mylength = Len(myString)" but that's more a legacy thing that should've been dropped...
*/offtopic*

Van wolf_

Ambassador_ (10088)

afbeelding van wolf_

06-07-2005, 23:10

For what it's worth: you shouldn't teach OO, you should let them coders find out themself. Smile Let them make some app with many different things, let them make something big. Eventually they could come up saying things are getting messy.. if you're lucky they even have a slight idea how to solve it. If you're very lucky they're already referring to OO without knowing they're referring to OO.

The thing that goes wrong in some books is that OO is explained with stupid small test programs, as a n00b-coder you can't see the benefits of it then. Those books rarely explain how programming big projects works..

(imho)

Van Arjan

Paladin (782)

afbeelding van Arjan

06-07-2005, 23:15

Then you're reading the wrong books...

Van SKiLLa

Expert (114)

afbeelding van SKiLLa

07-07-2005, 02:12

You're absolutely right about that Wolf; one just has to see the light, but I see a lot of newbies over-designing their apps |-(


it seems you would need to look at VB.Net a little better (although, don't do that, just use c# if you need to do something in .Net). VB.Net does have string classes and "myLength = myString.Length" works perfectly fine. Of course, you can still use "mylength = Len(myString)" but that's more a legacy thing that should've been dropped...

But the legacy is not dropped, it's a feature, that's my point ! In some respect VB.Net's power is also it's weakness ...
VB.Net is a more (VB-like) task-/procedural-based language which facilitates the use of OOP, but it doesn't require it (in a OO-based CLR).

It's legacy with VB is a good thing in some cases, especially for migrating to the .Net framework, but the VB.Net language & syntax are rather 'unfortunate' ...from a designers-viewpoint it leaves extra room for inconsistency compared to other languages.
C#, J# (or no .Net: Java) with their stricter syntax and more consistent language might be more appropiate.

The less stuff to worry about, the better ;-)

If we're talking about a new MSX-Basic version I'd still prefer something like JavaScript (it's easy but powerful enough !),
a good editor/IDE and inline-asm support like Turbo Pascal / Delphi. And ofcourse at least at KUN-BASIC speed ;-)

Van Arjan

Paladin (782)

afbeelding van Arjan

07-07-2005, 08:54

SKiLLa, it seems I misinterpreted your post and took some things too literally... Maybe my mind got corrupted by programming to much in VB/VB.Net Tongue I agree that VB.Net should've gotten a stricter syntax, no legacy VB stuff. If they can support it in the compiler (which translates Len(myString) to myString.Length anyways) they surely could've written a decent program to migrate old projects. Although not supporting legacy in VB.Net would've meant there's no need for VB.Net because otherwise it's mostly just a more verbose language.

JavaScript would be cool to have on MSX, I prefer it over any BASIC variant (well maybe not over VB.Net (mainly because of the framework behind it), but if I had the choice I would use C# instead of VB.Net). It's even possible to do OO'ish things in it Smile

Van Tanni

Hero (556)

afbeelding van Tanni

07-07-2005, 12:53

I stick to my previous points: NO object orientation in our BASIC Smile
I agree!

Furthermore: more clarity to the dangling 'else'-clause of the if-then(-else)? statement, while is not necessary, as we have IF and GOTO Wink

If I got you right, you mean a nested IF-statement? Then, we would need block markers like begin and end like in Pascal. This wouldn't be BASIC anymore. So I agree, we have IF and GOTO, even if it's not
good style in other languages.

Van wolf_

Ambassador_ (10088)

afbeelding van wolf_

07-07-2005, 13:12

but WHY do you want basic to stay 'oldfashioned' even if MANY other basic-variants have such things as block-if, select, functions etc. etc. ? It's not blasphemy to update basic orso..

Van snout

Ascended (15187)

afbeelding van snout

07-07-2005, 13:19

Perhaps because an 'old-fashioned' BASIC is just what it is: a great stepping stone into the world of programming. If you introduce more structure/OO stuff in it, surely an advanced coder will be able to do much nicer things with it, but a complete beginner (especially youngster) will not be very keen on learning the language anymore.

Take your example:

Class Window

  Private

    Field A
    Field B#
    Field C%
    Field D$

    Function MyFunction(Look!, Rare!, Neverbeenused$, W00000T#)
    End Function

  End Private

  Public
    Field F!

    Function MyFunction2$(ForSale#, Amount_of_Boblets)
    End Function

    Function MyFunction3#(Ebay_comission, Tax)
    End Function

  End Public

  Constructor(x,y,z=1)
  End Constructor

  Destructor
  End Destructor

End Class


M33P=ApplyClass(Window)

M33P.MyFunction3(1,2)

M33p.Destructor()

End

If MSX-BASIC would have looked like this when I was a 5 year old, I would never have coded a single line of MSX-BASIC on it. Beginners want the 10 PRINT "HEY, THIS WORKS! ": GOTO 10 stuff Wink So please, no declaring variables, block-if, procedures, functions or o.O in the default BASIC. It is very likely to scare people off. A more structural, powerful BASIC might be a great second step in the world of coding tho Wink

Van [D-Tail]

Ascended (8263)

afbeelding van [D-Tail]

07-07-2005, 14:40

I don't imply block-IFs with my remark 'properly nested IF-statements':

10 A=2:B=3
20 IF A=2 THEN IF B=3 THEN PRINT "A=2 and B=3" ELSE PRINT "A=2" ELSE PRINT "A<>2"

Two else clauses after another, thus ensuring proper nesting. It's easily done, and intuitively, it works like it should. It's a real pity that this ELSE-behaviour hasn't been implemented.

Van wolf_

Ambassador_ (10088)

afbeelding van wolf_

07-07-2005, 15:22

snout: you don't HAVE to use those classes! If you're 5yo, and you want to type 10 print"elephant":goto 10 then you can!
Those classes should be (and *are*, even in c++) an addition. Even in c++ you may make the most horrible spagetti code if you want to..

But really, *how* do you know that a 5yo kid is scared by this:

IF snout=MSXguru THEN
' do something
END IF

.. did you ask them? WHY do you think this is so unreadable?

10 IF snout=guru THEN GOTO 20 ELSE GOTO 50
20 '
30 '
40 '
50 <continue>

I don't know about you, but I do know what I think about that alternative Smile

Pagina 4/12
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9