I'm an idiot!

Hrm...maybe I should code.

I'm pretty confident in most (all?) all aspects of computer hardware and assembly and everything that goes along with it. I have a small business for computer repair going, but I'm not looking to make a career out of computers. Would it be a good idea for me to get started in code?
Be prepared to compete against Manjanujishramana Srivilanniman who will be presented by the latest bodyshop for $25/hr
 
I've been doing embedded systems/machine controls for 25yrs: several versions of assembly, basic, c, c++, even Forth.

I'm waaay ready for a career change.
 
Yeah. That'll happen. If it's an array just use foreach instead of for. I see a ton of php code where people do for loops with counts when they could have just been using foreach. It seems they don't realize you can foreach yourself through multi-dimensional arrays.

As a general rule -- if you find yourself struggling to think of variable names for a counter you've got a problem and should probably restructure the logic.

Visual Basic, which is what I was using at the time, and specifically the MS Access DOM, didn't have a "foreach", sadly.
 
I've been doing embedded systems/machine controls for 25yrs: several versions of assembly, basic, c, c++, even Forth.

I'm waaay ready for a career change.


Try Lisp, one of the few self modifying languages besides assembler. That'll keep you going for a while longer!

JOOC, what kind of machine controls?
 
If you are not looking to make money from computers or technology than only you can answer that question. It can be rewarding - but one must realize it takes many years of coding in the proper enviorment to really get good. There are a lot of folks that write absoulte slop.

It can be a fun hobby--For me, it is a combinatin of hobby and career. My direct area requires very little coding, but since I can, I often do.

Hmm...I'll probably just stick to hardware/networking.

Also, I kind of necroposted in the server fundraiser thread (http://www.pilotsofamerica.com/forum/showthread.php?p=483452#post483452) because I myself just upgraded to an Opteron 1354 two days ago (OC'd to 2.5 on stock volts, plan on going higher) and I was wondering if you could make use of a Phenom 8650 for the POA.

Look at VBA (Visual Basic for Applications) which you can do on any Micorsoft Office Application like Excel.
http://msdn.microsoft.com/en-us/library/aa140980(office.10).aspx (Urk It doesn't look so simple there but it is.)

You can get all of the documentation at Microsoft.com Start with the sample code they have for each function.

Also try the O'Relliey nutshell books but those are better if you understand the concepts of program flow

Try a course at a community college.


Thanks, I'll definitely look into that. And if a community college course presents itself, I'll be sure to go for it. :)
 
Try Lisp, one of the few self modifying languages besides assembler. That'll keep you going for a while longer!

JOOC, what kind of machine controls?


Been there, done that.

I've been doing the software on everything from automated test equipment (take some piece of electronic gear, connect it to a rack of test equipment, push a button, and let it run all kinds of automated tests), to embedded s/w inside shipping room freight scales, to controls on hydraulic equipment (user interface, machine vision/measurement systems, analog and digital i/o) - for comparison, if you walked into a factory and saw some automated piece of equipment manufacturing something it will either have a PLC or an embedded PC of some sort and somebody had to write the o/s and control systems for it.

It's never boring, but it is a whole lot of work. A lot of times it feels good to step back and watch it all work when you finish. The frustrating part is explaining to the guy looking over your shoulder why it is so (*&#$ hard just to turn on a light! Is it burned out? Is there a short somewhere? Is it connected? Power? Fuse? Switch not working? Sending a bit to the wrong address? Sending a bit to the right address but the memory map is wrong? ...

Heh - I was working on a system a couple years ago - it was a decent size piece of equipment for my company, the base was about 6'wx8'lx4'h and it had been working fine all mornig. Then it just stopped - I got called out to the factory to see what was wrong, I must have messed with that thing for an hour when a maintenance guy climbed out from inside the thing and wondered what all the fuss was about. He had been inside working on something and had unplugged a cable.
 
Once upon a time, I was working on a USAF contract. The rules required FORTRAN66 (max variable length of 6 characters) and no one could convince the contracting officer to give us a waiver to use FORTRAN 77 or later (32 character variables).

I explained to the contracting officer that in order to maintain consistency among many programmers (I had 8 DIGITAL employees working for me and 30 subcontractors) we would be using one of DIGITAL's programming tools that automatically renamed the variables:

