Wikiposts
Search
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

Programming - Where to start?

Thread Tools
 
Search this Thread
 
Old 18th Dec 2011, 12:35
  #21 (permalink)  
 
Join Date: Nov 2000
Location: Cambridge, England, EU
Posts: 3,443
Likes: 0
Received 1 Like on 1 Post
Whichever language you choose, try to pick one that's Object Orientated (e.g. pick C++ over C) That will teach you to be disciplined in your programming and not just throw together spaghetti code.
Not true. You can choose to be disciplined in any language, and, as has been demonstrated again and again and again over the decades, "you can write FORTRAN in any language".
Gertrude the Wombat is offline  
Old 18th Dec 2011, 13:12
  #22 (permalink)  

Plastic PPRuNer
 
Join Date: Sep 2000
Location: Cape Town
Posts: 1,898
Received 0 Likes on 0 Posts
Simple concepts first, string variables, integer variables, floating-point variables, initialising and assigning.
Naming conventions
Documenting code
Working with numeric variables, addition, subtraction, multiplication.
String variables, assigning, parsing, extracting.
Simple and complex arrays - constructing, initialising, working with, voiding.
Constructs - loops and exits, conditional exits,
Subroutines
etc etc.

Start by writing a very simple program;
assign a string variable and get input (What is your name) and print result
Now make it more selective, reject non-alphanumeric characters with a meaningful error message.
Make it more selective, reject integers in the string with errormessage
Now force it to lowercase
Now capitalise the initial letter
Now set up arrays of common boys and girls first names and compare the input to these - if found, say "Hi John, that is a boys name, I'm guessing that you are a boy?" Y/N
Set up the Y/N question - accept either Y or y or N or n
Get birthday, reject garbage, reject ages >100 or <5 (say) - date manipulation and parsing.
and so on and and on
Deallocate all variables when you're done

