03-04-2014, 05:27 PM
A fake interview with Bjarne Stroustrup where he supposedly revealed that C++ was a joke. Good for some laughs. An Interview with Bjarne Stroustrup
(03-04-2014 05:27 PM)Dave Frederickson Wrote: [ -> ]A fake interview with Bjarne Stroustrup where he supposedly revealed that C++ was a joke. Good for some laughs. An Interview with Bjarne Stroustrup
(03-04-2014 09:42 PM)Garth Wilson Wrote: [ -> ]On another forum I'm on, there was a volley of posts between two professional programmers who had both been using OOP in their work for 15+ years, one of them saying it was ill-conceived, that no one thought in terms of objects, etc., while the other one was saying that he definitely does think in terms of objects and OOP has its place, which apparently is for GUIs and plug-ins, something whose insides I'm not the least bit familliar with. I do a fair amount of programming of microcontrollers for embedded applications where the microcontroller will never run anyone's code but mine, and I don't touch graphics. I've read various descriptions for what the parts of OOP are, watched YouTube videos on OOP, and none of it has ever really made any sense to me, at least as presented.
A nephew who's majoring in CS said, "If you're defining a car for example, you don't want to have to define a wheel four times. You make it a re-usable object." My immediate response was that there were subroutines decades before OOP, and, although you might have different kinds of wheels in something so you can't just use the same one for everything--for example, although they are all round and turn on their axis, they will have different diameters and other attributes--I do that kind of thing with macros all the time, not OOP. After all the reading though, I do suspect I've done a little OOP in Forth without knowing it.
(03-04-2014 05:27 PM)Dave Frederickson Wrote: [ -> ]A fake interview with Bjarne Stroustrup where he supposedly revealed that C++ was a joke. Good for some laughs. An Interview with Bjarne Stroustrup
(03-04-2014 10:05 PM)Han Wrote: [ -> ]He was probably referring to inheritance when creating a new object based on existing objects (so that you don't re-invent the wheel).Maybe just different instances of the same class.
(03-04-2014 09:42 PM)Garth Wilson Wrote: [ -> ]I've read various descriptions for what the parts of OOP are, watched YouTube videos on OOP, and none of it has ever really made any sense to me, at least as presented.About 30 years ago I attended a lecture of Niklaus Wirth based on his book: Algorithms and Data Structures. It showed me how both are inherently related. If the data can be structured well to a given problem the program is usually much simpler.
RCV_I2C_BYTE:
I2C_DATA_UP
CLRF EEPROM_DATA ; Init EEPROM_DATA as 0.
MOVLW 8
MOVWF LOOP_COUNT1
rib1: I2C_DATA_UP
I2C_CLK_UP
CALL RD_I2C_BIT
I2C_CLK_DN
DECFSZ LOOP_COUNT1, F
GOTO rib1
RETURN ; The ACK or NAK bit must be sent separately.
;----------------------------
RCV_I2C_BYTE:
I2C_DATA_UP
CLRF EEPROM_DATA ; Init EEPROM_DATA as 0.
FOR LOOP_COUNT1, 8, DOWN_TO, 0
I2C_DATA_UP
I2C_CLK_UP
CALL RD_I2C_BIT
I2C_CLK_DN
NEXT LOOP_COUNT1
RETURN ; The ACK or NAK bit must be sent separately.
;----------------------------
CASE_OF 4 ; We were waiting for the low address byte to be shifted out to the flash memory.
RAM_BANK 1 ; Is that finished yet? (Check buffer-full bit in SSP-status register.)
IF_BIT SSPSTAT, BF, IS_SET ; If so,
RAM_BANK 0
CLRF SSPBUF ; send out a dummy byte in order to get the first data byte to read,
INCF FLASH_RD_STATE, F ; then increment the state.
END_IF
END_OF
(03-05-2014 09:11 PM)David Hayden Wrote: [ -> ]... Otherwise, you'd have to somehow remember to go change that obscure code in the array processing - only you wouldn't remember to do it until Joe Horn found the bug after the code was released.Releasing code actually creates bugs, just like serving coffee during flight causes turbulence. Universal law.
(03-04-2014 10:05 PM)Han Wrote: [ -> ]He was probably referring to inheritance when creating a new object based on existing objects (so that you don't re-invent the wheel).Or classes. Didn't know objects can be extended in C++. Another good reason to not touch this language if there's a way around it - just too complex.
(03-04-2014 10:05 PM)Han Wrote: [ -> ]OOP just makes it a bit easier to organize code as everything is very modular not just by code, but also by design.Exactly this was my experience with Java. It's easier to write, read and maintain the source code than for any non-OOP language.
imma Tire()
I have an outside diameter.
I have an inside diameter.
I have tread. It's *this* thick.
I'm made of rubber. It's *this* hard.
I'm inflatable to a max pressure of *this*
You can ask me what my max tread is.
You can ask me what my max pressure is.
You can ask me what my rubber hardness is.
You can tell me what percent of my max pressure I'm at.
You can ask me what percent of my max pressure I'm at
You can tell me what percent of my tread is left.
You can ask me what percent of my tread is left.
You can tell me how fast I'm losing pressure.
You can ask me how fast I'm losing pressure.
imma SnowTire()
I'm a lot like a Tire()
except I have thicker tread.
except that I'm made of harder rubber.
except that my max pressure is lower.
imma TankTread()
I'm nothing like a Tire().
Start over.
(03-10-2014 03:11 AM)Sylvain Cote Wrote: [ -> ]PS: The following list some of the constraints imposed on the project ...