OOP programming
Moderator: Rathinagiri
OOP programming
Dear friends,
as you know I'm not a professional coder, but with your help, now I am able to write hmg programs (gui), and I am very proud of that. But, when asked if hmg was OOP programming, I had to admit, that to my knowledge, hmg is not. So I had to learn that hmg is obsolete, not worth spending time to develop apps with hmg.
Up to now I had to accept these point of views.
But I stumbled across this link and that made me calm:
https://www.youtube.com/watch?v=QM1iUe6IofM
For the kind of apps I am creating, OOP gives me no advantage. I can keep my procedural programming.
Maybe it's worth to view.
Thank you
Robert
as you know I'm not a professional coder, but with your help, now I am able to write hmg programs (gui), and I am very proud of that. But, when asked if hmg was OOP programming, I had to admit, that to my knowledge, hmg is not. So I had to learn that hmg is obsolete, not worth spending time to develop apps with hmg.
Up to now I had to accept these point of views.
But I stumbled across this link and that made me calm:
https://www.youtube.com/watch?v=QM1iUe6IofM
For the kind of apps I am creating, OOP gives me no advantage. I can keep my procedural programming.
Maybe it's worth to view.
Thank you
Robert
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: OOP programming
Who said Habour is not having OOP?
Clipper is Result Oriented or Purpose Oriented.
Clipper is Result Oriented or Purpose Oriented.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: OOP programming
Hello Robert,ROBROS wrote: ↑Sun Apr 21, 2019 9:57 pm Dear friends,
as you know I'm not a professional coder, but with your help, now I am able to write hmg programs (gui), and I am very proud of that. But, when asked if hmg was OOP programming, I had to admit, that to my knowledge, hmg is not. So I had to learn that hmg is obsolete, not worth spending time to develop apps with hmg.
Up to now I had to accept these point of views.
But I stumbled across this link and that made me calm:
https://www.youtube.com/watch?v=QM1iUe6IofM
For the kind of apps I am creating, OOP gives me no advantage. I can keep my procedural programming.
Maybe it's worth to view.
If you interested in OOP programming (I'm not sure), then Minigui Extended Edition offers the OOP programming with the command
Please take a look for a small sample below:SET OOP ON
Code: Select all
/*
* MINIGUI - Harbour Win32 GUI library Demo
*
*/
#include "minigui.ch"
MEMVAR oMain, oWnd
Function Main
LOCAL hSplitHandle, nY, nH
**********
SET OOP ON
**********
SET CENTURY ON
SET DATE AMERICAN
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 800 HEIGHT 600 ;
TITLE 'MiniGUI SplitBox Demo' ;
MAIN ;
FONT 'Arial' SIZE 10
*********************************
PUBLIC oMain := ThisWindow.Object
*********************************
DEFINE MAIN MENU
POPUP '&File'
ITEM 'Exit' ACTION Form_1.Release
END POPUP
POPUP '&Help'
ITEM 'About' ACTION MsgInfo (MiniGUIVersion(), "MiniGUI SplitBox Demo")
END POPUP
END MENU
DEFINE SPLITBOX HANDLE hSplitHandle
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 85,85 FLAT
BUTTON Button_1 CAPTION '&More ToolBars...' PICTURE 'res\button1.bmp' ACTION MsgInfo('Click! 1') TOOLTIP 'ONE'
BUTTON Button_2 CAPTION '&Button 2' PICTURE 'res\button2.bmp' ACTION MsgInfo('Click! 2') TOOLTIP 'TWO'
BUTTON Button_3 CAPTION 'Button &3' PICTURE 'res\button3.bmp' ACTION MsgInfo('Click! 3') TOOLTIP 'THREE'
END TOOLBAR
END SPLITBOX
DEFINE STATUSBAR
STATUSITEM 'HMG Power Ready'
STATUSITEM ''
DATE
IF "/" $ Set( 4 )
CLOCK AMPM
ELSE
CLOCK
ENDIF
END STATUSBAR
**********************************************************
PRIVATE oWnd := oMain
IF oWnd:HasStatusBar
SetStatusbarProperties()
ENDIF
nY := GetWindowHeight( hSplitHandle )
nH := oWnd:ClientHeight - iif( oWnd:HasStatusBar, oWnd:StatusBar:Height, 0 ) - nY
@nY + 5, 10 LABEL lblClientH VALUE "Client Area Height = " + hb_ntos( nH ) + " pixels" AUTOSIZE
@nY + 25, 10 LABEL lblClientW VALUE "Client Area Width = " + hb_ntos( oWnd:ClientWidth ) + " pixels" AUTOSIZE
**********************************************************
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
Procedure SetStatusbarProperties
LOCAL nItem := 2
WITH OBJECT oWnd:StatusBar
:Icon("res\smile.ico")
:Icon("res\smile.ico", nItem)
:Say(MiniGUIVersion(), nItem)
:Width(nItem, 300)
:Action(nItem, {|| MsgInfo('Status Item Click!')})
END WITH
Return
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: OOP programming
Thank you for your replies, but indeed, I am not interested in OOP. As for me, I can't see any advantages to use OOP.
Regards
Robert
Regards
Robert
Re: OOP programming
My main development is in XBase++ ( OOP oriented) along with procedural language. The linked video gives advantage and disadvantage of both. We have to use advantage ones as per project in hand. We can not use gun to kill a mosquito.ROBROS wrote: ↑Sun Apr 21, 2019 9:57 pm Dear friends,
as you know I'm not a professional coder, but with your help, now I am able to write hmg programs (gui), and I am very proud of that. But, when asked if hmg was OOP programming, I had to admit, that to my knowledge, hmg is not. So I had to learn that hmg is obsolete, not worth spending time to develop apps with hmg.
HMG and HMG MiniGUI both allows you to code in OOP and procedural manner. It should depend on your job requirement.
And HMG is NOT obsolete. It allows you to develop for 64 bit OS in simple codes.
Regards,
Anand
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: OOP programming
Hi Robert
First: OOP not a programming way, simply a "style"; so we can't talk any programming language if it is OOP or not. A language may or may not support OOP. And in programming using or not OOP never mains it is modern or obsolete.
Second: HMG isn't a compiler; a Graphical User Interface library for Harbour compiler. So we can't talk about "HMG programming" but Harbour Programming with HMG Library.
Third: If you inspect carefully Harbour documentation you will see OOP statements and functions, such as METHOD, CLASS, HBClass etc. So, Harbour fully supplying OOP,
In result everybody who using HMG for programming purpose should use Harbour compiler; and everybody who use Harbour freely use or not OOP.
Some OOP addicts claim OOP is good, so it is an advanced ( even last ) gradation in programming. This is personal and group point of view; and OOP is old than HMG, Harbour even Clipper.
Happy programming
Last edited by esgici on Mon Apr 22, 2019 3:44 pm, edited 1 time in total.
Viva INTERNATIONAL HMG
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: OOP programming
For the time being everything I programmed this far was based on the old fashioned way, which works fine, for me!As for me, I can't see any advantages to use OOP.
Serge
There's nothing you can do that can't be done...
Re: OOP programming
Dear friends,
many thanks for all replies, and of course I didn't have in mind hmg is not a compiler but a user interface (harbour mini graphical user interface). Though I don't know the difference oop vs procedural really, as Serge said, when the old fashioned way works, why leave it.
Another last question: a professional programmer, who knows how to program oop, would he be able to to find out (not having the source code) whether it was coded the oop-way or the "old way"? I suppose he will not be able to find out.
Kind regards
Robert
hmg is great and so is this forum.
many thanks for all replies, and of course I didn't have in mind hmg is not a compiler but a user interface (harbour mini graphical user interface). Though I don't know the difference oop vs procedural really, as Serge said, when the old fashioned way works, why leave it.
Another last question: a professional programmer, who knows how to program oop, would he be able to to find out (not having the source code) whether it was coded the oop-way or the "old way"? I suppose he will not be able to find out.
Kind regards
Robert
hmg is great and so is this forum.
Re: OOP programming
See this:
Procedural way:
procedure Main
step(1)
Step(2)
Steo(3)
return
OOP way
procedure Main // this pattern is usually seen in object javascript libs like ANGULAR,VUE, etc and Java
local app := AppNew()
app:var1 := whatever
app:step1 := {||step1()}
app:step1 := {||step2()}
app:step1 := {||step3()}
app:exec()
return
Procedural way:
procedure Main
step(1)
Step(2)
Steo(3)
return
OOP way
procedure Main // this pattern is usually seen in object javascript libs like ANGULAR,VUE, etc and Java
local app := AppNew()
app:var1 := whatever
app:step1 := {||step1()}
app:step1 := {||step2()}
app:step1 := {||step3()}
app:exec()
return
Angel Pais
Web Apps consultant/architect/developer.
Web Apps consultant/architect/developer.