AAAAA1
AAAAA2
AAAAA3
and so on.

I got the waiver.
 
ah, for the good old days of the C Obfuscation contests....
 
FORTRAN 66

INTEGER I,J,K,L,M,N

Of course later on, you could really hose other people with this:

INTEGER REAL
REAL INTEGER

OK, next trivia contest - 1. are there syntax errors in these statements? 2. If not, what do they do?

DO I 200 = 4, 9
DO I 200 = 4. 9
 
ah, for the good old days of the C Obfuscation contests....


Contests, we don't need no stinkin' contests. I was digging through some software that's about 15 yrs old, written in C. One of guys I used to work with wrote it, and I had to reverse-engineer it. Most of the variables were x, x1, x2, and so on.

There was one critical section, though that I really needed to figure out. It was loaded with things like: a, aa, aa1, x, x1, and my personal favorite "hypotenuse". Yeah, it was a pretty complicated trig function to manipulate some motors into the proper orientation with each other.
 
Not if I can help it, or if I can hire someone else (which is what I usually do). On the other hand, over the course of my checkered career, I've paid the bills with (in no particular order)

Ada
FORTRAN (way too many versions)
C/C++
PL/I
Pascal & Modula
Lithp
PHP
BASIC (the original, not Visual Basic)
Perl
COBOL
Java
Motorola 68000 Assembly
CDC Assembler
PL/SQL

And then, of course, is the classic COBOL joke:

A COBOL programmer and a C programmer were discussing the next version of each of their favorite languages. The C programmer explained the next version would follow the standard C notation for increment, and it would be known as C++. The COBOL programmer, not wanting to be left out, explained the next version of COBOL would be known as
ADD_1_TO_COBOL.
 
I've had my fair share of program loops. Nothing like taking an exit in a priority system task, parsing the data in a program loop, and NOT adding to the counter.
Did this on our production system, I did.
 
Think anybody else knows why it was I through N?

hmm - my recollection was I through N.

Right. My recollection is rusty.

For those who don't care: In FORTRAN and some BASICs variables starting with I throught N were integers by default unless otherwise declared.

Yes, but nobody answered WHY I through N. They are the first two letters in the word INTEGER. Doh!

Wow. I feel left out.

How many people on POA code?

Not much these days, but I started 40 years ago using FORTRAN (WATFOR compiler on an IBM System 360 Model 67). High school senior math was fun. :D
 
Been there, done that.

I've been doing the software on everything from automated test equipment (take some piece of electronic gear, connect it to a rack of test equipment, push a button, and let it run all kinds of automated tests), to embedded s/w inside shipping room freight scales, to controls on hydraulic equipment (user interface, machine vision/measurement systems, analog and digital i/o) - for comparison, if you walked into a factory and saw some automated piece of equipment manufacturing something it will either have a PLC or an embedded PC of some sort and somebody had to write the o/s and control systems for it.

It's never boring, but it is a whole lot of work. A lot of times it feels good to step back and watch it all work when you finish. The frustrating part is explaining to the guy looking over your shoulder why it is so (*&#$ hard just to turn on a light! Is it burned out? Is there a short somewhere? Is it connected? Power? Fuse? Switch not working? Sending a bit to the wrong address? Sending a bit to the right address but the memory map is wrong? ...

I asked because I've done a fair amount of similar work (embedded controllers, machine control sofware, PLC programming, etc.) over the years.
 
Yes, but nobody answered WHY I through N. They are the first two letters in the word INTEGER. Doh!



Not much these days, but I started 40 years ago using FORTRAN (WATFOR compiler on an IBM System 360 Model 67). High school senior math was fun. :D

