If not from a C/C++ background, what is your programming language background?

My first experience was self taught BASIC on one of the very early generation home computers. (Which was some kind of Z80 based TRS80 knock off btw.)

After that I briefly learnt a little bit of Fortran, but it was on an incredibly ancient mainframe with some really old version of the compiler. The main thing I remember about that was how much it "sucked", though TBH I've since had some exposure to more modern versions of the language and didn't really mind it.

After that I learnt Pascal and it very quickly became my favorite language. In a way, Pascal and it's cousin Delphi kept me from learning too much C/C++. I've been semi fluent in C for a long time but could never really bring myself write code in C when I knew I code do it more quickly with a lot less required debugging in Pascal/Delphi.

Also, back in the proverbial day, I programmed a bit in assembler. This is going back a long way though, back to when the Intel 8085 was all shiny and new and the 8048 was cutting edge in micro controllers (the two main platforms I used with asm).

Just wondering what is the programming background of other members?

Well, lets see. First there was real machine language on a Monrobot MkII. then there was autocoder on IBM 1401 and 1440. Then ADPAC on 1401 and IBM 360. Then Fortran and RPG on IBM 360 And assembly on IBM 360. Later, COBOL on Burroughs medium systems, later BPL on the same systems. Then interactive COBOL on Data General minis. Also did Pascal on IBM PC. Then there was 6502 assembly on Apple II series. Then interactive COBOL, assembly and C on IBM PC series. Finally Motorolla 68000 assembly. And more recently, C for the Arduino. I tried Visual Basic on IBM PC. And sometime I did Basic on Apple II and IBM PC.

I tried to understand C++ on IBM PC, but could not overcome the verbosity to achieve what could be done in C and produce a really small resulting code. Must be more!

Paul

Paul_KD7HB: Well, lets see. First there was real machine language on a Monrobot MkII. then there was autocoder on IBM 1401 and 1440. Then ADPAC on 1401 and IBM 360.

Wow Paul, I had to google Monrobot, autocoder and ADPAC, that stuff is even too old for me. ;)

Then there was 6502 assembly on Apple II series. Then interactive COBOL, assembly and C on IBM PC series. Finally Motorolla 68000 assembly.

Now that you mention those, I did do a small amount of assembly on the 6502 and later the 68000, though to be honest I don't remember a whole lot about them. The only thing I can remember about the 6502 was the X and Y index registers, and that I remember thinking that it handled indirect addressing perhaps a little better than the Z80 and 8085 of the time.

The thing I remember the most was the 8085. I programed so much assembler on that thing that 35 years later I can still remember the machine language HEX for some of the most used instructions. At the time I would put programs I developed into PROM. The turn around time to re-burn the PROMs was too long (needed mainframe time and the equipment to do it was in another building), so I used to copy the PROM to SRAM and patch bugs directly in hex.

0x3E LDI A, 0x21 LXI, HL, 0xDB IN 0xD3 OUT 0xC3 JMP 0xCD CALL 0xC9 RET

Seriously I didn't just google that (may be some errors). Now on the other hand, ask me what I had for breakfast yesterday and ...? :)

Let’s see… In chronological order, starting in the late '60s: Fortran, Algol, RCA 1802 assember, TI 8800 Assembler, BASIC (Yuk!), 8080/Z80 assembler, 8051 assembler, c, Pascal, 8086 assembler, PL/I, Motorola 6800 Assembler, Weitek RISC assembler and c, Perl, Tcl, ARM and ARC RISC assembler, c, and c++, Python, assembly languages for several RISC, SIMD and DSP processors and of my own design, Jave, c#, javascript, and several others I can’t even recall right now…

Regards,
Ray L.

Java, webapps, database. I worked in C back in '86.

I disdained the C that I learned in the eighties that from a second edition K&R. I didn't feel any love until I got an Arduino kit a few years ago.

