Learning to "c...
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] Learning to "code"

56 Posts
28 Users
0 Reactions
245 Views
 wors
Posts: 3796
Full Member
Topic starter
 

Where would I start?

Not wanting to do it as a job but as everything and anything is becoming controlled by some kind of software I figure it might be a good idea to actually have an idea of how it works. 😆


 
Posted : 21/09/2016 9:41 am
Posts: 11402
Free Member
 

does any software you use have scripting capabilities ?


 
Posted : 21/09/2016 9:44 am
 wors
Posts: 3796
Full Member
Topic starter
 

does any software you use have scripting capabilities ?

Say what??


 
Posted : 21/09/2016 9:46 am
Posts: 7184
Full Member
 

https://www.codecademy.com/


 
Posted : 21/09/2016 9:47 am
Posts: 0
Full Member
 

MIT have made a lot of their courses available, free of charge, online. They are one of the world's leading technology schools, and if you really want to get an understanding on how it works, I would recommend spending some time on their courses.

[url= https://ocw.mit.edu/index.htm ]Website[/url]

[url= https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/ ]Direct link to Electrical Eng and Comp Sci courses[/url]


 
Posted : 21/09/2016 9:47 am
Posts: 11402
Free Member
 

do you use excel or something like that ?


 
Posted : 21/09/2016 9:49 am
 wors
Posts: 3796
Full Member
Topic starter
 

Yes, I use Excel


 
Posted : 21/09/2016 9:50 am
Posts: 7100
Free Member
 

If it's just for fun buy a Raspberry Pi and teach yourself Python.


 
Posted : 21/09/2016 9:50 am
Posts: 0
Free Member
 

I'd probably start by downloading the free version of visual studio, then just google for C# tutorials.

https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx


 
Posted : 21/09/2016 9:50 am
Posts: 1862
Free Member
 

For utter novices then Scratch will teach the basics, and you can run that in a browser. Then move on to something "proper" like Python, which you can get for Windows / Mac / whatever.


 
Posted : 21/09/2016 9:53 am
Posts: 0
Free Member
 

take up painting! 😆


 
Posted : 21/09/2016 9:53 am
Posts: 91096
Free Member
 

If it's just for fun buy a Raspberry Pi and teach yourself Python.

Or just learn Python on a normal computer for free.


 
Posted : 21/09/2016 9:55 am
Posts: 23296
Free Member
 

https://www.codecademy.com/
/p>

start here. see if you get bored.

having a problem you want to solve makes it easier in my experience.


 
Posted : 21/09/2016 9:59 am
Posts: 11402
Free Member
 

Yes, I use Excel

if you press alt-f11 it brings up the excels Visual Basic window (it's scripting) you can learn to program excel there (plenty of resources online). Not my cup of tea (though i did write a football betting odds thing in excel once, used to rip the results off the bbc website) but it's sometimes easier to learn to program if you have some kind of practical application in mind.


 
Posted : 21/09/2016 9:59 am
Posts: 0
Full Member
 

What are you hoping to get out of learning how it works? It's a genuine question. "Learning to Code" is such an expansive phrase that you need to narrow down what you hope to achieve.

Its a bit like saying I want to learn about metallurgy because bikes are made of metal. Is the end goal just to know some more things, or be able to weld, or argue in a pub about the benefits of 725 over 853.


 
Posted : 21/09/2016 10:00 am
Posts: 7100
Free Member
 

Or just learn Python on a normal computer for free.

True, but it's quite good fun plugging the Pi into a prototype board and making lights flash on and off 🙂


 
Posted : 21/09/2016 10:03 am
Posts: 4693
Full Member
 

Arduino is cheaper and plugs into a PC, without all the pain that is Linux. And you can still make lights flash.


 
Posted : 21/09/2016 10:05 am
Posts: 7100
Free Member
 

I think my point was that if you're trying to teach yourself programming, it's nice to have a tangible project to work on, whatever option you choose. There is loads of cool stuff to introduce you to programming.


 
Posted : 21/09/2016 10:09 am
Posts: 77687
Free Member
 

I think my point was that if you're trying to teach yourself programming, it's nice to have a nice tangible project to work on, whatever option you choose.

That's always been my challenge, working out what to do.

For absolute "never coded before" basics you could do worse than a Pi and Scratch. You get a cool little gadget, exposure to Linux (so you can learn something else whilst you're at it), and Scratch is a nice little point & click programming environment which will teach you the fundamentals of coding structure without losing half a day in frustration because you've missed a semicolon somewhere. Scratch's entire raison d'etre is as a learning tool, it's aimed at kids.

From there you can move to a 'proper' programming language like Python and hit the ground running. Python, Perl, Visual Basic, etc etc all have different syntax but fundamentally a loop is a loop, a procedure is a procedure whatever language you're using.

The beauty of the Pi is that there's a wealth of documentation, project ideas and communities around it both on the interwebs and in dead tree format.


 
Posted : 21/09/2016 10:17 am
Posts: 6208
Full Member
 

Arduino is cheaper and plugs into a PC, without all the pain that is Linux. And you can still make lights flash.

Built in LED too.
Mbed/Nucleo is even better, and has a built in RGB LED and programming is even easier... do it on a website, drag and drop the file on to the device which appears like a USB stick. Not as many resources as for Pi/Arduino though (although the addons all plug in too).

Definitely agree with thinking of a fun project to do first, rather than just dive in.


 
Posted : 21/09/2016 10:20 am
Posts: 10340
Free Member
 

Scratch and Lego Mindstorms have good interfaces for learning the basics.
That's where I started with my children.


 
Posted : 21/09/2016 10:24 am
Posts: 17773
Full Member
 

Added to my favouites - I found an android app called Learn Python or something similar.

I've spent a bit of time on it, but not a lot.

I installed Python on my laptop, but then found the app has a 'try it' button, that takes you to a python interface when doing some of the exercises; I still find it easier though to use the laptop to do the 'code' stuff & use the tablet app as a tutorial guide, rather than flipping between them just on the tablet.

I guess I don't have a specific project or 'requirement' but thought it would be useful/fun to learn a bit about.
I think my nephew fiddles about with Scratch - he showed me little computer games he'd created & all sorts. He's also getting to grips with Lego Mindstorm.


 
Posted : 21/09/2016 10:30 am
Posts: 31206
Full Member
 

If you have never done any coding at all then https://uk.code.org/learn is a decent place to learn the very basics.

I'd agree things like Scratch or even simple games like [url= http://lightbot.com/hour-of-code-2015.html ]LightBot[/url] are a great way to get the hang of the basics.

Arduino is cheaper and plugs into a PC, without all the pain that is Linux. And you can still make lights flash.

Not convinced it is a great way to learn to code though as there is a fair bit of assumed knowledge and not everyone wants to go directly from no understanding straight into direct control of pins on a microcontroller. And the Arduino IDE isn't exactly beginner friendly either.

The advantage of the Pi is that it doesn't plug into a PC, it [i]is[/i] a PC. And there are a lot of resources out there for it.


 
Posted : 21/09/2016 10:41 am
Posts: 0
Free Member
 

It is a bit sad that coding is much less accessible then when I was a kid - turn on the C64 and get typing in BASIC was how I learned. Just messing about. I know it sounds daft, but if you just want to mess about and try writing simple programs, how about buying a retro computer on eBay and plugging it into the TV?

The idea of having a tangible project is a very good one, though - I'm entirely self-taught in various languages, basically because I had problems I wanted to solve. It's like learning a (no-programming) language, using it for real is a much better way to learn than trying to learn it abstractly.


 
Posted : 21/09/2016 10:50 am
Posts: 0
Free Member
 

There is also the Microbit, although I have to say that most of the projects for it that I've seen are pretty pathetic and in a fair few cases you could achieve the same affect with a few bits of electronics and without needing to program anything (flashing LEDS anyone 🙁 ).

I'll be honest without a 'project' in mind I think most people would struggle to be interested. That was the beauty of those old computer mags, the end result was a game, that's and easy sell to a kid and needs no extra parts.


 
Posted : 21/09/2016 10:52 am
Posts: 91096
Free Member
 

What interests you about coding, OP?

Flashing electronic lights? Making webpages? Apps? Games? Nuts and bolts?


 
Posted : 21/09/2016 10:57 am
Posts: 77687
Free Member
 

turn on the C64 and get typing in BASIC was how I learned

Ye gods, you have my sympathies.


 
Posted : 21/09/2016 10:57 am
Posts: 7100
Free Member
 

I know it sounds daft, but if you just want to mess about and try writing simple programs, how about buying a retro computer

Wish I still had my old ZX Spectrum+ 128k. I wrong many a game on that - very fond memories. Would they work on a modern TV?


 
Posted : 21/09/2016 10:57 am
 wors
Posts: 3796
Full Member
Topic starter
 

Cheers guys, some useful stuff as ever!

What interests you about coding, OP?

Flashing electronic lights? Making webpages? Apps? Games? Nuts and bolts?

Flashing lights of course, if something has flashing lights it must be good!


 
Posted : 21/09/2016 11:01 am
Posts: 450
Free Member
 

Another vote for Python from me.


 
Posted : 21/09/2016 11:02 am
Posts: 6208
Full Member
 

It is a bit sad that coding is much less accessible then when I was a kid - turn on the C64 and get typing in BASIC was how I learned

think that's why they made the Pi and the Microbit (and other devices), and all the associated teacher packs to go with it.
sure you can just install Python (think it is already installed on Mac?) or something similar, but the Pi/MicroBit you have no choice but to think of a project and code something to make it do something.

And the Arduino IDE isn't exactly beginner friendly either

not even an IDE either, really. just an editor with a few buttons.
and it (at least the Linux version) has bad java font rendering that makes my eyes go funny.


 
Posted : 21/09/2016 11:03 am
Posts: 349
Free Member
 

If games take your fancy then have a look at gamemaker. It seems to be an ingest point for quite a few people in the games industry and has its own language and I think it helps you to learn to code. I've not used it myself as I wound up jumping straight into unity3d.


 
Posted : 21/09/2016 11:06 am
Posts: 0
Free Member
 


Flashing lights of course, if something has flashing lights it must be good!

go with some kind of arduino or a raspberry pi. either have good communities and resources like books and tutorials to support them.

I'm a C/C++ programmer.. I learned AMOS (basic on the amiga), pascal (borland turbo pascal) and then did C and C++ (and COBOL blerrgh!) at college (early 90s!).

As far as recreational programming goes I was always inspired by [url= http://bfy.tw/7oDJ ]The Demoscene[/url], so was making little graphical apps and mini games


 
Posted : 21/09/2016 11:21 am
Posts: 0
Free Member
 

Ye gods, you have my sympathies.

Started on an Apple II actually. It explains why I tend to write very dense code with no documentation so I can't work out how it works 6 months later!

Very limited memory, even a limited number of variables and no arrays on some systems, and need to use assembler to get it to do anything unauthorised - you kiddies don't know how easy you have it 😉


 
Posted : 21/09/2016 11:34 am
Posts: 0
Free Member
 

just had a thought... for non flashing LED stuff, messing around with graphics and suchlike, unlike "the olden days" where we'd often have to use assembler to access video memory things like [url= https://processing.org/ ]Processing [/url] exist. (also see http://www.openprocessing.org/ full of examples)

i found this book quite good for ideas : http://zenbullets.com/book.php (which i transferred into C++.. ;))

best of all, processing is free.. and uses a C++ / Java "like" language


 
Posted : 21/09/2016 11:40 am
Posts: 0
Free Member
 

I teach Computer Science & ICT at secondary school. I lead on the KS3 curriculum and we cover Code.org, Scratch, Kodu, BBC Basic and then Python between Years 7 - 9. I'd suggest jumping straight in to Python and if you are a complete novice this book's pretty good (a kid brought it in to show me today). 'Computer Coding for Kids' by Carol Vorderman. It covers the basics and only costs £5.
http://www.theworks.co.uk/p/computing-books/computer-coding-for-kids/9781409347019?CAWELAID=720011340001905724&CAGPSPN=pla&CAAGID=18221917361&CATCI=pla-98622388361&catargetid=720011340002258989&cadevice=c&gclid=CJHWjriwoM8CFegW0wodjfgGJA
There are obviously other ways of getting in to it, but this is very user friendly and step-by-step.


 
Posted : 21/09/2016 11:43 am
Posts: 8766
Full Member
 

Not used Python but I do a bit of Powershelling in my job. You could use that just to arse about with files on your Windows PC as practise.


 
Posted : 21/09/2016 11:44 am
Posts: 4693
Full Member
 

The problem I found with the Pi is to do anything, like make a program automatically start when you power up, you have to dive into Linux. With the Arduino you just turn it on.
Plus if you have PC, to get the Pi to work you have to plug the keyboard, mouse and monitor into it, so either you get new kit for the PI, or you swap stuff over. Or you remote desktop into the PI, which again, is a load of Linux.


 
Posted : 21/09/2016 11:49 am
Posts: 0
Free Member
 

There is a great iOS app called Swifty, which gives you great, interactive introduction to Apples language, Swift, which is based largely (and is very similar too) C.

It's really good for "on the go" or lunch time sessions, but won't give you a fully hands on approach. For that, you need code academy.


 
Posted : 21/09/2016 12:02 pm
Posts: 0
Free Member
 

I was thinking of something like this - I did BASIC as part of my computer studies 'o' level in 1984 which also required me to fill in cards with some sort of special pencil to feed into a card reader to run a program - will much have changed?


 
Posted : 21/09/2016 12:03 pm
Posts: 91096
Free Member
 

😆


 
Posted : 21/09/2016 12:11 pm
Posts: 31206
Full Member
 

Very limited memory, even a limited number of variables and no arrays on some systems, and need to use assembler to get it to do anything unauthorised - you kiddies don't know how easy you have it

My day job is programming embedded systems with cheap micros in them.

Not unusual for us to be writing complete systems (i.e. including an "operating system" and "drivers") that run on less than 8KB of RAM, 32KB of ROM and a bit of flash.

Always an eye-opener for engineers that are used to writing code on PCs 🙂


 
Posted : 21/09/2016 12:49 pm
Posts: 17
Free Member
 

I am not a coder or programmer but I have to code and program.
From my experience you can't really teach how to because that is already built in to your style of thinking.
Problem Solver
Logical
Systematic
go for it

Language is about the learning and in some ways the hoop jumping, met loads who could replicate what they had done etc. but few who had the ability to solve a problem.


 
Posted : 21/09/2016 12:54 pm
Posts: 0
Free Member
 

32KB? You were lucky. I wrote a robot controller on a Sharp pocket computer which could only have 256 lines of code, and had to control everything by hacking the custom thermal printer port 😀


 
Posted : 21/09/2016 12:56 pm
Posts: 7058
Free Member
 

256 lines of code? Always said it were a long way to go for loaf of bread. Hamlet cigars. Jumpers for goalposts. Isn't it? Wasn't it? Eh?

Oh, and what mikewsmith said. The problem solving analytical stuff. It helps to be able to be able to hold a big pile of details in your head in one go, to form internal representations of systems and their behaviour, to be mildly autistic, to learn written languages quickly, and to like Red Dwarf. I never met an programmer who didn't like Red Dwarf.


 
Posted : 21/09/2016 1:03 pm
Posts: 77687
Free Member
 

Wish I still had my old ZX Spectrum+ 128k. I wrong many a game on that - very fond memories. Would they work on a modern TV?

The "Toastrack" 128 goes for silly money these days. You'd be better off with a +2 or similar.

There's a very simple "composite mod" you can do on the old rubber-key. Basically you bypasses the TV modulator, it's a single wire. I think on the 128s you can get a cable which gives you S-Video or some such (I'd have to check to be 100% certain). But, yes, is the short answer.


 
Posted : 21/09/2016 1:15 pm
Posts: 77687
Free Member
 

I never met an programmer who didn't like Red Dwarf.

So what is it?


 
Posted : 21/09/2016 1:16 pm
Posts: 17
Free Member
 

[img] [/img]
cant find a pic of the snooker with planets


 
Posted : 21/09/2016 1:25 pm
Posts: 0
Free Member
 

😯


 
Posted : 21/09/2016 1:27 pm
Posts: 0
Free Member
 

My day job is programming embedded systems with cheap micros in them.

Not unusual for us to be writing complete systems (i.e. including an "operating system" and "drivers") that run on less than 8KB of RAM, 32KB of ROM and a bit of flash.

Always an eye-opener for engineers that are used to writing code on PCs

Similar, I was working on a 'quick' update to a legacy product designed to sell it into a new market last week. Required me to increase the size of an array by 30 bytes - unfortunately this meant I ran out of RAM and spent the remainder of the day grinding through the code base looking for variables that could be sacrificed to find the 8 bytes I needed.

Of course as is the nature of such things, when completed and sent to customer for field trial they decided what they had requested wasn't what they wanted afterall 😕


 
Posted : 21/09/2016 1:59 pm
Posts: 6208
Full Member
 

run on less than 8KB of RAM, 32KB of ROM

in our case the requirements were typically like that, but including a 100% overhead (so 4K/16K with 4K/16K spare for patches and future improvement).

People seem to compare Arduino and Pi but they are very different, other than Arduino attempting to promote proper clean and fancy high level programming of embedded devices, with libraries and OOP, and all the memory hogging, and steering clear of the low level register stuff that gets you lots of memory and performance back. And Pi using Python as the recommended language, presumably with similar levels of high-levelness.

For a beginner language, I'd choose Python, but it is a bit "weird".


 
Posted : 21/09/2016 2:14 pm
Posts: 31206
Full Member
 

Arduino attempting to promote proper clean and fancy high level programming of embedded devices, with libraries and OOP, and all the memory hogging, and steering clear of the low level register stuff that gets you lots of memory and performance back

Getting well off-topic now but, you don't [i]have[/i] to use Arduino like that, you [i]can[/i] use Atmel Studio instead of the Arduino IDE and write to the registers directly instead of using libraries.

Handy if you need to save space, improve performance or timing accuracy.


 
Posted : 21/09/2016 2:24 pm
Posts: 7184
Full Member
 

I'd choose Python, but it is a bit "weird".

Especially if somebody has run it though one of these!

http://pyob.oxyry.com/

😛


 
Posted : 21/09/2016 2:27 pm
Posts: 6208
Full Member
 

Getting well off-topic now but, you don't have to use Arduino like that, you can use Atmel Studio instead of the Arduino IDE and write to the registers directly instead of using libraries.

Yup. Agree there, and is what I do (but not Atmel Studio, since that's not on Linux). Arduino "IDE" also secretly adds in a few things for your convenience, but inconsistently.

Was referring more towards the way that the Arduino project aim their products, and the intended audience (relative beginners, and simple tasks).

I would say that for someone that's never coded before, then the Arduino way is going to be better than the raw AtmelAVR way, even though you can do both in the same program. But then I started out programming Z80 aged 14, after learning Link380z basic aged 13, so the hard way is not impossible.


 
Posted : 21/09/2016 3:51 pm
Posts: 0
Full Member
 

hijack

Those of you programming low end embedded stuff, are you permanent or contractors? In a similar field and looking at stretching my legs from this office. Interested to hear what sort of thing is out there.

/hijack

And to the OP, if you've never done coding before, I would recommend https://learnpythonthehardway.org
Its really very good. It holds your hand all the way, even teaching you about basic tools that you'll need like text editors. By the end of you can do simple web pages etc.


 
Posted : 21/09/2016 4:00 pm
Posts: 31206
Full Member
 

Those of you programming low end embedded stuff, are you permanent or contractors?

Permy. Been with my company for 12 years.

Our company basically does development work for other companies, so I do get a lot more variety than many other people in permy roles - including spending a few years working on-site at other companies.

I have a mate that does contracting for embedded stuff though - that's definitely an option if you have the flexibility and skills. His typical contracts are on a 6 month basis then rolling from there.


 
Posted : 21/09/2016 4:11 pm
Posts: 91096
Free Member
 

Contracting is a double-edged thing though. On the one hand, you get different workplaces and perhaps different opportunities. But it's true that you get employed to do one thing and you have to be lucky to get put onto something else.

You don't generally employ a brickie and then pay to help train her up to be an architect, do you? No, you want bricks laid.


 
Posted : 21/09/2016 4:16 pm