Any chance that was at the U of Michigan? IIRC when I was there (late 60's) they had the only 360/67 in existence or at least the original model. At least that's what the head of the CompSci department told me at the time. My first college computer class involved writing programs in FortranIV to draw pictures on a CalComp plotter and on a Dec PDP-9 with a vector display. I think Waterloo Fortran came up the next year for me.
 
Any chance that was at the U of Michigan? IIRC when I was there (late 60's) they had the only 360/67 in existence or at least the original model. At least that's what the head of the CompSci department told me at the time. My first college computer class involved writing programs in FortranIV to draw pictures on a CalComp plotter and on a Dec PDP-9 with a vector display. I think Waterloo Fortran came up the next year for me.

Washington State University. I started programming in senior math at Pullman High School. We could use a teletype in the basement of the school, or go over to the computer center on campus and use teletypes or punch cards. Seeing as the computer center was closer to my home than the school, you can guess where I spent evenings. I know Stanford had a 360/67, as well as my first boss at Tandem Computers had used one there when he was working on his EE PhD. Funny thing about the 360/67 - Wescon 1983 had a trivia card deck that claimed the 360/67 was a maching that never saw the light of day (their term). I now know of 3 installations. It was the first timeshare version of the 360. WSU also had a 360/20 in the admin office.
 
Hrm...maybe I should code.

I'm pretty confident in most (all?) all aspects of computer hardware and assembly and everything that goes along with it. I have a small business for computer repair going, but I'm not looking to make a career out of computers. Would it be a good idea for me to get started in code?
It is sort of similar to flying. Try it. If you find you cannot live without it, then you cannot live without it. Otherwise, it is probably not worth it.
 
...Not much these days, but I started 40 years ago using FORTRAN (WATFOR compiler on an IBM System 360 Model 67). High school senior math was fun. :D

Me, too! It was maybe 38-39 years ago for me.

I remember WATFOR. The Board of Ed. had a second 360 for students to use and those of us who had un-brown noses had to use punch cards. The angel could use the printing terminal.

I remember that he lost his science fair project because the file got deleted. The teach's solution was to tell him to have some freshies rekey in his program from his printout onto cards.

I'd bet whatever great work he was doing would be pretty laughable today.
 
Not much these days, but I started 40 years ago using FORTRAN (WATFOR compiler on an IBM System 360 Model 67). High school senior math was fun. :D
Scary. That sentence could almost be identical for me except it was 30 years ago not 40.

I don't much at all. I still script a little for parsing some data that I may need to massage a bit to get into the right formats. But that is about all.
 
Hey - fun fact: reinitializing a counter within a loop results in an infinite loop.

Sigh.

That is to say:
Code:
$counter = 0;

for ($x = 0; x < $counter; x++){
  about 200 lines of code

  $counter = 0;
  
  about 200 more lines of code

}

Any idea how long it took me to figure out that I reused a variable?

Fun thread. I've done the 'forgot the rs.Next' that was mentioned by a few folks a few times myself.

Nobody's mentioned yet that this code Nick posted wouldn't even enter the for-loop.

x == $counter, x is not < $counter.
 
Fun thread. I've done the 'forgot the rs.Next' that was mentioned by a few folks a few times myself.

Nobody's mentioned yet that this code Nick posted wouldn't even enter the for-loop.

x == $counter, x is not < $counter.
Not even that. PHP would throw an undefined constant error.
 
And the trick for undoing any naming based obscuration is to search/replace each and every name with one that makes sense (and has a "uniquifier" prefix) each time you figure one out.
That would work for simple scripts -- it wouldn't work for any project of size. What is $marge1 in one location would not be $marge1 in the other location. You're going to have different scopes from functions and objects and whatever else. The code obscuritor would know this so the variable names would reset when the scope changed..which is very often in something OO or structured.

If you were going to step through it and figure out variables you'd have to very carefully keep track of scope and only fine and replace inside that scope. Considering how functions, classes, methods, static methods, would all be obscured too..it'd be faster to just re-write it.
 
Fun thread. I've done the 'forgot the rs.Next' that was mentioned by a few folks a few times myself.

Nobody's mentioned yet that this code Nick posted wouldn't even enter the for-loop.

x == $counter, x is not < $counter.

Yeah, I noticed that after I posted it too. But the concept of what I did remains (except, $counter was a higher number).

$counter equaled about 5, IIRC, and was obtained from leaning how many csv files I was working with. So I'd loop through and parse each field, until $x == $counter. That never happened.

More accurately:
Code:
$counter = 0;
while (something or other) {
  $counter++;
}

for ($x = 0; $x < $counter; $x++;){
  200 lines of code
 
  $x = 0;

  200 more lines of code
}
Better? :D
 
Back
Top