I started in high school (class of '70) with Fortran, then on to BASIC, assembler (8080, 8085, Z80, 6809, 6502, 6510, 68000,-10, -20, PowerPC,-G5, Saturn, avr), Forth, (and lisp, smalltalk, logo, pascal, etc.), html, (javascript, AppleScript, Frontier, fcgi, etc.), and ... back to C like 3-4 years ago. I still have the book.

I started with SC/MP machine language on a single board "computer" with only 14 components that I had built due to my interest in electronics. Later I progressed to BASIC on a TRS80 then Z80 assembler on the same machine. BASIC on a BBC micro followed (help - someone took away the line numbers !) then 6502 assembler. From then on I have had IBM PC compatible machines and have used BASIC, assembler, Modula 2, a couple of days of Forth, VBA (mostly Access) and latterly C/C++ on the Arduino.

I used to work for a company that produced software for hospital Patient Administration Systems written in MUMPS and whilst not employed as a programmer I could not not resist dabbling in the language. No data types and a combined programming and database environment made it "interesting"

Whatever language I have programmed in what I have always been aware of was the need to keep the logic of the program in mind. Most languages can do what you want but if you get the logic wrong then your program will fail.

occam

AWOL:

occam

Harry’s

Hi, HPBasic (Secondary School), Fortran , Z80 and 8085 machine, MiniBasic, Pascal, Cobol (University), TRS80 Basic Commodore VIC20 and 64 Basic, VB and C++ later in life along with Ladder Logic.

Tom... :)

Mine is smaller than yours :slight_smile:

…R

Forth was the one that changed my view, just didn't get enough work in it. C++ is the first language I found capable of doing what forth can, only not as simply, but got paid for.

Anyone who wants a less-structured, alternative way to code might try a free forth on their PC, one with a tutorial.

Ruby - if you want real Object Oriented stuff

...R

You’ve written OOP in forth?

stuart0: Wow Paul, I had to google Monrobot, autocoder and ADPAC, that stuff is even too old for me. ;) Now that you mention those, I did do a small amount of assembly on the 6502 and later the 68000, though to be honest I don't remember a whole lot about them. The only thing I can remember about the 6502 was the X and Y index registers, and that I remember thinking that it handled indirect addressing perhaps a little better than the Z80 and 8085 of the time.

The thing I remember the most was the 8085. I programed so much assembler on that thing that 35 years later I can still remember the machine language HEX for some of the most used instructions. At the time I would put programs I developed into PROM. The turn around time to re-burn the PROMs was too long (needed mainframe time and the equipment to do it was in another building), so I used to copy the PROM to SRAM and patch bugs directly in hex.

0x3E LDI A, 0x21 LXI, HL, 0xDB IN 0xD3 OUT 0xC3 JMP 0xCD CALL 0xC9 RET

Seriously I didn't just google that (may be some errors). Now on the other hand, ask me what I had for breakfast yesterday and ...? :)

The 6502/ Apple II, II+ project was to make a communications front-end-processor to the Data General mini running interactive COBOL. The Apple/DG connection emulated a DG terminal and the other side of the Apple talked to Bank teller terminals from Burrought, NCR and Bunker-Ramo emulation IBM biSync. Also talked to various ATM machines and to ATM networks. Apple was chosen because expansion boards were readily available and the IBM PC was not released until a year after I started the project. Took 18 months to get a working machine.

Paul

Sheesh. What a bunch of old farts! I started with an interest in Electronics. First programming experience wasin Highschool, programming BASIC on a DEC-10 mainframe (via remote ASR33!) My quest for eMail quickly led to a bit of self-teaching of Fortran and PDP-10 assembler (and a rejection of COBOL and Algol! (the latter, incorrectly, as it turns out.) Around then I noticed that most of the electronics projects I had built could be PROGRAMMED on a microcomputer as well, but the microcomputers of the day were pretty expensive compared to "free mainframe access." So I got exposed to several microprocessor assembly languages as well (8080/Z80 and 1802 mostly.) I majored in EE at college, and we had to learn Fortran. I "minored" (unofficially) in CS, so I took the PL/1 class required for them as well, and did a bit of APL (required for non-engineering/science people.) Got exposed to Pascal and a couple more assembly languages (IBM360, PDP11, 6800, 8086.) A bit of Bliss-10. Assorted JCL and similar "shell scripting" or "batch" programming. My summer Job involved Fortran and PL/1. My during-school job involved PDP10 assembler and helping people with their miscellaneous languages. Worked a bit on the DEC-20 Pascal compiler (which was written in assembler.) Did a fair amount of "here's a little assembler function you can call from your fortran/pascal/whatever to do something that would otherwise be impossible." When I graduated I worked for about 6 years doing mostly PDP10 assembler. And then PDP10s were dying, and I got a job that needed C, and programmed in "mostly C" for 20-odd years (for "large" embedded systems.) Somewhere in there I did a bit of Perl, Lisp, Cray-1 assembler, and Smalltalk (which was "not ready for prime time" at the time (mid 80s?)) and a bit more Postscript. So I've been paid for writing Fortran, PL/1, PDP10 and x86 assembly language, BASIC (sort of), LISP (sort of) and C. Post-retirement I've finally returned to the small microcomputer area that I was interested in back in HS. And I've been learning Python, as a modern NOT-embedded language.

There are a couple of observations that I could make:

  • Everyone should learn more than one language.
  • After you've learned a couple of languages, adding to the list isn't that impressive. Languages have major similarities with one another. Mostly. I'd say that a good goal is three languages: two that are similar, so that you understand how similarities work (say, Java and C++), and one that is significantly different (LISP or Forth, maybe Python.)
  • (2) is especially true of assembly languages. At this point, I claim to know "assembly language." MIPS, ARM, AVR, PDP10 - doesn't matter. For embedded systems, you should probably get "somewhat familiar" with a least two assembly languages. That means "able to read", more than "able to write."
  • The "environment" is as important as the programming language. If you're a desktop C++ programmer, you probably know a lot about STL and the graphics libraries that let you throw up standard-looking GUI windows on a desktop. Which won't help very much on an Arduino. :-( Knowing Python PROBABLY means knowing about a lot of the libraries that exist for you to use, and less about the details of the language itself.
  • "Learning a language" and "being proficient" are different things. Most CS majors graduate having used several languages over 4 years, and perhaps ONE significant project, and that's not really enough to enter the job market expect in positions /companies that are prepared to deal with their inexperience. (which are less common than they used to be, I think.)
  • Arduino people get dissed for "just copying examples and modifying them slightly." But a LOT of real-world programming consists of modifying existing projects (fixing bugs, adding features, moving to a new environment, etc.) rather than creating killer apps from scratch.

westfw: After you've learned a couple of languages, adding to the list isn't that impressive. Languages have major similarities with one another.

Oh yes definitely. Learning a new language often comes down to learning slightly different ways of doing the same old same old. It often gets annoying switching between them though, because there's always something that looks similar but works slightly differently in each. Like the Pascal "case" and the C "switch case" for example, when I go from Pascal to C I always seem to forget that C needs the "break"s.

ChrisTenone: I disdained the C that I learned in the eighties that from a second edition K&R. I didn't feel any love until I got an Arduino kit a few years ago.

Yes I don't mind C on the microcontroller platform, but I'd never been a real fan beforehand.

Coming from a Pascal/Delphi background I always disliked how readily C lets you do stupid things like "if (x=0) ..." for example. And a lot of C programmers actually seem to revel in the existence of these quirky pitfalls. Almost as if it's a convenient barrier against "noobs".

Of course most of it comes down to very loose rules on mixing types. Something which I admit can produce more compact code, and possibly even more efficient code, but on the down side probably leads to many extra hours debugging. For example, question to committed C programmers. In total how many hours have you spent (now be honest ;) ), chasing a bug the turned out to be something as simple as:

"someIntegerType &= !someBitMask // clear selected bits"

And it's not because you don't understand the difference between logical and bitwise operators, and it's not because you didn't understand which one was needed. It's almost like when you accidentally type an incorrect homonym in written language, like "your" when you mean "you're" etc. It's not because you're illiterate, it's just a very easy slip up to make.

Pascal, for example, just doesn't allow you make errors like that.

stuart0: Pascal, for example, just doesn't allow you make errors like that.

so does the Ada language (which I happen to use in avionics). However, there are those who like C because it allows them to put a hammer on their own fingers because they can and because they believe it happens to be very useful when used properly, and those who feel just stupid in doing so, and there is no meeting point between them.

~ ~ ~

Personally I love people like Kate Gregory (well, not physically, she is not my kind, but her mind is beautiful, and I understand up to the 90% of her English, so I love her) who wants to make the difference: she promotes - stop teaching C - and then she had a long talk on the stage, when the CppCon called for lightning talks came out as video, and all my room mates heard my support - Go Go Kate, you will make them a believer -

but they also then heard my disappointed whistles for the program published by Bjarne Stroustrup, also because his tshirt sucks.

I believe all the C++ matter is controversial, so that is the reason why we have C++20xx revisions.

I also love Dan Saks, his American-English is also super clear for me, he had a long and shocking mashup between psychology and computer science where he actually proved that C++ is not so bad, and he had also wrote excellent articles before being invited on the stage for his talk.

beautifull minds, Love, Respect.

westfw: There are a couple of observations that I could make:

  • Everyone should learn more than one language.
  • After you've learned a couple of languages, adding to the list isn't that impressive.

Yes, but learning different languages isn't difficult after you have got the programming mindset, learning how computers 'think'. The main problem is remembering the correct syntax and instructions for the language you're using. For example, I wrote an assembly language program for the Z80, about 20KB of code. I was later asked to write a short 20 Bytes assembly program for a 80x86. Easy, I thought, but I couldn't get it working for hours, until I realised that there was no RET Z instruction in 8086 code!

GoForSmoke:
You’ve written OOP in forth?

OO was written in my Forth:

\ Object-Oriented Extensions to Pocket Forth
\ Randolph M. Peters
\
forget task : task ;
room

28 +md constant echo
: on ( addr -- ) -1 swap ! ;
: off ( addr -- ) 0 swap ! ;

echo off

2 constant bytes/cell
: cells ( n -- n' )   bytes/cell * ;
: +cell ( n -- n' )   1 cells + ;
: -cell ( n -- n' )   1 cells - ;
: bytes ( n -- n ) ;
: inc ( addr -- ) dup @ 1+ swap ! ;
: dec ( addr -- ) dup @ 1- swap ! ;

: zero ( addr -- ) off ;

\ This code is from Brodie extensions, included with Pocket Forth.
\ Originally by Chris Heilman, except as where otherwise noted.

\ Display the contents of the stack from bottom to top.
: .S  ( n[m] .. n[1] -- n[m] .. n[1] )
    depth ?dup IF negate -1 DO      \ contributed by
      s0@  r 2* s>d  d+ l@ .        \ Jesus Consuegra
    -1 +LOOP ELSE ." Empty" THEN ;  \   * Thanks! *

: .(  41 word here count type ;  \ interactive printing utility

: <> ( n1 n2 -- flag )  = 0= ;   \ true if n1 and n2 are not the same

0 constant FALSE
-1 constant TRUE

: RECURSE ( -- ) latest 6 +  compile ; immediate

\ Brodie extensions code ends here

: stack ( n "name" -- ) \ make space for n items
   create 0 , dup , cells allot \ #items, max#items, data
   does> ( -- addr )  2 cells + ; \ data space base addr

\ stack parameter access words
: <items> ( stack -- addr ) 2 cells - ; \ var #items
: items   ( stack -- n )    <items> @ ; \ # of items
: +item   ( stack -- ) <items> inc ; \ +1 item
: -item   ( stack -- ) <items> dec ; \ -1 item
: cap     ( stack -- n )    -cell @ ; \ max # of items

\ stack error checking words
: ?empty  ( stack -- boolean )  items -1 = ;
: ?full   ( stack -- boolean )  dup items swap cap = ;
: ?over   ( stack -- t|f )  \ stack error checking routine
   ?full  if cr ." stack full"   abort then ;
: ?under  ( stack -- t|f )  \ stack error checking routine
   ?empty if cr ." stack empty"  abort then ;
\ the slot where the next item pushed will go
: <top>   ( stack -- addr ) dup items cells + ;

\ stack manipulation words
\ (the only words the user has to see)
\ stack   ( n "name" -- ) ... as above
: top     ( stack -- n ) dup ?under <top> -cell @ ;
: push    ( n stack -- ) dup ?over   swap over <top> ! +item ;
: pop     ( stack -- n ) dup ?under  dup top swap -item  ;

30 constant stksize stksize dup dup
stack class.stack
stack message.stack
stack object.stack

: methods.table ( class -- methods.table )
   2 + @ ;

: #methods ( class -- #methods )
   methods.table @ ;

: ancestor ( class -- superclass | 0 )
  methods.table +cell @ ;

: nth.method ( n method.table -- table.entry )
   2dup @ 1 + < if swap 2 * cells +
   else ." method selector out of range." abort then ;

: bad.message ( object -- )
   swap cr ." Unknown message " message.stack top .
   ." passed to object " object.stack top .
   ." of class " class.stack top .  abort ;

variable <class>   : the.class <class> @ ;
variable <msg>     : the.msg   <msg>   @ ;
variable found     : ?found    found   @ ;

: nth.method.table.entry
   the.class methods.table nth.method ;
: ((search.method.table))
   1 swap  do  r
    nth.method.table.entry dup @ the.msg =
    if found on +cell @ true leave else drop then
     -1 +loop ;
: (search.method.table) ( false -- token true | false )
   the.class #methods ?dup if ((search.method.table)) then ;

: find.method ( class message -- class token true | false )
   <msg> ! <class> !   the.class if
      found off (search.method.table)
      ?found if else the.class ancestor the.msg recurse then
   else false then ;

: class ( object -- class )
   \ returns the class of which object is an instance
   -cell  @ ;

: send ( ... message  -- ... )
   message.stack push class.stack top message.stack top
   find.method if execute else bad.message then
   message.stack pop drop class.stack pop drop
   object.stack pop drop ;

: self ( -- )
   object.stack top object.stack push
   class.stack top class.stack push    ;

: message \ defining word
                        \ name will send message n to object class
   \ compile: ( name ( n -- )
   \ runtime: ( ... -- ... )
   create , does> @ send ;

: class.size ( class -- n )
   ?dup if 2 cells + @ else 0 then  ;

: new.object \ defining word
   \ compile: ( objName ( class -- )
   \ runtime: ( -- object class )
   create dup , class.size allot
   does> dup @ class.stack push +cell object.stack push  ;

: super ( -- )
   class.stack pop ancestor class.stack push ;

variable <ancestor>
variable <methods>
variable <size>
variable <class.compilation>

: new.class \ begin class compilation
   \ compile: ( superclass|0 -- )
   \ runtime: ( -- newClass )
   <class.compilation> on create dup ,
   <ancestor> !  here <methods> !  0 , here <size> ! 0 , ;
: end.class  \ end class compilation
   <class.compilation> off ;


: structure: ( -- initialSize )  \ begin structure compilation
   <ancestor> @ class.size ;
: ;structure ( --  ) \ end structure compilation
   <size> @ !  ;
: ivar \ defining word
   \ compile: ( ivarName ( strSize ivarSize -- newStrSize )
   \ runtime: ( -- addr )
   create over , +
   does> @ self object.stack pop + class.stack pop drop ;
: methods: ( -- 0 ) \ begin method compilation
   0 ;

: m: \ compiles a method as headerless code, push token
      \ compile: ( n msgId -- msgId addr n+1 )
      swap here swap 1 +     [ ' ] compile ] ;

: ;methods ( id1 addr1 ...idN addrN N -- )
   \ compile methods table
   here dup >r <methods> @ ! dup , <ancestor> @ ,
   0 do swap , , loop r> drop ;

page room - .( this package takes up ) . .( bytes.)

1 message >>new
2 message >>discard
3 message >>init
4 message >>free

0 new.class root
structure:
   0 ivar >>base.addr
;structure
methods:
 1 m: cr ." NEW" self >>init  ;
 2 m: self >>free cr ." DISCARD"  ;
 3 m: cr ." INIT" ;
 4 m: cr ." FREE" ;
;methods
end.class

\ Here are some sample classes and objects, showing
\ how they are written and used.

10 message >>describe

root new.class planet
structure:
   1 cells ivar >>name
;structure
methods:
  3 m: self super >>init  cr ."    PLANET INIT"   ;
  4 m: cr ."    PLANET FREE"  self super >>free ;
 10 m: cr ." This planet is named " self >>name @ count type ;
;methods
end.class

planet new.class ringed.planet
structure:
   1 cells ivar >>#rings
;structure
methods:
   3 m: self super >>init cr ."       RINGED PLANET INIT" ;
   4 m: cr ."       RINGED PLANET FREE" self super >>free ;
 10 m: self super >>describe cr ." It has " self >>#rings @ .
   ." rings." ;
;methods
end.class

: ," ( quote-delimited-string" ( -- addr ) \ string -> dictionary
   here dup 34 word c@ 1 + allot ;
echo on

planet new.object mars
mars >>new ," Mars" mars >>name !

ringed.planet new.object saturn
saturn >>new ," Saturn" saturn >>name ! 4 saturn >>#rings !

mars >>describe cr saturn >>describe