Very General Question About Learning Some Coding

Posted on
  • I am very intrigued by the Espruino because I find programming in Javascript with the Chrome App to be brilliant for programming dunces such as myself to be brilliant. Javascript is straight forward, easy to read & understand, and has the dual screen showing you graphically what's happening.

    I am an electronic tech so hardware I know, but I find software, or learning it, to be extremely difficult because of the usual reasons(syntax,etc). I guess what I am trying to say that this may be my best hope ever to learn how to code.

    I have umpteen Arduinos, Two RasPi's , and originally thought the PI would be the way to learn Python, which it very well may be. But I will never be a Pi fan as it takes a complete computer set up just to get up & running. Making a LED(s) blink signally or in string gets boring after the millionth time.
    It may be that I am just going down the same path again with trying to learn some programming language. It well be I need a head shrinker... But I find the Espruino compelling from the learning programming angle as each keystroke(or so) does something tangible.

    I have been playing with electronics for 40+ years so I really don't get my jollies reading the temp on a LCD connected to an LED.
    So I would really appreciate some feedback from anyone about my hunch that this would be one of best ways to learn programming ever to come down the road! It just seems the less bull between the geek & the board-the better off one is! This set up keeps it simple! Yes? No?

  • I certainly found the Espruino to be much less painful to start with than Arduino. I wouldn't say the Arduino was hard, but doing more than the basics with it gets harder faster than the Espruino. SPI and I2C are tricky to use. On Espruino, I2C just works. SPI just works.

    The other thing that makes getting started a lot easier is that you can do things interactively, instead of write, flash, test, repeat with Arduino. That lets you quickly figure out how to interact with something, and how the different functions behave.

    That said, I disagree with the phrase "less bull between the geek and the board" - you've got it backwards. On the end of "nothing between you and the board", would be programming a microcontroller in straight C, and instead of digitalWrite(), you put some value(s) into one or more registers - that's the opposite of what you want. With Arduino, it's in the middle - you're writing C, but they've provided higher level functions so you don't need to know that to make pin 3 go high, you set this bit of this register, and that bit of that other register, etc - you just do digitalWrite(3,1), and the definition for digitalWrite() where the Arduino guys did that work for you gets compiled in. In the Espruino, not only is a generally better job done of covering up that kind of crap, but the entire paradigm is changed. In Arduino, you're writing the main loop, you're forever reimplementing things to do time delays gracefully (ie, what we do setTimeout and setInterval for - I swear, like a quarter of posts on the Arduino forums are about that) - In Espruino, it's event based, which really makes a lot more sense for most of the kind of things you'd want to do with a microcontroller. You've got more between you and the board on Espruino, but it's not bull, it's there to cover up the bull.

    A few other comments...

    • You will never learn using microcontrollers, or programming anything frankly, if you get one and just follow through examples. You learn by wanting to do something that you need this capability for, and learn it with that goal in mind. From there, it's easier to apply to other projects. The project to show a temperature on an LCD is interesting not because that's an interesting thing to do, but because it's an example of reading a temperature, an an example of controlling an LCD, waiting for you to ripoff the code and adapt it to your ends.

    • Speaking of which, IME, it's usually easier to move around pieces of Espruino JS code (between projects, from examples, etc) than arduino C, or maybe I just write shitty C but passable JS.

    • The trick is picking the first few projects that's interesting, but not particularly hard in the ways you don't understand. Of course - that sense of what's hard and what's easy is exactly what you don't have when you're new to working with something. It helps of course to have something where the "easy" areas are larger, which is very much the case with Espruino vs Arduino.

    • Espruino IDE and ST driver is painless to install on windows.

    • I use AVR devices, programmed through Arduino IDE all the damned time. I don't use them for anything particularly sophisticated, though - the Espruino does that much better. But you can drop a Tiny 84 or 85 onto a board, and write some dead simple code and replace a fistful of 555's, multivibrators and logic gates with one chip, and update the behavior later without using a soldering iron. That's the kind of thing I do with Arduino, and it's very well suited to the programming style of the arduino. I've got a few tinys taking orders over RF from an Espruino (and plans for more), plus I use them to do battery indicator, dimming, and fan control on my 150W LED flashlights.

  • the definition for digitalWrite() where the Arduino guys did that work for you gets compiled in.

    I'm not trying to derail the thread, but these definitions are made by Hernando Barragán of the wiring framework. One of the Arduino founders were his professor and then started Arduino based off Hernando's master thesis project (and yes, I'm affiliated with Wiring as a core team member, I apologize for mentioning this here, I have not publicly done this before but it annoys me [much more than Hernando, he's the better man in all this]). </rant>

    To be on topic: I've tried a lot of various boards and ecosystems. This is my favorite.
    It's also easy to use Espruino first to learn how to program against hardware (and I completely agree with DrAzzy, the only way to really learn is to make a project). If you feel like you want to learn C, you could then pull down the Espruino runtime from GitHub and extend it there and further educate yourself as a programmer.

    It is beginner friendly, and open for diving into the more bare-metal world of C.
    Good luck!

  • I thank both of the earlier repliers for their thoughtful responses to my question. Without a doubt-seeing the immediate tangible results of entering some coding into a device is a super good way of learning, and, if it is an interesting project-so much the better.
    In many ways-not only what I asked was very subtle but much more easily answered by someone who is an advanced programer like you both are so thank you. I shall proceed the Espruino way I am just waiting for the new board!
    I have kept the learn how to program book authors in business over the years. I must have over 30 how to books, But, as I said, I find this board very compelling. And my motto is never give up! Reading code in some languages is fairly easy-Python, Ruby, Basic. Writing it is harder-especially if there is no context!

    And I think I just figured out what I have been trying to say.  This is a word that be adopted by programmers because this is precisely what the Espruino does so beautifully.  Nice double screen with the Chrome, simply coding which is sort of like reading text, the context of the Hardware board with its almost immediate tangible results(turn on LED),  and the fact it is event driven.  The event driven part is important because it allow me-the event creator-to see, appreciate, AND LEARN what's going on. !
    

    Would it be fair to say that the Espruino is a "synthetic" RTOS with the coder being the event?

  • In Arduino, you're writing the main loop, you're forever reimplementing things to do time delays gracefully (ie, what we do setTimeout and setInterval for - I swear, like a quarter of posts on the Arduino forums are about that) - In Espruino, it's event based, which really makes a lot more sense for most of the kind of things you'd want to do with a microcontroller. You've got more between you and the board on Espruino, but it's not bull, it's there to cover up the bull.

    @DrAzzy, thanks for that statement.

    Coming from the inverse as @user53407 - literally AND numerically: lots of SW and only tinkering with and books on HW, even though tinkering with HW started first - I tried to befriend the HW and micro controller world for a while... some Z8 a very while ago, then some SX from (gone) ubicon, then - with big hopes but not much sustenance - Arduino - until now with Espruino. May be having walked this path made Espruino so attracting and compelling to spend and continue spending countless hours on-top of the hours of my life I spend on coding for making living. ...or may be I'm just another dunce and wasted my life on myself to get better at something - coding? - I was never destined for... not a great retro that far in life (time) and an even a worse outlook... to make a substantial course correction and reaching that different goal... (no worries, no intention to change, just to learn and grow, adding things to my tool belt...).

    That's what matters: never give up on life long learning... and like learning to swim works only satisfactorily in water - literally - picking up an own idea about a project and beginning to wade into it, join others in their journey - as participant or even as a observer only - makes it fun and gets you there. Who said 'painless'? the pain inflicted on yourself will define the gain on arrival.

    ..."synthetic" RTOS with the coder being the event?

    ...abstract: yes. RTOS 'real'... not really... because the setup is matter of fact putting something between you - and more so the real time - and the board,. But that makes it even more attractive dive in and overcome the challenges by finding the right thread of thought, algorithms, and adjustments to get 'there' no matter what. I have to say that the friendly faces of the coin which is placed between me and the board outnumber the challenging one(s) by 2 : 1... with the rim being the libero circling around the challenging one and getting it more and more transformed to my liking.

    Apply what you learned in your HW world and you will enjoy the journey of growing in coding. Im sure hat the benefits of a 'small (static and dynamic/logic) interface' between any sub system / component in HW is - 'less wires' - are the same as in software: better use, less dependency... To achieve this in HW, SW - aka programming - helps a lot with it.

    PS: I'll remember you... and watch out: I may tap into your HW experience pool times to come...

  • I started my microprocessor and programming journey using the parallax basic board about 10 years ago and gradually moved myself to different microprocessor 'platforms'. I.e. Arduino Mega, mBed, espruino and most recently, the GHIElectronics Raptor which can be programmed in VB and C# using the Microsoft .net Micro Framework. Using all these frameworks helped me to learn basic, C, C++, C# and Javascript. Out of all those microprocessor frameworks I seem to gravitate more towards the Espruino, why? Well, for the simple fact that It is so freaking easy to get a project up and running and finished within 2 to 3 days. Eventbased programming such as JS makes better sense to me. Also, the Espruino community is awesome and most questions do not go unanswered. I cannot wait for the Pico to be released and what the future holds for the Espruino :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Very General Question About Learning Some Coding

Posted by Avatar for cappy @cappy

Actions