50 Years of BASIC, the Language That Made Computers Personal
harrymcc (1641347) writes "On May 1, 1964 at 4 a.m. in a computer room at Dartmouth University, the first programs written in BASIC ran on the university's brand-new time-sharing system. With these two innovations, John Kemeny and Thomas Kurtz didn't just make it easier to learn how to program a computer: They offered Dartmouth students a form of interactive, personal computing years before the invention of the PC. Over at TIME.com, I chronicle BASIC's first 50 years with a feature with thoughts from Kurtz, Microsoft's Paul Allen and many others."
Some one have already created a thread on Basic with same title.
I mean Basic isn't difficult either, but I really don't understand the perspective at the time that FORTRAN was so complex that BASIC and COBOL were really needed for their syntax changes alone. All of the explinations I've read about them, invariably have the line somewhere about FORTRAN being so difficult to understand that only scientists could master it. I understand they were all invented for different problem domains and that's kind of a good reason in and of itself, but sheesh, its not like it was brain fudge.
Well.. maybe. Or Maybe not. But Definitely not sort of.
I grew up with a little TRS-80 on which you had to learn BASIC to so much as load a file. In Grade Three I was learning things like coordinate geometry and algebra, while my peers were struggling with their multiplication tables. I remember when my peers were introduced to algebra for the first time, some of them had difficulty understanding how x could be a number, while I was busy making adventure games at home.
Thanks to this head start in life, I now have a job in IT. BASIC gave me a great head start in computer literacy!
"The single biggest problem in communication is the illusion that it has taken place." George Bernard Shaw
The first programming language I ever saw was when I was like 10. It was an exact rip of BASIC but used to control AI bugs that would fight each other and negotiate a grid. You could equip scanners and weapons and stuff but then you had to code the actions in a giant decision tree based on conditions and loops. I thought it was awesome! Now I'm a software programmer professionally.
10 PRINT "Happy Birthday, Basic"
20 GOTO 10
all this time I thought Bill gates created Beginner's All-purpose Symbolic Instruction Code. Thanks for sharing the link. Wonder what the GUI/IDE was like for typing BASIC and the interface. Will need to look for some screenshots. Or maybe I am thinking of QBasic that had a GUI.
Those were the days when you didn't need much more than a text editor to make a game.
The BBC Model B equipped with BBC BASIC was released in 1981. As well as the usual litany of BASIC like features (i.e. goto), it had proper named procedures and functions with local variables, which allowed structured programming. It didn't have proper block structured if though.
It also had dynamic memory allocation and pointer indirection (not that wretched peek and poke stuff).
It was still tied to line numbers though, but in practive you (a) didn't need them except for computed goto and jump tables and (b) it had a proper renumbering command if you needed to insert space which corrected all the gotos, gosubs and jump tables (but not obviously computed goto).
It had a 5 byte floating point system build in too, which while slow was pretty decent.
Was quite powerful. It also had graphics and sound built in, which made it very nice to play with.
And then I graduated on to QB when I switched to a PC. Mostly QBasic then a pirated version of QuickBasic. Actually my dad was very against piracy but relented when we phoned a Microsoft sales office and they denied all knowledge of such a product and tried to hawk us an early version of Visual Basic.
QBasic was a fantastic system, especially given it was free with PCs, and I challenge anyone to claim otherwise with good justification.
SJW n. One who posts facts.
Richard Garriott (of Ultima fame) is running an interesting challenge to port his very first RPG computer game, written in BASIC on a teletype connected to a PDP-11, into a web-friendly or Unity version. https://www.shroudoftheavatar....
I remember my first computer, an Intel 486 Packard Bell way back in the early 90s. Windows 3.11 and DOS. I learned by pushing every button, even sometimes breaking the computer, but making sure I fixed it. Then I found BASIC buried in there and started playing with programming. I had no books to learn from, didn't even know where to begin on something like that but I learned through trial and error. It really came in handy as a calculator to check my homework against. I have fond memories with gorillas throwing nuclear bananas. I'm now a Linux sysadmin specializing in HPC clusters.
Physics is like sex. Sure, it may give some practical results, but that's not why we do it
The truth about C:
https://www.gnu.org/fun/jokes/...
Now seriously. Pascal was published some 2 years before Kernighan and Ritchie released their masterpiece. Having the opportunity to have a long look at Pascal and yet coming up with something like C shows a very strong character.
If IBM had gone to Chuck Moore instead of Bill Gates (or rather, his mom) for their 4.77MHz 8088 PC, your title might have been "50 years of FORTH, the Language That Made Computers Personal".
But, then again, if IBM had done that, the personal computer era might have been bypassed entirely with the network computer launching the equivalent of the WWW in 1983.
Seastead this.
Don't forget 0. Only silly languages start loops, arrays etc at 1.
//basic hooray
for (i 3)
{
echo "Hooray!"
i++
}
Before anyone makes a lame joke along the lines of "10 GOTO 10", keep in mind that the BASIC from Dartmouth had no line numbers, and it had structured control flow (for/while loops, etc.). If you ever used "True BASIC" for the Mac, that was a modern port of Dartmouth BASIC (by a company founded by Kemeny, I believe).
Text.
Long before Lisp or Perl, Basic made things much, much easier to deal with text.
C (and its children) had pointers and allocation to deal with.
Cobol, Fortran and Pascal, by default, dealt with fixed-length strings (yes, later versions improved it).
On the Digital operating systems (RSTS, RSX, VAX/VMS -- whose technology ended up influencing WinNT), BASIC was relatively sophisticated, long before Visual Basic: explicit variable declaration, access to database routines, etc. I got a LOT of stuff done where the Pascal and C programmers were spending time just making things work. Speed? Perhaps slower, but most of what I worked on was interactive, where the bulk of the time was waiting for a human being.
Design for Use, not Construction!
I bought a VIc-20 in 1982 to use in my woodworking business. I learned BASIC on it by trying to key in the Tank vs UFO game that was printed in the manual. I don't know if it was all of my typos or errors in the printed listing (both likely), but through debugging that ASCII character game, I got started in the direction that took me to working in IT.
I keep hearing that Star Trek and space was the driver behind science and technology... When was the first episode of Star Trek again? So what inspired these scientists?
...run out of shop...
(1) It wasn't a language that made computers personal, it was the advent of the microchip, and, as a consequence, the microcomputer.
(2) The first language I learned was BASIC. It was so bad that I then learned assembler.
(3) My experience of BASIC was so bad that I didn't want anything to do with it, even though using it to compose LUTs would have been very useful
(4) Then 'C' became cheap, and then free. I haven't written anything in BASIC for over 30 years.
This comment was written with the intention to opt out of advertising.
Really fantastic languages let the user choose which base to use in combination with an ambiguous default.
W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
No, it just shows habit. C was descended from B, which descended from BCPL. They just did more of the same, instead of going to someone else's syntax.
And, having programmed in Pascal for 15 years. Pascal as defined was not suitable for large projects, whereas C was. Every Pascal compiler had to have some non-standard add-ons to handle modularity. And they were all different. Obviously, the Borland model came to have the status of a de-facto standard, but that was not till some years later. You could not have written Unix in standard Pascal; it was written in standard C. Wirth acknowledged the modularity failings of Pascal in his Modula language family, but by that time he had missed the bus.
Consciousness is an illusion caused by an excess of self consciousness.
fuck beta
Lisp was invented in 1958. Can you imagine a world were personal computers had Lisp instead of BASIC? We would have had the singularity the year after IBM released the AT!
Every Pascal compiler had to have some non-standard add-ons to handle modularity.
Actually, if I've got my Pascal-family languages straight, every compiler had to have non-standard add-ons just to handle basic I/O.
I haven't coded in Pascal since the good old DOS days, when I was about 17, but at the time was writing TSR apps, picture viewers (GIF, PCX, BMP, TIF), some graphic-mode UI, including mouse support, even some VGA graphic demos. I can't think of anything that I couldn't do in Pascal (and some ASM, I give you that). In fact, it's the reason I never got too heavily into C...
I started working on computers in the early 80's... The first one I used was a TI 99 4a. It had tape drives and a TV set as a monitor, and a horrific keypad (note: not keyboard). Then my brother got a PC Jr. and I started hacking with that and then went off to college. As an engineering major, I learned FORTRAN on punched cards. I hated it! Swore I'd never have a job where I used computers.
.Net - recycle old VB programmers and old C programmers using the CLR. At the end of the day, not much difference between C# and VB.net. Now I don't code anymore, I'm a VP at that insurance company. But I owe a lot of my career for having a tool like Basic available to me in my formative years. Sure, it teaches you some bad coding habits. But just like anything else, you learn from that, and others, and classes (and objects for those who like puns). Those who say that you can't be a good programmer after having learned basic are either elitist snobs or idiots. Sometimes you have to do it wrong first to see how doing it right makes all the difference. So Happy Birthday Basic - I love ya' baby.
Then my brother got the family to chip in and buy me a Tandy 1000a. It came with DOS, Deskmate, and Basic. I started programming in Basic using the concepts I had learned in FORTRAN. By the end, I think I had dumped about $5,000 into that computer. Printers, memory upgrades, floppy upgrades, hard drive, monitor, etc. And still was able to do amazing things with Basic and with BAT files.
My first job was with Arthur Andersen. COBOL. Batch COBOL. 2.5 years of it. Learned it in 6 weeks, and spent the rest of my career there either coding it or writing tech specs for it.
Went to work at an insurance company coding SqlWindows, a now obscure 4th gen programming language. But hey, it was Windows programming. Spent 10 years there in a variety of roles.
After that I set up my own web development shop... Wrote classic ASP which is essentially Basic for the web. And then went to work at another insurance company, writing, you guessed it, Microsoft VB.net. Granted, VB.net was a far cry from the original basic, and probably would have been better off learning C#. But that was Microsoft's strategy with
Brawndo: It's what plants crave!
``Pascal as defined was not suitable for large projects...''
Unless of course, one is Dr. Donald Knuth, then one creates a brand new programming paradigm: http://www.literateprogramming...
and writes programs such as TeX: http://www.ctan.org/tex-archiv...
Somewhere, I have a copy of the Oberon language manual printed out --- it's quite cool, and very concise.
Sphinx of black quartz, judge my vow.
I do not deny that Knuth, and Wirth, created other, very cool, programming languages later. But I stand by my statement that Pascal, as originally defined, was not suitable for large projects, a failing that Wirth himself recognised.
Consciousness is an illusion caused by an excess of self consciousness.
So, if you are surrounded by idiots as early as middle school, you'll get better grades.
When I was a kid, I wanted to be a machinist. I love working with my hands.
In Middle School and High School, there were these "idiots" who took shop barely passed Algebra and took jobs that gave them credit to graduate.
My parents didn't want me to be a blue collar worker and demanded I go to college. Part of it was that they wanted something more for me - blue collar jobs were being sent down South (Carolinas, GA, FL, etc ..) at the time and the "college boys" had their cushy salaried jobs and were the ones laying people off and sending jobs to the South - "those Southerners took our jobs!" (The good ole days before Globalization).
Years later, I was patting myself on the back for making 6 figures when I bumped into an "idiot" I went to school with. Well, I met him for lunch at his $5 million tool and die company - and I let my parents know about it.
Well, today he's lost a bit of business because of off-shoring but is still doing well and he's still respected for being a business owner.
I'm unemployable with savings dried up, investments gone, and people telling me that I'm no good and stupid - Maybe so.
Of course today, being a machinist is pretty much "monkey pushes the button" for these high tech CNC machines - the designers write the programs.
I digress.
tl;dr: "Stupid people" have their place and don't be surprised if they are more successful than you.
PS, think about what you are doing in IT/Software development. What do you really offer society and humanity?
Looking at the "apps" and "technology" coming out of Silicon Valley, I have to say, they offer no value. The just contribute to our mindless consumer society.
Google, Yahoo!, Apple, etc ... are just consumer products and services that exist for us to ... consume. No value.
My corner mechanic offers more to society than all of you in Silicon Valley. Same goes for the nurse at my hospital. We in software and IT like to think we offer so much but really, what do we do? Or what does you job do? All of you working at Facebook are a waste. Same goes for you Google "engineers" - you are nothing but marketing people.
Just a waste.
I would have liked to hear from Ric Weiland but it's not possible since he died in 2006. He was responsible for the BASIC that I learned on: The Microsoft BASIC-in-ROM that came with my family's Ohio Scientific Challenger 4P (a 6502-based system from 1978 that had hardware similarities to Commodore systems). It also featured the first "Easter Egg" I remember: The system's boot prompt was "C/W/M?" (i.e. cold boot, warm boot, monitor). If you selected "A", it responded with "WRITTEN BY RICHARD W. WEILAND."
Basic was my first programming language, and I actually spent almost 10 years using it before moving onto more structured languages like C, but it wasn't too long after I learned Basic that I found that my favorite features of the language were the ones that enabled me to extend it with my own customizations, which I would have to write in assembler. If I remember correctly, the relevant basic keywords in the implementation that I used were 'usr' and '&... practically turning it into another language with all of the extensions that I would throw in.
File under 'M' for 'Manic ranting'
Knuth had to write a custom pre-processing system to deal with modularity and portability in Pascal when he did TeX and Web. He explicitly stated that Pascal was not his preferred language for that task, but he used it anyway because it was widespread among his target audience.
"First they came for the slanderers and i said nothing."
Knuth can write a complete OS in assembly language while sleeping. 99.9999% of programmers aren't Knuth.
Interesting that it "missed the bus" on "modularity" issues against two languages that didn't even have the behavior of the modulo (%) operator properly defined and standardized until late in 1999 (C) and 2011 (C++) respectively.
Hmm, this news article seems to be collecting people who are familiar with BASIC. Perhaps someone here can help me out.
Sometime in the mid-1990's, I went online and found a sequence of GW-BASIC commands, which I've since lost over the years. But, as it was an interesting set of commands, I've sought to find it again.
It involved recovering after NEW. If you typed in a program, and then typed NEW, the program would presumably be inaccessible. However, there was a technique to be able to get most of the program back (with perhaps some minor corruption in the first line or two).
The closest I found, in more recent years, is some sort of technique involving zero, apostrophe, and ASCII code 15, as described by http://www.petesqbsite.com/sections/zines/basix/basix11/basix11.htm#newsgroups2-gwbasic
That seemed to be designed to work around some sort of copy protection (a way to "protect" the code from the end user). However, I thought there was another method involving PEEKS and POKES. Actually, the other method might have involved READ and DATA, as described by
https://groups.google.com/forum/#!topic/comp.lang.basic.misc/-G1jHKsCQsg
(Notice that line 60 runs the "NEW" command... and then there is a line 70.)
If anyone could explain how either technique works (a simple recovering from NEW, or this workaround for the copy protection), I'd be interested in that. Just what was occurring by holding alt and pressing 15 on the numpad? (I understand that would insert ASCII code 15, which is called "Shift In". What intended effect did that have in GWBasic?)
you just gave me a Fortran flashback! you insensitive clod!
I'll bet it turns out that real programmers do not program in ANY language, right? ;)
In the 21st century, You'd think we could say "Computer, here is my algorithm. [speak algorithm here] here is the data [locate data] and run."
What are we still typing when there are much better communication methods for humans?
OMG your post made me laugh so hard.
I often wonder what a programming language would look like if CPU and memory were infinitely fast and big. What kind of constructs and algorithms would we never have to worry about any more?
Sorting? Scrap Quicksort - BogoSort to the rescue! Garbage collection? No worries - the waste disposal area is essentially a black hole! Bugs with threading driving you to despair? Never fear, say goodbye to race conditions forever! What does 'optimization' even mean - just brute force everything!
Elegant wouldn't even begin to describe the result. Perhaps it would look a little Basic-esque even... [ducks]
Why OpalCalc is the best Windows calc
Really, though, VB6 is not BASIC, despite claims to the contrary. Program structure (numbered lines), approach (graphical), flow control (GOTO?) and syntax is entirely different.
editors:
s/University/College/
(hoping that wasn't an editorial 'correction' since TIME got it right)
Also, there's a party all day on campus tomorrow.
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
It was Conways Game of Life recently explained in Scientific American Mathematical Games. I wrote it on a teletype (text terminals awaited cheap 512-bit ROMs for character sets in 1975) connect from my school to a local university computer (PDP-8?). Numbered lines were convenient in early BASIC when you could only edit one line at a time. The output was an asterisk and blanks grid. I think the printing took about 30 seconds which was longer than it took to compute the next generation. I found a listing a few years back. It was not that bad by my modern standards.
Why not use |= ?
PORTA |= 1<<4;
I agree the same problem of having to assume gcc will turn it into an sbi instruction, but at least it is a little clearer and more likely this way.
My personal feeling is that there should be a C-like language where every single global keyword not in a namespace is reserved for internal use. Ie max() and min() and sin() and sdi() so on are all reserved for direct implementation by the compiler. Currently the solution is to pretty much implement __foo() as a built-in and then require a header file that adds an inline foo()->__foo() wrapper.
I used to have a hard copy of General Electric's BASIC and FORTRAN manuals, until a weasel (who claimed to be a preacher!) stole them. I felt a little better when was busted for stealing TVs.
There's still something awesome about the idea of sitting at a Teletype Model 33ASR playing Star Trek. Yes, you'd go through a lot of paper, but it was still fun. Of course what was even more fun was a version of BASIC I had on my 2nd computer, which allowed for INPUT statements that had a timeout feature on them. I was then able to write a version of Star Trek that would have the Klingons be able to attack you if you sat at any command prompt too long. Added an entirely new element to the game, you couldn't just sit there and mull over your options! This was back in the mid 1980's, before the IBM model 5150 came out. It was running on a Poly-88 5-slot S100-bus system with a 4MHz Z80 processor. Fun.
Are YOU using the TOOL, or is the TOOL using YOU? Think about it!
Real programmers take six months to write something that could be done in an hour in Basic.
Fixed that for you.
Seems you never heard about UCSD Pascal.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Heard about it, tried it out, evaluated the UCSD P-system hardware. But it needed non-standard extensions to work.
Consciousness is an illusion caused by an excess of self consciousness.
It's been a while since I messed with it but I believe you could do a union of a byte with a bit array (or some other bitwise structure) and set the bits individually. At least that's the way I remember doing it for the A/D board I built.
In 1962, he sat down to write one book of 12 chapters. More than 50 years later, he hasn't finished the project, which has scope-creeper to seven books. In the process, he created several new languages for use in his book project, and became famous.
Yes, I think Knuth may simultaneously be the world's best programmer and the world's worst project manager.
This was technically feasible at that time.
How much did Smalltalk cost and what were the hardware requirements?
During the late 1980s to mid-1990s, Smalltalk environments ---including support, training and add-ons --- were sold by two competing organizations: ParcPlace Systems and Digitalk, both California based. ParcPlace Systems tended to focus on the Unix/Sun Microsystems market, while Digitalk focused on Intel-based PCs running Microsoft Windows or IBM's OS/2. Both firms struggled to take Smalltalk mainstream due to Smalltalk's substantial memory needs, limited run-time performance, and initial lack of supported connectivity to SQL-based relational database servers.... While the high price of ParcPlace Smalltalk limited its market penetration to mid-sized and large commercial organizations, the Digitalk products initially tried to reach a wider audience with a lower price.
Smalltalk
Which non standard extensions did it need (considering it was 'the standard')?
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
I tried writing my first projects in Turbo Pascal. The idea of having module and function scope within blocks seemed a nice idea, but it led to real refactoring pain when you wanted to move some data structure from a local private use to something global. Every other reference to some variable had to be moved too.
Most Turbo Pascal functions just mapped onto BIOS calls. But then there were options to use C calling functions rather than Pascal calling functions.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
What was bad about Pascal? I only ever got to sample it as Turbo Pascal back in school. As it was my senior year, I got very little time with it, and quickly moved to C/C++.
These machines had no memory protections support, and it was difficult, if not impossible, to multitask different programs. It could only be interactive running a single core image.
BASIC was ideal for this computing model. The BASIC interpreter could round robin between the interactive users. It was effectively a combined dedicated OS and language.
In the system I worked on the disk was used for swapping users and storing user programs and data. A single CPU could support up to 20 or so terminals. These systems were used for both teaching and simple business automation.
In contrast, even using an assembler was a multipass operation, and only one person could work at a time. Compiling anything more complex, like Fortran IV took a long time. Personally, I only saw people working in assembler since anything else quickly exhausted system resources like memory. Only a very small Fortran program could run in 32K words.
Why is Snark Required?
I still remember the first time I ever saw a personal computer. I guess it was around 1979, and my friend bought some kind of computer that you hooked up to a TV, and, if I'm remembering correctly, you programmed in Basic, and had eight switches instead of a keyboard, (again, if I'm remembering correctly. Is that possible?). I wish I knew what this thing was. Anyway, the most interesting thing to me was that you could write a program that would make a sort of swirling psychedelic pattern happen on the TV screen - excuse me, monitor.
What I do remember clearly, is thinking, "Why in the world would anybody ever want a computer at home?" A few years later, I wanted a MacIntosh, badly.
-- sudon't
Air-ride Equipped
If you can afford the performance hit on every single subscript, sure!
It was not "the standard". The standard was the "Pascal User Manual and Report". To my recollection, this contained no mechanism for multi-file compilation. It assumed that every program was a single file - fine for a teaching language, where programs would typically be a hundred or two lines long, but no use for a system language. UCSD added extensions that made it into a perfectly good systems language. So did Turbo Pascal - differently, So did the Oregon Software cross compiler I used - differently again. You could not simply port programs between these various systems, whereas you could port programs written in K&R C. With additions, Pascal was a fine systems language; as I say, I used it for 15 years and wrote many tens of thousands of lines of code in it. But it needed extensions.
Consciousness is an illusion caused by an excess of self consciousness.
It was not bad, it was incomplete. It was a much nicer language than C, which is why I chose it for the projects I was developing, and was the point made several posts up . But, as I recall, it had no features allowing multiple compilations to be linked together - no equivalent of the C header file.Turbo Pascal added this, to make a very usable system. As did several others - incompatibly. This militated against it becoming a widely used systems language, because it was fragmented into different dialects, all incompatible. C, ugly though it was, stayed on the K&R standard, then added the Ansi standard, which was nearly completely upwards compatible, then mutated into C++ which made great efforts to keep compatibility with C. I can switch code between GCC and VisualC with very little effort: I could not switch code between the various Pascal environments in the same way.
Consciousness is an illusion caused by an excess of self consciousness.
That would be Dartmouth *College*!
I basically only worked with UCSD Pascal. At its time it was the most widely used Pascal. ... should have been more clear.
Turbo Pascal on Apple][ s required CPM, which I did not like at that time. But I regret that now. Oh and I programmed network databases (hierarchical DBs) in Pascal on VMS.
With 'standard' I more meant 'market leader'
Question is: did their even 'normal' Wirth standard compilers exist? Or was basically every implementation their own mini language? Any idea?
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Wirth's own compiler obviously implemented his language. But that was a university Comp Sci compiler: it had to be good enough for students to hand in assignments. But otherwise, every compiler needed extensions. Which were fairly easy to add, and the language was generally good. I did many years of embedded development, with two RTOSes optimised to Pascal idioms. And I really wanted to follow the Pascal line of development to Ada, but was not able to. I entirely agree that Pascal is a much more elegant language than C and its descendants. But it was written as a teaching language, and C was written as a systems implementation language. And since systems are a much bigger commercial market than teaching. So people wrote and supported C compilers. So we are where we are.
I think C/C++ is twenty years past it best before date. Not that it is a bad language, for its time, but its time should not be now. We should have replaced it, and haven't. And a replacement descended from Pascal would be nicer than one descended from C, though many devotees will damn me for saying so.
Consciousness is an illusion caused by an excess of self consciousness.
I started a year ago to write a Pascal compiler for the Java Virtual Machine. Based on Open .architecture ware/extend/expand, but after I had 90% of the syntax punshed in I lost interest (still 90% way to go to actually generate Java Source Code to compile) .... ... everything declared and used in a logical chain in your source code. In fact I miss it. The OOP Pascals imho took a to complicated approach otherwise we still very likely would use Pascal, on a .Net or Java VM.
But yes, I agree. Pascal was an awesome language. Consider to teach one in our days C/C++/.Net/Java.
For the simplest thing in Java you already need a 4 month course and back ground knowledge?
Why is the first line in a Java class 'package x.y.z'? Already a two hours lecturing about packets, visibility, signing etc.
Why is the first word to declare a class usually 'public'
Untill you can start explaining simple concepts you have wasted hours with "ignore that for right now, we will come to that later" explanaitions.
Java - and that is true for any other modern language - is a HORRIBLE first programming language TO TEACH.
Pascal was superb simple: consts, emumerations, sets, types, records, variables, persistence of records
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
The processor has a set bit instruction that would look like this in assembly:
SBI PORTA,4
which will set bit 4 on port A - *without* reading PORTA.
You know SBI doesn't read PORTA.... how? Atmel's instruction set documentation says nothing of the sort. It also says that SBI takes 2 cycles to execute on many Atmel 8-bit AVRs which can execute a basic I/O register write in just 1 cycle. This strongly suggests SBI is being implemented as read-modify-write.
Now let's look at the gcc statement. One would think it *reads* PORTA first then it ORs the content with 0x10000 then *write* the result to PORTA, possibly having some collateral effects depending on the hardware attached to PORTA (as compared to setting bit 4 without reading the port). Right? Wrong. gcc will "optimize" it to a SBI PORTA, 4.
Reading PORTA can never have side effects.
All this while they previously had a sbi() function to do exactly this, without any confusion. But they "deprecated" it so now you use the arcane method, praying that gcc will actually "optimize" it to SBI as promised.
It really is not difficult to check gcc's assembly output, and recognizing this pattern is rather trivial by compiler standards.
Sure thing? Even when you split it in both output/input lines, with one or two analog (ADC) inputs thrown in the mix? If this is implemented as an 8-bit wide IN followed by an 8-bit OUT, do you know the effect of the OUT on an input line (think enabling/disabling digital buffer and pull up resistor)?