Author Topic: HLL Code doesnot make sense  (Read 9245 times)

Farabi

  • Member
  • ****
  • Posts: 968
  • Neuroscience Fans
HLL Code doesnot make sense
« on: August 24, 2012, 07:24:52 PM »
Code: [Select]
#ifndef __MYCPP_CLASS_H__
#define __MYCPP_CLASS_H__

class MyClassImpl;

class MyCPPClass
{
    enum { cANSWER_TO_LIFE_THE_UNIVERSE_AND_EVERYTHING = 42 };
public:
    MyCPPClass ( void );
    ~MyCPPClass( void );

    void init( void );
    void doSomethingWithMyClass( void );

private:
    MyClassImpl * _impl;
    int           _myValue;
};

#endif
MyCPPClass.cpp (PIMPL)

#include "MyCPPClass.h"
#include "MyObject-C-Interface.h"

MyCPPClass::MyCPPClass( void )
    : _impl ( NULL )
{   }

void MyCPPClass::init( void )
{
    _impl = new MyClassImpl();
}

MyCPPClass::~MyCPPClass( void )
{
    if ( _impl ) { delete _impl; _impl = NULL; }
}

void MyCPPClass::doSomethingWithMyClass( void )
{
    int result = _impl->doSomethingWith( _myValue );
    if ( result == cANSWER_TO_LIFE_THE_UNIVERSE_AND_EVERYTHING )
    {
        _impl->logMyMessage( "Hello, Arthur!" );
    }
    else
    {
        _impl->logMyMessage( "Don't worry." );
    }
}
[/;code]

Did you see that? I dont even know what does it do. It doesnot make sense, what it doing, what is the return value? Can you expect something like this became the market leader on the mainstrean programming language?
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: HLL Code doesnot make sense
« Reply #1 on: August 24, 2012, 09:31:04 PM »
i think it's supposed to be humorous
if you get a chance, watch the movie "The Hitchhiker's Guide to the Galaxy"
you will find, among other things, that the answer is 42   :biggrin:

Tedd

  • Member
  • ***
  • Posts: 377
  • Procrastinor Extraordinaire
Re: HLL Code doesnot make sense
« Reply #2 on: August 25, 2012, 12:04:43 AM »
It will make sense if you bother to learn C++ instead of trying to hack your way through everything, but that would require effort.

Anyway, it's more for amusement than usefulness. Don't panic.
Potato2

mywan

  • Guest
Re: HLL Code doesnot make sense
« Reply #3 on: August 25, 2012, 05:53:45 AM »
It will make sense if you bother to learn C++ instead of trying to hack your way through everything, but that would require effort.

Anyway, it's more for amusement than usefulness. Don't panic.
I think that was supposed to be "Don't worry.", since doSomethingWith( _myValue ) was obviously not 42 in this case.

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: HLL Code doesnot make sense
« Reply #4 on: August 25, 2012, 06:28:27 AM »
lol
i think "Don't Panic" was a message from the hithchiker's guide in the movie   :P

Tedd

  • Member
  • ***
  • Posts: 377
  • Procrastinor Extraordinaire
Re: HLL Code doesnot make sense
« Reply #5 on: August 25, 2012, 08:26:57 AM »
Farabi, sorry if my reply seemed a bit rude, but you do have a habit of jumping into things without first doing what should be considered "required reading" and then, unsurprisingly, you find you don't understand what's going on.
It takes a little longer to start your task the first time, but you will understand your task much better, which will make it much easier; and you won't have the same problem for future tasks.



As for "Don't panic!" - it's just a reference from the Hitchiker's Guide (the book, which the move is based on); as is 42.
Potato2

mywan

  • Guest
Re: HLL Code doesnot make sense
« Reply #6 on: August 25, 2012, 08:28:38 AM »
lol
i think "Don't Panic" was a message from the hithchiker's guide in the movie   :P
Buggy code I guess  :P

Farabi

  • Member
  • ****
  • Posts: 968
  • Neuroscience Fans
Re: HLL Code doesnot make sense
« Reply #7 on: August 25, 2012, 11:51:42 AM »
My, C++ is very complicated. That is my point. Assembler is more straigh forward, it is only the diversity of the instruction that make anyone scared.


edit: I did not know chill out mean relax, shutup, and calm down
« Last Edit: August 26, 2012, 03:20:47 PM by Farabi »
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

anta40

  • Member
  • ***
  • Posts: 315
Re: HLL Code doesnot make sense
« Reply #8 on: August 26, 2012, 01:03:30 AM »
C++ is very complicated.

Yes, templates or meta programming, for example.
If you're looking for native HLL with OOP support and less complexity, try Pascal/Delphi, or Free Basic.

K_F

  • Member
  • *****
  • Posts: 1771
  • Anybody out there?
Re: HLL Code doesnot make sense
« Reply #9 on: August 28, 2012, 03:57:23 PM »
.. and thanks for the fish

Just say it as you C it..
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

Dubby

  • Member
  • **
  • Posts: 60
Re: HLL Code doesnot make sense
« Reply #10 on: October 01, 2012, 05:12:25 AM »
First I'm Sorry for bumping this thread...
but this thread interest me...
it's not that difficult to understand the HLL language... once you grab the main idea behind its creation everything become clear...  :bgrin:
it was just class and it's implementation.. struct is the ancestor of the class..
there was no return value because it's declared void.. but the obvious expected return value is 42... 
if I'm not mistaken there is an article about class and assembly language in some other forum...  :biggrin:

CodeDog

  • Guest
Re: HLL Code doesnot make sense
« Reply #11 on: October 01, 2012, 07:44:07 AM »
C++ is very complicated.

Yes, templates or meta programming, for example.
If you're looking for native HLL with OOP support and less complexity, try Pascal/Delphi, or Free Basic.

...or Ruby.  :P

Vozzie

  • Guest
Re: HLL Code doesnot make sense
« Reply #12 on: October 03, 2012, 05:35:08 AM »
Try some patterns, like the GoF book or so,... It should start to make sense

I didn't read the GoF book, but Head First i did read and it was fun