Writing a simple (actually not so simple) input module like this will teach you all about the basic constructs of programming which are pretty much the same whatever language you use and how to sanitize and validate input.
One of the dialects of BASIC is the easiest way to start (though you could use Smalltalk or Prolog or Pascal or Python (my favourite) or anything (I wouldn't start with C/C++).

It'll take you a couple of weeks before you have an elegant, minimal, fast, well-written, procedural, well-commented and fully debugged little module.

THAT (not trying to produce a Web-page) is the way to start.



Mac
Mac the Knife is offline  
Old 18th Dec 2011, 15:59
  #23 (permalink)  
 
Join Date: Aug 2002
Location: Earth
Posts: 3,663
Likes: 0
Received 0 Likes on 0 Posts
Not true. You can choose to be disciplined in any language, and, as has been demonstrated again and again and again over the decades, "you can write FORTRAN in any language".
Maybe... but it is hard to argue against the many benefits of a true object orientated language.
mixture is offline  
Old 18th Dec 2011, 16:32
  #24 (permalink)  

Plastic PPRuNer
 
Join Date: Sep 2000
Location: Cape Town
Posts: 1,898
Received 0 Likes on 0 Posts
"Not true. You can choose to be disciplined in any language, and, as has been demonstrated again and again and again over the decades, "you can write FORTRAN in any language".

Going to agree with Gertrude there.

Try the exercise of writing an input module that I suggested above - you can, indeed you should be able to do this in a completely modular ("object orientated") fashion.

Some of us were writing Oo code long before it became a buzzword.

Mac

PS: Wrote a lot in DBase III language in the old days - a lovely and infinitely flexible dialect.
Mac the Knife is offline  
Old 18th Dec 2011, 16:48
  #25 (permalink)  
Thread Starter
 
Join Date: May 2005
Location: 50'11N 004' 16W
Posts: 282
Likes: 0
Received 0 Likes on 0 Posts
Thanks everyone.
A few years ago I asked someone on here (can't remember who) how to create 1000 files numbered sequentially. They posted a script they had made specifically for my requirements.
That is my goal, I think- to be able to do something like that.
ex_matelot is offline  
Old 18th Dec 2011, 17:09
  #26 (permalink)  
 
Join Date: Nov 2000
Location: Cambridge, England, EU
Posts: 3,443
Likes: 0
Received 1 Like on 1 Post
it is hard to argue against the many benefits of a true object orientated language
Agreed, for the right task - programming languages are like aeroplanes, you choose the right one to suit the current mission.

I personally would prefer not to hire any programmer to write any language if they have never done any assembler. I don't expect them to be current at writing the stuff, just a few weeks at university twenty years ago is fine, the point is that people who don't know how a computer works can't always understand why given two similar looking lines of code in a moderm high level language one of them runs a million times slower than the other one.

But then I personally would prefer not to hire any programmer without some sort of typing qualification. The ones who can type properly are much more likely to write decent documentation and comments than the ones who have to look at the keyboard and/or only use a few fingers.

I generally fail to get people to take me seriously on these two points
Gertrude the Wombat is offline  
Old 18th Dec 2011, 17:52
  #27 (permalink)  

Plastic PPRuNer
 
Join Date: Sep 2000
Location: Cape Town
Posts: 1,898
Received 0 Likes on 0 Posts
"A few years ago I asked someone on here (can't remember who) how to create 1000 files numbered sequentially. They posted a script they had made specifically for my requirements. That is my goal, I think- to be able to do something like that"

I wrote your script. I could do it because I learned how to program (painfully) by writing a fairly complicated Sinclair BASIC application (complete with assembler for horizontal scrolling of a section of the screen) to interface in quasi real-time with a laser-doppler flowmeter using a DA/AD converter.

This was a highly modular program (I will confess to a single GOTO) in which the main loop really did nothing but call modules (as it should) with a lot of module reuse.

OO hadn't been invented yet and when I started I knew very little, but writing an OO type program just seemed "right" and elegant.

I could write your script (though I was rusty!) in DOS batch language (which is a very simple programming language) because I'd learned the basic principles of program flow and control (and validation!) years ago (and also had learned some of the tricks/peculiarities that every programming language has).

You learn to program by programming, just as you learn to fly by flying....

Here's the script.....

http://www.pprune.org/computer-inter...le-system.html
right at the end for the final version

Mac

PS: Looking at this now is horrible as I can see several ways of making it neater and cleaner but it was a quick and dirty solution to the problem...

Last edited by Mac the Knife; 18th Dec 2011 at 18:52.
Mac the Knife is offline  
Old 18th Dec 2011, 18:38
  #28 (permalink)  
 
Join Date: Jun 2009
Location: Bedford, UK
Age: 70
Posts: 1,319
Received 24 Likes on 13 Posts
ex-matelot, maybe go to a computer IT agency and see what the job adverts are looking for ? I started with Fortran 66 (kind of a pre-Airbus type of thing compared to modern autocode generators). Once common blocks were banished all the fun left it.
Mr Optimistic is offline  
Old 18th Dec 2011, 20:39
  #29 (permalink)  
 
Join Date: Sep 2011
Location: Los Angeles
Posts: 370
Likes: 0
Received 0 Likes on 0 Posts
Take it for what it is worth but I would suggest that you take a look at Microsoft Visual Studio Express as a Development environment (it is free from Microsoft) and start to play around with C#. It actually comes with Visual Basic, C++ and Web Developer all bundled in.
It is generally a little easier than C and C++ and the IDE helps to guide you along the way.

You can start off with simple applications and then move to the "GUI" WIndows based applications.

Visual Studio 2010 Express ISO Images | Microsoft Visual Studio
Gomrath is offline  
Old 18th Dec 2011, 23:00
  #30 (permalink)  
 
Join Date: Nov 2000
Location: Cambridge, England, EU
Posts: 3,443
Likes: 0
Received 1 Like on 1 Post
Once common blocks were banished all the fun left it.
Like I said, you can write FORTRAN in any language. Here's a common block in C:
Code:
struct common
{
   int i;
   char c;
   etc ... etc ...
};
then declare a variable of this type, define it in one module and extern it in the others.
Gertrude the Wombat is offline  
Old 19th Dec 2011, 08:05
  #31 (permalink)  
 
Join Date: Feb 2003
Location: Scotland
Posts: 144
Likes: 0
Received 0 Likes on 0 Posts
I would start by deciding which languages you can get free compilers for.

The best way to learn coding is to read code, then try writing some.

One of the simplest languages to learn is Pascal.
cdtaylor_nats is offline  
Old 20th Dec 2011, 19:44
  #32 (permalink)  
 
Join Date: Sep 2011
Location: Los Angeles
Posts: 370
Likes: 0
Received 0 Likes on 0 Posts
I would start by deciding which languages you can get free compilers for.
Erm... did I not already mentions Microsoft Visual Studio Express -complete with VB, C++, C# and Web Express

One of the simplest languages to learn is Pascal.
and also one that is unlikely to get him into any employment any time soon...
Gomrath is offline  
Old 20th Dec 2011, 22:07
  #33 (permalink)  
 
Join Date: Jun 2009
Location: Bedford, UK
Age: 70
Posts: 1,319
Received 24 Likes on 13 Posts
Information Technology Programmer Programmers job search - PlanetRecruit
Mr Optimistic is offline  
Old 21st Dec 2011, 02:47
  #34 (permalink)  
 
Join Date: Jul 2007
Location: Fife, Scotland
Age: 78
Posts: 247
Likes: 0
Received 0 Likes on 0 Posts
The question is really 'what sort of programs do you want to write?'. If you have no interest in an application you will struggle to program it.

I once chatted to a professional programmer (my dream job at that time) and was amazed that he was trying to get out of the field. It turned out he was spending all his time programming electronic scales and found it soul destroying!

As an amateur programmer most of my programs were started because I wanted to get a computer to do something specific. I have written programs in Fortran, Basic, NXT-G NXC and Excel keystroke macros because they were what I had available at the time. Once you have written something in one language, it is easier to understand (and pick up) other languages.

If you you have a specific interest then search the 'net to see what language others are using in that field. For instance, if you are interested in robots then look at the LEGO NXT programming languages and so on.

If you you have a specific interest then search the 'net to see what language others are using in that field.

Looking at programs which do the sort of things you want can be very helpful because you already know what you need to do and can see how others have organised it.

Have you checked local colleges? Many offer part time or distance learning foundation courses in programming without getting too involved in a specific language.
A A Gruntpuddock is offline  
Old 21st Dec 2011, 07:34
  #35 (permalink)  
More bang for your buck
 
Join Date: Nov 2005
Location: land of the clanger
Age: 82
Posts: 3,512
Likes: 0
Received 0 Likes on 0 Posts
There is of course the argument that if you really want to understand programming you should start by learning to program in assembler
green granite is offline  
Old 21st Dec 2011, 08:33
  #36 (permalink)  
 
Join Date: Mar 2009
Location: Perth Western Australia
Age: 57
Posts: 808
Likes: 0
Received 0 Likes on 0 Posts
If you want to do amatuer type work BASIC, lots of stuff around on the web to help out, though mainly windows.

If you want real performance, then C, lots of good stuff to learn from the web and good compilers on Linux.

Good all purpose general stuff seems to be Python, again lots of stuff on the web and good support in Linux.

I don't use Python myself, I'm half stuck in C/perl/(gdl/IDL) land and not good at either one of them. But in general I use C for all my performance type programs and perl for utilities. If starting now, knowing what I do, I would skip Perl and go straight to Python.
rh200 is offline  
Old 21st Dec 2011, 09:00
  #37 (permalink)  
More bang for your buck
 
Join Date: Nov 2005
Location: land of the clanger
Age: 82
Posts: 3,512
Likes: 0
Received 0 Likes on 0 Posts
If you want real performance, then C,
If you want real performance you use Machine code for the absolute fastest or Assembler as second fastest executing code
green granite is offline  
Old 21st Dec 2011, 10:28
  #38 (permalink)  
 
Join Date: Jun 2009
Location: Bedford, UK
Age: 70
Posts: 1,319
Received 24 Likes on 13 Posts
Assembler is for sissies, you want to try booting a 24 bit machine using just front-panel switches: ah how we came to love mylar tape or whatever it was. Good old Ferranti.
Mr Optimistic is offline  
Old 21st Dec 2011, 10:40
  #39 (permalink)  
 
Join Date: May 2009
Location: United Kingdom
Age: 62
Posts: 212
Likes: 0
Received 0 Likes on 0 Posts
Showing my age...!

I was always a real fan of LISP. Clearly a rather specialist language (AI etc). but very elegant if used properly in parsing text etc.

Weirdest and yet strangely effective business programming language I have used was RPG II (indicator hell). The later variants III and IV were also very effective for throwing together a business application and benefited from the fact that they part of the AS400 (i-Series) which demonstrated an advanced architecture and database (still does).

Anybody remember the old BBC micro and built in 6502 assembler. Wrote many a lab interface between the BBC and a variety of more modern machines because of the easy use of the assembler and the accessible UART. The ubiquitous Zilog 80 chip and assembler was also very good for interfacing with all sortS of kit.

Aah happy daze!

Whatever programming that gets done these days is done in C# or C++.

Agree with Gertrude about the OO paradigm.

Caco
Cacophonix is offline  
Old 21st Dec 2011, 22:30
  #40 (permalink)  
 
Join Date: Mar 2009
Location: Perth Western Australia
Age: 57
Posts: 808
Likes: 0
Received 0 Likes on 0 Posts
If you want real performance you use Machine code for the absolute fastest or Assembler as second fastest executing code
If you could make up a multi-threaded correlator and send it to me then I would be forever in your debt
rh200 is offline  


Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.