You want to learn programming?
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    MarK
    Posts: 641 from 2004/1/25
    From: Prague, The Cz...
    Okay, I'm at last home, and so I wrote the small example of the calculator. (sorry, javascript can't create correct link in ibrowse) :-( There is the executable (http://www.tbs-software.com/powerd/mui/calc), small grab (http://www.tbs-software.com/powerd/mui/calc.png) and the sourcecode itself (http://www.tbs-software.com/powerd/mui/calc.d) in PowerD... It's comment free, I suppose, that for basic comparation it's useless to write comments...

    Bye, MarK.
  • »12.02.04 - 18:53
    Profile
  • MorphOS Developer
    itix
    Posts: 1516 from 2003/2/24
    From: Finland
    I added simple notifications to my calculator and it is usable now :-)

    Grab source code here

    Removed decimal point to keep it simple :-D

    Have fun!
    1 + 1 = 3 with very large values of 1
  • »12.02.04 - 19:10
    Profile
  • MorphOS Developer
    itix
    Posts: 1516 from 2003/2/24
    From: Finland
    TheMagicM: there was a link in the word "here" but here they are again:

    Calculator.lha
    Calculator2.lha
    1 + 1 = 3 with very large values of 1
  • »12.02.04 - 19:13
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    TheMagicM
    Posts: 1217 from 2003/6/17
    LOL!! I couldnt see a different color indicating a link..hahaha I will check it out.. THANKS!!! :)
  • »12.02.04 - 19:49
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    tokai
    Posts: 1289 from 2003/2/25
    From: binaryriot
    @itix:

    to be honest: this is a bad example. Using RETURN_IDs might be more easy for beginners, but I don't think it's good to learn outdated programming style. I know that a construct using classes, methods and attributes looks more difficult for the beginner (I was at the same point not long ago), but IMHO it's better to learn the right stuff in the beginning than to get used to some unsuitable programming style.

    but thx. for your effort, but I hope we'll see a proper example soon. Thanks. :-)

    regards,
    tokai
  • »12.02.04 - 20:13
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1516 from 2003/2/24
    From: Finland
    Quote:


    Nice and fast work with that simple calculator, but I see, You don't use macros too much, this example can be written simplier (shorter=faster) using SimpleButton() macro



    Thanx!

    I think tutorial should avoid obscure macros as much as possible. Now when I used MUI_MakeObject() function call beginner can look into <libraries/mui.h> for more object types.

    The biggest downside in MUI documentation probably is lack of documentation for macros.
    1 + 1 = 3 with very large values of 1
  • »12.02.04 - 21:01
    Profile
  • MorphOS Developer
    itix
    Posts: 1516 from 2003/2/24
    From: Finland
    Quote:


    to be honest: this is a bad example. Using RETURN_IDs might be more easy for beginners, but I don't think it's good to learn outdated programming style. I know that a construct using classes, methods and attributes looks more difficult for the beginner (I was at the same point not long ago), but IMHO it's better to learn the right stuff in the beginning than to get used to some unsuitable programming style.



    I know. But to keep it simple enough there wasnt choice. Using hooks is horror - lot of work to get stupidly simple function call done. MUI really needs MUIM_CallFunction method to do that.

    But I'm preparing better (and more complex) example which uses custom classing technique. Stay tuned! :-D
    1 + 1 = 3 with very large values of 1
  • »12.02.04 - 21:06
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    tokai
    Posts: 1289 from 2003/2/25
    From: binaryriot
    Quote:


    But I'm preparing better (and more complex) example which uses custom classing technique. Stay tuned!



    I didn't expected anything else from you! :-D

    Big thanks! I'll look forward to it.
  • »12.02.04 - 21:21
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1516 from 2003/2/24
    From: Finland
    Okay, implemented it how it *should* be done :-D It is not using ReturnIDs in this example anymore:

    Calculator 3 example

    Btw if you compare examples you will find out custom class version is smaller than ReturnID version although more typing is needed. In addition I've created two other examples how encapsulated custom class can be utilized:

    Calculator 4 example

    Screenshot for Example 4:
    Calculator4.png

    And finally I put 100 calculators in one window:
    Calculator 5 example

    And screenshot for Example 5:
    Calculator5.png

    :-D :-D :-D
    1 + 1 = 3 with very large values of 1
  • »12.02.04 - 22:09
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 261 from 2003/3/13
    From: Rotterdam, the...
    There's no real calculate code in it,
    but the source is very very nice and
    simple looking, i love powerd :)

    PowerD needs MOS support :)

    Bye,
    Felix.
  • »12.02.04 - 22:36
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 72 from 2003/2/25
    From: Auckland New Z...
    @Zylesea
    Well, it's more than just programming preference- it's what's best for Beginner/Hobbiest programmers, and C++/Java isn't good to begin with IMO.
    And yes I agree, having Amiga/Mos OS examples is very important, but having examples for beginners on how to program, the basics of C etc is good too. Ie: having complete programming community support for a platform is a major plus, just as it was for the Amiga.

    IMO, OO programming is really only relevant to big programmes- small programmes are really just a Class in themselves. Hobbiests will never need the sophistication of Classes. In my time using Blitz Basic, I've seen many people turn out to be great programmers, who would have given up, if they had to learn C++ or Java first up :-/
    We should remember, that the Amiga community always gave people an opportunity to learn programming, that otherwise never would have, if they tried to learn it at University- ie: starting with Java (not sure if they start with Visual Basic now though)!
    But saying that, I think we should teach OO techniques too, but start with Structured Programming first, with Functions etc. Functions and local variables, are the basic concepts that Classes etc are based on anyway.
    - Ants
  • »14.02.04 - 01:07
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 72 from 2003/2/25
    From: Auckland New Z...
    @Targhan
    Yes, good point on Hollywood! :-)

    @Corto
    For IP (TCP/IP) programming, you could use the Miami SDK, or the lastest AmiTCP one (the older ones are out of date, with some shorts instead of longs). As AFAIK Mos will be using a POSIX compliant stack (*NIX).

    For 2D game graphics, sound and joystick functions SDL is very good.
    - Ants
  • »14.02.04 - 01:17
    Profile Visit Website
  • News Moderator
    News Moderator
    Darth_X
    Posts: 571 from 2003/2/10
    From: Vancouver Isla...
    Quote:


    Coder wrote:
    Hi,

    Do I hear some volunteers for writing tutorials? ;-)

    Coder


    :-D
    When you have eliminated all which is impossible,
    then whatever remains, however improbable, must be the truth!!! - Sherlock Holmes
  • »16.02.04 - 18:00
    Profile
  • Butterfly
    Butterfly
    tomjoad
    Posts: 99 from 2003/2/24
    Quote:


    Ants wrote:
    @Zylesea
    Well, it's more than just programming preference- it's what's best for Beginner/Hobbiest programmers,
    and C++/Java isn't good to begin with IMO.



    Depends on. I wouldn't rule out OOP for beginners - it's a totally different philosophy than procedural programming. Knowledge of procedural languages won't really help to learn (good!) OOP.

    For learning decent OOP C++ and Java are indeed not all that great. C++ is a hybrid and I see lots of people doing things in C++ in a procedural way (like, using hooks where a factory pattern would be appropriate).

    Both languages don't allow to inherit type and implementation separately, I'd recommend to at least have a *look* at a language that allows this before starting to learn either. To see what happens when you don't know -> look at the Java library. Baad baad baad.

    Quote:


    small programmes are really just a Class in themselves. Hobbiests will never need the sophistication of Classes.



    There's much more to OOP than classes. You can well write (small or large) OOP programs without any classes at all. Classes are just part of one particular kind of OOP. Other concepts are much more fundamental to OOP as a whole than classes.
  • »16.02.04 - 19:40
    Profile