Assembly vs. C++

I have just posted on my blog the reasons why I think [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-real-language/]C++ is the one true programming language[/link] (I am being slightly tongue in cheek here). I used 10 questions to compare it to other languages. Unfortunately I have not been able to compare it to assembly as I don

Comments

  • : I have just posted on my blog the reasons why I think
    : [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-
    : real-language/]C++ is the one true programming language[/link] (I am
    : being slightly tongue in cheek here). I used 10 questions to compare
    : it to other languages. Unfortunately I have not been able to compare
    : it to assembly as I don
  • : : I have just posted on my blog the reasons why I think
    : : [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-
    : : real-language/]C++ is the one true programming language[/link] (I am
    : : being slightly tongue in cheek here). I used 10 questions to compare
    : : it to other languages. Unfortunately I have not been able to compare
    : : it to assembly as I don
  • [italic]"The only thing assembly doesn't support is object orientation."[/italic]

    [color=Blue]I am creating OO Assembler right now.
    :-)[/color]
  • : [italic]"The only thing assembly doesn't support is object
    : orientation."[/italic]
    :
    : [color=Blue]I am creating OO Assembler right now.
    : :-)[/color]

    Haha... Brilliant :)

    Let me know when you've got a working beta (or alpha) version :P I want to try
    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • OO ASM?
    Kinda exists already.

    http://cs-netlab-01.lynchburg.edu/courses/Assemb/OOPAssem.html

    I have some more stuff saved, i couldn't find online right away. But there is/was.


  • OOP is a paradigm for use when designing software; it is independent of the language.

    Granted, some languages have built in mechanics to better support this paradigm, any software can still be object orianted, even in C and assembly if it is designed around the concept.
    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.mt2002.sitesled.com]Website :: OS Development Series[rightbr][/link][/size]
  • : OO ASM?
    : Kinda exists already.
    :
    : http://cs-netlab-01.lynchburg.edu/courses/Assemb/OOPAssem.html
    :
    : I have some more stuff saved, i couldn't find online right away. But
    : there is/was.
    :
    [color=Blue]
    I researched a lot of OO Assembly attempts before embarking on this project. I looked at TASM (horrid syntax, impossible to maintain or understand after some time), Objects Package in MASM32 (slow, virtual tables initialized at run-time!), HLA from Randal Hyde (too much - this is assembler, not C++ and syntax is the worst) and a few more.

    Main point: using macros it is impossible to get an OO principle working. I use different approach. More of HLA approach, but not that complex (no protection levels, please - this is a low-level language). I have a script (it looks like C#, but some internal pieces are in assembly), which will be pre-processed and turned into a 'real' ASM code. And then on the next step - it compiles with a 'normal' assembler.

    Here is an example:
    [/color]
    [code]
    class TWindow : TObject
    {
    data
    {
    HANDLE Win32Heap; [color=Green]# simple variable[/color]
    WCHAR Text [MAX_CHARS]; [color=Green]# array[/color]
    TCell Object; [color=Green]# instance of another class[/color]
    }

    method ctor
    {
    [color=Green]# todo: implement constructor code[/color]
    }

    method dtor
    {
    [color=Green]# todo: implement destructor code[/color]
    }

    virtual OnCmd
    {
    mov eax, me.Win32Heap
    mov edx, me.Object.member
    cmp eax, edx
    je ...

    ...
    ret
    }

    override ProvideData
    {
    call base.ProvideData
    call me.Object.virt.ProvideData
    add eax, 8
    ret
    }

    callback MsgMap (hWnd, uiMsg, wParam, lParam)
    {
    mov eax, prm.uiMsg
    cmp eax, e.WinMsg.WM_CREATE
    je ...


    Quit:
    call api.PostQuitMessage (0)
    ...
    ret
    }
    }
    [/code]
    [color=Blue]This is ^^^ a class in its completeness - no separation of definition and declaration, just one file per class, which is a good thing. Also, there are some syntax constructs describing the Win32 API, like these:
    [/color]
    [code]
    enum WinMsg
    {
    WM_CREATE = 1
    WM_DESTROY = 2
    ...
    }

    alias
    {
    HANDLE : dword
    WCHAR : word
    ...
    }

    api KERNEL32
    {
    PostQuitMessage
    HeapCreate
    ...
    }
    [/code]
    [color=Blue]
    And, of course IDE is in the package too with auto-complete and syntax highlighting and a few more things... like a class library, where one can re-use classes into different projects.
    [/color]
  • : I have just posted on my blog the reasons why I think
    : [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-
    : real-language/]C++ is the one true programming language[/link] (I am
    : being slightly tongue in cheek here). I used 10 questions to compare
    : it to other languages. Unfortunately I have not been able to compare
    : it to assembly as I don
  • : I think everyone should start learning how to program in some kind
    : of assembler first and then move on to a higher language. It will
    : make a better programmer out of you for sure.

    The other way around works too :)

    I agree that any programmer should know atleast a couple of languages - and C is definitely one of them. Furthermore, I also think C++ is a must. I would not say every programmer has to know assembly... I'll keep it to should ^^
    C and C++ suddenly became a lot more logical to me once I knew a bit of assembly language.


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • I personally think that alot of languages create too much abstraction; hiding the core basics of machine programming. They get to learn what programming is, and some concepts, and can even produce software focusing on the software's design itself.

    This is great, of course. After all, it does indeed increase productivity. However, as they are never taught the core fundamentals of machine programming, it makes it much more harder for them to grasp the concepts involved. (I have seen alot of BASIC programmers give up on learning C and C++ because they deemed it to difficult and confusing.)

    One of the reasons why I like C and C++ is because, while attaining abstraction, it is still low enough to control everything you want in it, without the headaches and problems of assembly languages (ie, portability.)

    ---

    Then again, it might just be personal taste. Some people may learn better from the core fundamentals, while others may learn better starting from abstract concepts learned from other higher level languages.

    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.brokenthorn.com]Website :: OS Development Series[rightbr][/link][/size]
  • : I personally think that alot of languages create too much
    : abstraction; hiding the core basics of machine programming. They get
    : to learn what programming is, and some concepts, and can even
    : produce software focusing on the software's design itself.
    :
    : This is great, of course. After all, it does indeed increase
    : productivity. However, as they are never taught the core
    : fundamentals of machine programming, it makes it much more harder
    : for them to grasp the concepts involved. (I have seen alot of BASIC
    : programmers give up on learning C and C++ because they deemed it to
    : difficult and confusing.)

    For practical purposes, abstraction is your friend. Could you imagine a software suite being written in a low level language like Assembly? It's possible ofcourse, but hardly do-able.

    However, every programmer should know the fundamentals - the core - of what programming is. I think it's part of the general education of a programmer.

    :
    : One of the reasons why I like C and C++ is because, while attaining
    : abstraction, it is still low enough to control everything you want
    : in it, without the headaches and problems of assembly languages (ie,
    : portability.)
    :
    : ---
    :
    : Then again, it might just be personal taste. Some people may learn
    : better from the core fundamentals, while others may learn better
    : starting from abstract concepts learned from other higher level
    : languages.
    :

    I started at a young age learning VB. I didn't understand a thing of the first 10 examples I programmed. But eventually, I understood more and more. It took me a long time to start with C and C++. Nowadays, I love C and C++ for the control you as a programmer have - pointers are my friend :D
    Just for practical purposes, I program VB because it's much more productive. It's just way too easy to create a decent interface to deny the language (ofcourse, with the .NET framework, when programming for Windows this is no longer an argument).
    But every time I went a step less abstract, I learned s
  • Thanks to everyone one for their replies and comments. I have posted my response to some of them as a comment on [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-real-language/]my original blog post[/link].

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories