# Any decent Javascript Courses about?



## jononotbono (Sep 9, 2021)

I'm looking to for a Javascript course that I can study. Anyone here got any recommendations? 
Many thanks

Jono


----------



## angeruroth (Sep 9, 2021)

JavaScript Tutorial


W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.




www.w3schools.com




If you need help I think some of us here know a thing or two about this


----------



## jononotbono (Sep 9, 2021)

angeruroth said:


> JavaScript Tutorial
> 
> 
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
> ...


Thanks. I really wanna do a course. I'm at that point were scrapping together bits of code and stumbling in the dark is just now a pain. Thanks for the link! And it's free! I was just looking at this Udemy course for £16 that has 68hrs of video lessons which sounds like an insanely good deal/value for money. Depends though. Maybe it's 68hrs of nonsense 😂

https://www.udemy.com/course/the-complete-javascript-course/


----------



## Manaberry (Sep 9, 2021)

What do you have in mind Jono?


----------



## angeruroth (Sep 9, 2021)

Well, that course looks good and the price is great, so if you like it I'd say go for it  And you can mix both sources to see things from different perspectives.


----------



## davidson (Sep 9, 2021)

I'd recommend codeacademy https://www.codecademy.com/catalog/language/javascript or treehouse https://teamtreehouse.com/

Both are excellent and have structured paths to follow. Codeacademy is the better of the two IMO, even if it doesnt quite have the polished presentation of treehouse.


----------



## tabulius (Sep 9, 2021)

I'm in the same boat. A quick search on Youtube gave a bunch of tutorials for beginners ranging from an hour, 3-hour, and 8-hour videos. I think for basics, Youtube covers a lot. Many of the tutorials seem to focus mainly on the web development side; forms, e-commerce etc. I don't know if they are useful or not in VI-world.


----------



## JyTy (Sep 9, 2021)

@jononotbono Udemy course looks like a great place to start! Went through the content and looks like a lot of the ground is covered (I'm a senior web dev with 12+ years of experience in coding) ... probably all of the courses will have a focus on web development, but nothing wrong with that as some of the concepts could be applied elsewhere as well ... but just a warning, this stuff ain't so simple ...


----------



## d.healey (Sep 9, 2021)

FunFunFunction's videos have been very helpful to me, maybe not for a complete beginner though.


----------



## darcvision (Sep 9, 2021)

i bought this javascript course because i know him from his reactjs course. in my opinion this javascript course is pretty good and it has example project.


https://www.udemy.com/course/javascript-the-complete-guide-2020-beginner-advanced/


----------



## d.healey (Sep 9, 2021)

tabulius said:


> I don't know if they are useful or not in VI-world.


Javascript isn't a realtime language so isn't that great for VIs but it's a very useful language to learn.


----------



## Drjay (Sep 9, 2021)

Did not look at the above mentioned courses in detail but it is likely there are at least partly focused on web development. Maybe have a look at tutorials/courses which have a focus on node/node.js.


----------



## jononotbono (Sep 9, 2021)

JyTy said:


> but just a warning, this stuff ain't so simple


Well, nothing is as difficult as writing great music so I'm for having a go!


----------



## jononotbono (Sep 9, 2021)

tabulius said:


> I don't know if they are useful or not in VI-world.


Well, I'm currently in the middle of building a touch screen controller and it uses JS so I need to get better to realise the ideas I've recently come up with.


----------



## angeruroth (Sep 9, 2021)

jononotbono said:


> Well, I'm currently in the middle of build touch screen controller and it uses JS so I need to get better to realise the ideas I've recently come up with.


 Your touch controller is built with JavaScript??


----------



## jononotbono (Sep 9, 2021)

angeruroth said:


> Your touch controller is built with JavaScript??


Yes 😂


----------



## Crowe (Sep 9, 2021)

Freecodecamp or codecademy.


----------



## RogiervG (Sep 9, 2021)

oh the horror.. vanilla js (yes, i don't like it for too many reasons to mention here)
if it needs to be in the js realm: typescript is way better...(as in code writing)

anyway.. that aside..


----------



## jononotbono (Sep 9, 2021)

RogiervG said:


> oh the horror.. vanilla js
> typescript is way better...


Well, eventually I'm going to learn C# because that's the language used by Unity and I want to continue into the realm of videogame development but for now, JS and KSP are the two languages that are most useful for me and music.


----------



## Drjay (Sep 9, 2021)

RogiervG said:


> oh the horror.. vanilla js (yes, i don't like it for too many reasons to mention here)
> if it needs to be in the js realm: typescript is way better...(as in code writing)
> 
> anyway.. that aside..


Horror = javascript? Did you ever try python? Worst programming language ever imo


----------



## RogiervG (Sep 9, 2021)

Drjay said:


> Horror = javascript? Did you ever try python? Worst programming language ever imo


i don't like python either... 
but out of the two, python (except for the weird indentation and being quite slow) is the better of the two (also more useful on the non web side of things (sure you have node and deno, but it's not on par imho, think the worst eco system ever not on par.. (npm is a fluke in contrast, lots of abandoned packages, or just outright bad coded ones. Python packages are more mature overall))
but then again, i am not a web person in development... so yeah there that too... (and i am "old", not going for the next bling bling shiny shiny thing, like younsters)


----------



## Dewdman42 (Sep 9, 2021)

I think a lot of the courses on Javascript are going to be all about web app programming more so then core javascript, and I think you're wanting to learn more about the basic core functionality of the javascript language more so then learning how to make a complete web app. I think you're probably wanting to extend the Open Stage Control stuff, yes?

I really think most javascript courses will probably take you on a journey that will be a distraction more then anything. The core of Javascript is actually pretty simple. Then you'll need to learn OSC's extensions and API that it is using with Javascript language. That's about all there will be to it. I don't know much about OSC, so I can't comment much further about that, but just saying, most of the courses on javascript are going to spend a chapter or two on core javascript and then they will jump right into making web apps in javascript, which is the most common case and considerably more complicated then the basic javascript language. Then they will probably dive into some more javascript core concepts over time as you build a web app, etc..but a lot of that will be a big distraction for you I think.


----------



## Drjay (Sep 9, 2021)

RogiervG said:


> i don't like python either...
> but out of the two, python (except for the weird indentation and being quite slow) is the better of the two (also more useful on the non web side of things (sure you have node and deno, but it's not on par imho, think the worst eco system ever not on par.. (npm is a fluke in contrast, lots of abandoned packages, or just outright bad coded ones. Python packages are more mature overall))
> but then again, i am not a web person in development... so yeah there that too... (and i am old, not going for the next bling bling shiny shiny thing, like younsters)


That‘s what I had in mind. A language where indentation is part of the syntax??? What is wrong with curly brackets? Every programmer should aim for a clear segregation of presentation and data layer. Whereas in the case of python this principle is violated right from the start within the language itself. Sounds absurd to me. I never got accustomed to it, although I have to admit python has its merits.
I‘m also „older“ and neglected javascript for a long time. But I in the meantime I really like it. Performance is good and it‘s relatively easy compared to c and c++. Although messing with pointers, references etc. or coding a word processor in one line of code ( ) can be fun, I prefer not to deal with memory, data types etc. except for performance critical applications or microcontrollers.
But anyway, js is the only way to program OSC.


----------



## jononotbono (Sep 9, 2021)

Dewdman42 said:


> but a lot of that will be a big distraction for you I think.


Definitely don't have time for distractions right now. I mean, as if OSC isn't one already 😂


----------



## JyTy (Sep 9, 2021)

jononotbono said:


> Well, nothing is as difficult as writing great music so I'm for having a go!


Yeah? :D ok let’s catchup in a couple of months and you’ll tell me 

doing music is the best thing as far as I’m concerned… and sooner than later something good comes out of it… making a living with that is another subject…


----------



## jononotbono (Sep 9, 2021)

JyTy said:


> Yeah? :D ok let’s catchup in a couple of months and you’ll tell me
> 
> doing music is the best thing as far as I’m concerned… and sooner than later something good comes out of it… making a living with that is another subject…


Thanks


----------



## Dewdman42 (Sep 9, 2021)

what I would recommend is just start into it, and whenever you have a question you can always ask here or check out many numbers of posts on the internet where javascript related questions have been asked and answered, as you come on it. There really isn't that much to learn about javascript in general, its a pretty simple language at its core. There are numerous web pages out there that run through the basics of the language. if you have never done any programming before of any significance, then it may take you a bit to get your head wrapped around a few things, but mainly I think it will be about learning the OSC api, and then how to go about storing data in javascript structures that suit your purpose.


----------



## InLight-Tone (Sep 9, 2021)

Try:
Lynda: Foundations of Programming, Fundamentals
for the mindset of [programming using Javascript.

Or/then:
Lynda: Javascript Essential Training


----------



## Drjay (Sep 9, 2021)

Dewdman42 said:


> I think a lot of the courses on Javascript are going to be all about web app programming more so then core javascript, and I think you're wanting to learn more about the basic core functionality of the javascript language more so then learning how to make a complete web app. I think you're probably wanting to extend the Open Stage Control stuff, yes?
> 
> I really think most javascript courses will probably take you on a journey that will be a distraction more then anything. The core of Javascript is actually pretty simple. Then you'll need to learn OSC's extensions and API that it is using with Javascript language. That's about all there will be to it. I don't know much about OSC, so I can't comment much further about that, but just saying, most of the courses on javascript are going to spend a chapter or two on core javascript and then they will jump right into making web apps in javascript, which is the most common case and considerably more complicated then the basic javascript language. Then they will probably dive into some more javascript core concepts over time as you build a web app, etc..but a lot of that will be a big distraction for you I think.


I agree.
You won‘t need much. I guess I mentioned it already in another thread:
Different types of loops (including iterators „for each“)
Conditions (note the difference of =,==,===)
Arrays (simple, associative aka array of objects). Especially important when reading and parsing json.
Type conversions. Normally no big problems with data types in js, but can be a pain in the wrong place (numbers vs strings vs objects)
String functions
Some Math. functions

Well, the list got longer than I thought  

The fun part of js for me is the idea that everything can be an object even functions. You can store functions in variables easily. Imagine an array of functions which get called according to the value of the index. No lengthy if thens necessary…








JavaScript Function Definitions


W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.




www.w3schools.com




Probably not that helpful, but might give you the one or other hint where to look at


----------



## jononotbono (Sep 9, 2021)

Dewdman42 said:


> what I would recommend is just start into it, and whenever you have a question you can always ask here or check out many numbers of posts on the internet where javascript related questions have been asked and answered, as you come on it. There really isn't that much to learn about javascript in general, its a pretty simple language at its core. There are numerous web pages out there that run through the basics of the language. if you have never done any programming before of any significance, then it may take you a bit to get your head wrapped around a few things, but mainly I think it will be about learning the OSC api, and then how to go about storing data in javascript structures that suit your purpose.


Thanks man. All your advice has been great. I'm actually looking at someone called Net Ninja. Seems excellent.


----------



## Dewdman42 (Sep 9, 2021)

Yea so for example, the red courses would be a great start, but ignore the last one of those on the "document model" which is more related to website programming. Unless of course OSC also allows you to access the DOM, in which case that might eventually be more interesting too.


----------



## Dewdman42 (Sep 9, 2021)

but actually even that course has a lot of web programming related distractions frankly. If you can see past all that stuff you can learn the basics of javascript...but basically I think this will be more confusing honestly...

Try this: https://www.w3schools.com/js/js_syntax.asp


----------



## Crowe (Sep 9, 2021)

This is all personal.

I personally don't think 'Web programming related distractions' are distractions at all. It's an application of Javascript just as animation is an application of Javascript (which is what Codecademy's course is based on). That's like saying a course on MVC is useless if you're trying to learn C#. It's really not. Applied programming will forever be more useful to me than a pointlessly general course.

Anyway. I suggest using one of the mentioned platforms to get a hang of the syntax, how to declare scope, variables and how to write functions, then getting a reference book and start with your preferred platform instead of doing entire courses. Courses generally just end with me stuck in tutorial-hell.

Actually, considering what I've seen of your Unity adventures you should already know a bit of programming so jumping in with a reference book or doing a few very specific exercises to get the hang of it should really suffice. Javascript is quite like C#, except utterly unstructured and so weakly typed I'm sure it has a broken spine.


----------



## Dewdman42 (Sep 9, 2021)

The thing to understand about Javascript, is that as a language it is very very simple. Because it is so simple it is very easy to add into an application as a little built in scripting language. You can learn the whole language in a couple hours or less if you have any programming experience prior. There is nothing complicated about it. Javascript is used by a very wide variety of products as an embedded script language. When its used as an embedded script language, the basics of the language are usually mostly there, some of the main typical math and string libraries are usually there too. Beyond that, the "thing" that is embedding javascript will then add some functionality of their own through a javascript-based api that they supply. 

LogicPro Scripter is one example. 

Web browsers are another example of embedded javascript. But the web browser approach involves a DOM, to access all the elements on a web page, including hidden data, etc.. for one thing. For another thing there are numerous functions that the web browser adds to the base-javascript...which is the Web browsers API...timer related functions and stuff that will NOT be available when using nodejs or some other javascript-enabled application. Those are specific to the web browsers.. Also, the way that javascript is typically embedded into web pages is by using certain syntax in the HTML markup. So for example the Net Ninja stuff mentioned above, I just briefly started a couple of them to take a look and it was getting long winded talking about setting up an HTML test server and various forms of markup needed...all of this is really outside the realm of core javascript and will not be relevant to Open Stage Control at all.

I looked briefly at Open Stage Control and its javascript usage is extremely simple. It is way overkill to learn about programming web apps in javascript, truly a distraction. But hey, if you always wanted to know how to program a web page, go for it. But I feel its not applicable at all here. It would be far more interesting for us in this forum to discuss Open Stage Control and how javascript is used...specific questions about javascript I expect to be very simple and answered easily.

There same is true for LogicPro Scripter.....nothing about programming web apps is relevant. Only the very basic javascript knowledge is needed and then you have to learn the specific API that Apple embedded into LogicPro Scripter using that simple javascript language. Some people, including yours truly, have pushed javascript to the limit inside LogicPro scripter..I have written scripts that are thousands of lines of code and do some pretty amazing things....but yet none of that was making any use of the stuff that is relevant to web programming.

different applications that embed javascript usually have just the core of javascript.


----------



## Dewdman42 (Sep 9, 2021)

I would also add that eventually I will probably dive down the Open Stage Control rabbit hole also, so I would be interested also in learning what javascript integration is possible in it.


----------



## Dewdman42 (Sep 9, 2021)

Crowe said:


> except utterly unstructured and so weakly typed I'm sure it has a broken spine.



This, I consider to be an extreme advantage of JavaScript for this type of scenario. This provides extreme flexibility to do some things with a minimal amount of code. its really easy to just build up un-classed objects on the fly, for example. 

Highly structured and typed language make more sense when working on larger software projects, where much code will be reused and shared between different components and developers...the structuring and typing, helps to find errors in the code at compile time and prevents difficult-to-debug problems from emerging, but this is very very rarely an issue with small little embedded scripts. In this case you want compact code that gets the job done with the least amount of coding possible.


----------



## Crowe (Sep 9, 2021)

Dewdman42 said:


> This, I consider to be an extreme advantage of JavaScript for this type of scenario. This provides extreme flexibility to do some things with a minimal amount of code. its really easy to just build up un-classed objects on the fly, for example.
> 
> Highly structured and typed language make more sense when working on larger software projects, where much code will be reused and shared between different components and developers...the structuring and typing, helps to find errors in the code at compile time and prevents difficult-to-debug problems from emerging, but this is very very rarely an issue with small little embedded scripts. In this case you want compact code that gets the job done with the least amount of coding possible.


I don't know, maybe in applications such as these, but I'm a web-developer and I've always considered Javascript to have been dragged up out of a Circle of Hell. Debugging it was crap before Chrome became my go-to and its only gotten marginally better. Worse if you consider stuff like Angular and VueJS having been built on top of it. (I swear when I first heard they'd done dependency injection in JS like that I felt like Jeff Goldblum in Jurassic Park)

The amount of bugs I've had come through my hands caused by stupid mistakes that would've been easy to avoid or impossible to make in a strongly type language has paid for multiple months of rent. Which one might consider a boon, but frankly I'd rather work as a bartender than debug one more line of Javascript.

I've actually not used JS in Unity, I imagine it's much easier to debug there. Still not gonna do it while it has C#.


----------



## tc9000 (Sep 9, 2021)

+1 for Net Ninja


----------



## Dewdman42 (Sep 9, 2021)

as I said, in a larger project and particularly with a team of developers, then typing would be helpful, its why TypeScript came to be.

for embedded scripting I would see typing as just something making it more complicated then it needs to be. Particularly object typing.


----------



## Drjay (Sep 9, 2021)

Dewdman42 said:


> This, I consider to be an extreme advantage of JavaScript for this type of scenario. This provides extreme flexibility to do some things with a minimal amount of code. its really easy to just build up un-classed objects on the fly, for example.
> 
> Highly structured and typed language make more sense when working on larger software projects, where much code will be reused and shared between different components and developers...the structuring and typing, helps to find errors in the code at compile time and prevents difficult-to-debug problems from emerging, but this is very very rarely an issue with small little embedded scripts. In this case you want compact code that gets the job done with the least amount of coding possible.


I agree, but it depends on the definition of ‚little‘. My current script has ~4k lines of code. I sometimes run into situations, where I mix up data types, since I could not remember whether I defined a variable as integer or string (especially when reading jsons). Since errors are seldom thrown in those cases, it might take me a while to find out what is going wrong. That‘s where typing would help me…
Maybe I should prefix variable names with a type identifier.


----------



## Dewdman42 (Sep 9, 2021)

Drjay said:


> Maybe I should prefix variable names with a type identifier.



when in doubt, yes.

the free form object structure is what I find supremely useful in JavaScript. For example, in LogicPro Scripter, I can take an Event object...which is something defined by Apple that is passed into the script. Ok so far. I can add any attributes or methods to that on the fly...without issue. Its not necessary to subclass anything or deal with formalized typing of objects, which can become quite verbose otherwise.

As you noted earlier, in Javascript, EVERYTHING is an object. And they are objects you can piggyback or mess with to your hearts content as needed without having to mess around with a lot of formalized typing and classing. Its possible to get into the weeds with that, no doubt, but I have found it very convenient and simple to be able to, for example, receive an Event object, add some of my data to it and let it be passed around the script same as before..nobody complained. Because the objects are not typed strictly.

Typing ints, strings and floats could be an easy improvement that wouldn't add much complexity to scripts and could definitely help you find problems after translating some JSON and scratching your head why something isn't working. But anyway, that isn't javascript today...


----------



## jononotbono (Sep 9, 2021)

Crowe said:


> This is all personal.
> 
> I personally don't think 'Web programming related distractions' are distractions at all. It's an application of Javascript just as animation is an application of Javascript (which is what Codecademy's course is based on). That's like saying a course on MVC is useless if you're trying to learn C#. It's really not. Applied programming will forever be more useful to me than a pointlessly general course.
> 
> ...


I know bits and pieces of scripting. And I continue to learn a ton with someone I am working with on my OSC controller but it’s annoying not being completely fluent so I can just create what ever I want especially as I get bigger ideas that I want pull off. So that’s why I’m gonna just learn the language. Either way, there’s tons of great advice in this thread and thanks to everyone for sharing.


----------



## jononotbono (Sep 9, 2021)

I would also like to add. I've now officially renamed the Touch Screen Rabbit Hole to THE HOLE.
It's like prison slang for "He's back in the shu". 

"Ah no mate, this sounds terrible. You're not back in THE HOLE are ya?"

As if we have a choice. It just sucks you in. 😂


----------



## d.healey (Sep 9, 2021)

jononotbono said:


> So that’s why I’m gonna just learn the language.


Learning the language is not the difficult part. All programming languages (except FAUST!) are essentially the same, they just use slightly different syntax and have their own mix of of basic functions. When you get deeper into it there are bigger differences, especially in structure, but at a basic level they're all very similar.

If you become "fluent" in a programming language you will go insane. What you have to become fluent in is knowing how to read the documentation for the langauge and libraries that you're using. So when you think of something you want to do you can quickly get to the reference that tells you how to do that thing.

The key to being a competent programmer is having a really good grasp of boolean logic, and understanding what makes efficient code and what makes ineffeficient code. The easiest way to become a better programmer is to read lots of code and write lots of code. It doesn't matter if the thing you're coding is your end goal or even the final language you're going to be working in, you'll become a better programmer all around. *This takes years*.

Javascript is an excellent langauge to learn, and if the music thing doesn't work out for you you'll have a good start at becoming a (client side) web developer


----------



## Crowe (Sep 9, 2021)

jononotbono said:


> but it’s annoying not being completely fluent so I can just create what ever I want especially as I get bigger ideas that I want pull off.


You're not a computer, curb those expectations and get a reference manual. XD

In all seriousness, you should really just jump in and try out stuff. I retract my earlier statement in saying that web-related things would be valuable (they are, just not for you right now); learn the API of the application instead. Knowing 'bits and pieces' of scripting should be sufficient to understand how programming works; this is the biggest hurdle for any beginner.

If you're not confident in your 'basic programming fluency', find examples. I suggested web-related things are valuable simply because there's a lot of relevant content to be found. This is meaningless if you're already past that point.

Anyway. To me the only thing more frustrating than learning programming is talking about how to best learn programming so I'm out for the remainder of that discussion XD.


----------



## RogiervG (Sep 9, 2021)

d.healey said:


> Javascript is an excellent langauge to learn.


it has lots of weird things no other language has, so i would not say "excellent". an "ok" language would be better fitting. each to their own i guess


----------



## d.healey (Sep 9, 2021)

RogiervG said:


> it has lots of weird things no other language has, so i would not say "excellent"


All languages have weird things other languages don't have. Javascript is easy, you don't have to worry about garbage collection, or strict variable types. It can teach you all about variables, arrays, objects, loops, ifs, selects, etc.

At the same time it is a highly practical (if somewhat inefficient) langauge that can be used to build websites, desktop apps, mobile apps, games, and audio plugins (HISE script). Once you learn javascript you'll also find you can make out what's going on when you look at a more complex language like C++, it also shares similarities with PHP's syntax, so if you ever go into server side programming you'll find it quite familiar. 

I'm not saying Javascript is the best language for a beginner, I don't think there is a best, but there are much worse choices out there (lua...)


----------



## jononotbono (Sep 9, 2021)

Crowe said:


> In all seriousness, you should really just jump in and try out stuff.


I am. My OSC controller is nearly at 200k lines of code. The articulation scripting is currently at another 5k+ lines that I scripted myself (after, of course, being shown how to do it) and then a few hundred extra for a few other things. Jumping in the deep end is exactly where I like to swim haha


Crowe said:


> You're not a computer, curb those expectations and get a reference manual. XD


Haha True. But the new Matrix trailer just came out so I now have a new dream.
Anyway, jokes aside (some "coders" here seem to be very serious), I shall continue with my endeavour. It's good to see who is helpful on these matters though!


----------



## d.healey (Sep 9, 2021)

jononotbono said:


> My OSC controller is nearly at 200k lines of code.


That's not necessarily something to be proud of. More code usually means less efficient, but it's also an indicator of a true beginner so you're doing fine


----------



## jononotbono (Sep 9, 2021)

d.healey said:


> All languages have weird things other languages don't have. Javascript is easy, you don't have to worry about garbage collection, or strict variable types. It can teach you all about variables, arrays, objects, loops, ifs, selects, etc.
> 
> At the same time it is a highly practical (if somewhat inefficient) langauge that can be used to build websites, desktop apps, mobile apps, games, and audio plugins (HISE script). Once you learn javascript you'll also find you can make out what's going on when you look at a more complex language like C++, it also shares similarities with PHP's syntax, so if you ever go into server side programming you'll find it quite familiar.
> 
> I'm not saying Javascript is the best language for a beginner, I don't think there is a best, but there are much worse choices out there (lua...)


You know I respect you and you know I have bought some of your KSP courses and also watched your Thinkspace KSP lessons (including unreleased lessons that I have).

Today though, I did learn something about your origins.

You have said "Hello World" as one of the first things you ever taught...






I'm glad to see I'm on the right track. 😂


----------



## jononotbono (Sep 9, 2021)

d.healey said:


> That's not necessarily something to be proud of. More code usually means less efficient, but it's also an indicator of a true beginner so you're doing fine


Where did I say I proud? I'm just giving an example of getting my hands dirty. Very dirty haha


----------



## jononotbono (Sep 9, 2021)

d.healey said:


> More code usually means less efficient


Totally agree and someone keeps telling me that. It also might be an indicator that I'm creating something that has some stuff in it. Being purposely vague haha


----------



## d.healey (Sep 9, 2021)

jononotbono said:


> Where did I say I proud? I'm just giving an example of getting my hands dirty. Very dirty haha


Well I agree that writing lots of code is a great way to learn. Also reducing a lot of code into less lines is a good exercise. We do this on the HISE forum quite a bit, someone will post some code and we'll take turns (or sometimes it's just me talking to myself) trying to get it to as few lines as possible.

After you've finished your current draft you can start the next one by using what you already have but writing it in fewer lines.


----------



## d.healey (Sep 9, 2021)

Oh here's a tip. Use a style guide (there are a few out there) - https://github.com/airbnb/javascript - this will help you to write good readable code.


----------



## Crowe (Sep 9, 2021)

d.healey said:


> or sometimes it's just me talking to myself


At one point during my tenure at my first programming job, I went to McDonalds, bought a Psyduck happymeal figurine and put in on my desk as a RubberDuck.

It's currently sitting half a meter away from me.

My colleagues loved it. For multiple reasons. I still love it. Also for multiple reaons.


----------



## jononotbono (Sep 9, 2021)

Crowe said:


> At one point during my tenure at my first programming job, I went to McDonalds, bought a Psyduck happymeal figurine and put in on my desk as a RubberDuck.
> 
> It's currently sitting half a meter away from me.
> 
> My colleagues loved it. For multiple reasons. I still love it. Also for multiple reaons.


Man, if we had met earlier, I could have given you a framed photo of me that you could put on your desk and your colleagues wouldn't only just love it, they would finally believe you have some real friends 😂


----------



## Nimrod7 (Sep 9, 2021)

My guys at work love Frontend Masters,
Lots of really good courses in there for JavaScript and Frameworks:





__





Learn JavaScript, Front-End Web Development and Node.js with Frontend Masters Courses


Whether you want to learn professional JavaScript, the latest framework like React and Vue.js – we have courses to bring your skills to the next level!




frontendmasters.com


----------



## Technostica (Sep 9, 2021)

Many decades ago I used to work as a programmer on IBM mainframes. 
I found the whole corporate culture boring so I didn't do it for more than a few years. 
Years later I taught myself Windows programming as a hobby using Visual Basic 6. 
That was easy to pick up as it wasn't object orientated.
Then I moved to Delphi which was much more sophisticated, although I used it mainly as a procedural language when it is actually OO by nature. 
I never made the move to OO which was generally fine as I was mainly writing small apps for myself. 

The best way to learn is to actually have a project that you care about, so you are on the right path there. 
I found it useful to browse 3rd party books on Delphi as I would come across tips and tricks that would inspire me. 
I never read them all the way through, so just browsed for things that caught my eye.

I have no advice for JS in particular, but try to enjoy it. 
I found programming to be fun. 
The last app I wrote was to convert a spreadsheet that contained details of the stock that my business held, into a format that could be imported into a database to make my accounts easier.
I don't know if it saved me time that first year, but it was more fun to write it than to manually copy the data. 
Plus I had it for future years. 

I wrote an MP3 player twenty years ago that was so far ahead of most of the mainstream players. 
I found one function that enabled me to do sorts and searches on flat files incredibly quickly. 
It meant I didn't need to use a database which I never enjoyed working with. 
It was so fast even on twenty year old hardware, so wonder how it would be today! 

I also wrote some basic DSP stuff using Intel's libraries which were free at the time. 
In another life I could have been a developer for Kontakt or even instruments maybe!


----------



## Technostica (Sep 9, 2021)

Why not find someone to run your ideas against? 
They might be able to give you pointers on where you are going wrong and what might be fruitful avenues to explore.


----------



## rudi (Sep 9, 2021)

@jononotbono I don't know your level of knowledge or what language(s) you have used; or how you intend to use javascript, but there is a good set of free structured tutorials here:

https://www.w3schools.com/js/default.asp 

It's quite comprehensive and also useful as a reference, plus you can run/write the examples directly in their online "Try it" editor with the code on the left, and the results on the right.


----------



## jononotbono (Sep 9, 2021)

rudi said:


> @jononotbono I don't know your level of knowledge or what language(s) you have used; or how you intend to use javascript, but there is a good set of free structured tutorials here:
> 
> https://www.w3schools.com/js/default.asp
> 
> It's quite comprehensive and also useful as a reference, plus you can run/write the examples directly in their online "Try it" editor with the code on the left, and the results on the right.


Thank you so much Rudi


----------



## tabulius (Sep 10, 2021)

d.healey said:


> Javascript isn't a realtime language so isn't that great for VIs but it's a very useful language to learn.


"Customized and real time safe Javascript Engine". That was from HISE website, so is it or is it not that great for VI? My pea brain is confused


----------



## Soundbed (Sep 10, 2021)

+1 for CodeAcademy, which offers a free trial period.

I learned enough (vanilla) JavaScript from (trial period of) CodeAcademy, W3 schools, YouTube and especially StackExchange (when I got stuck) to build a project.

Plus a couple questions to friends got me through critical points. 

I also bought a really good Udemy course but that was mostly for the CSS pieces of the web “app” I was building, which was an interactive dashboard. https://www.udemy.com/course/the-complete-web-development-bootcamp/learn/

(Didn’t read this whole thread.)

Hope you enjoy learning code! It changes your brain!


----------



## d.healey (Sep 10, 2021)

tabulius said:


> Customized and real time safe Javascript Engine". That was from HISE website,


It's all a lie! The HISE version of Javascript isn't Javascript, we call it HISE script although I'm not sure it has a proper name. It's derived from JUCE's Javascript engine so the basic syntax is very similar to Javascript but it's really a different language and is optimized for realtime stuff, so it's perfect for VIs and other types of plugin.


----------



## Dewdman42 (Sep 10, 2021)

d.healey said:


> That's not necessarily something to be proud of. More code usually means less efficient, but it's also an indicator of a true beginner so you're doing fine



Less code is not always better. Sometimes it can be, sometimes not. You have two primary goals related here: execution efficiency and code readability.

First, code is not read in real time it is generally compiled in some way. Secondly, sometimes you actually have to write a lot of code that does a lot of setup during one phase so that another phase will have less work to do and execute faster when it really matters. 

I have seen all manner of clever coders trying to reduce multiple lines of code into a single cryptic line that is difficult to understand, difficult to debug, and provides no real advantage other then showing off the coder’s ability to conceive of such a thing. And after compiling with optimizations, it makes no difference to execution time whatsoever. 

There are definitely all manner of smart and dumb coding which use less or more cpu cycles to get certain tasks done, and that comes down to developing a mind for algorithm development. But I’m just saying, it is not necessarily true that the algorithm with the least lines of code is always the fastest way to get the task done, and neither is it always more readable. 

And in fact, just for the sake of readability and future code maintenance sometimes it is completely justified to make slightly less efficient code merely because you know it will need to be edited often and now you have a third goal which is to minimize the number of hours that you or someone else will need to spend editing the code in some way. Again sometimes thst requires setting up MORE code so that a data driven approach can be used which usually requires more generic code and then allows behavior to be changed while changing only a few data lines of even by just changing some JSON somewhere.

These are just a few examples.


----------



## Drjay (Sep 10, 2021)

Dewdman42 said:


> Less code is not always better. Sometimes it can be, sometimes not. You have two primary goals related here: execution efficiency and code readability.
> 
> First, code is not read in real time it is generally complied in some way. Secondly, sometimes you actually have to write a lot of code that does a lot of setup during one phase so that another phase will have less work to do and execute faster when it really matters.
> 
> ...


I agree 100%.  I remember the first time I read the Kernighan/Ritchie and thought: what the heck! Growing older and gaining a little experience, I tend to look at their coding style more from aesthetic view and don‘t necessarily stick to their coding style. So, despite all discussions about best practice approaches for coding, don‘t forget the fun! If you are not coding professional, do whatever you like. I dare to say performance normally is not an issue these days, so you won‘t need the optimal code except for special cases (not talking about professional environments here and totally neglecting robustness). For me readability is the key.
Having said this: Global if you want to !


----------



## d.healey (Sep 10, 2021)

Dewdman42 said:


> You have two primary goals related here: execution efficiency and code readability.


I agree 100% I think readability is a top priority even if it makes the code more verbose. But reducing code to as few lines as possible is a good exercise for learning and understanding logic.


----------



## jononotbono (Sep 10, 2021)

@Crowe You do realise that was just a joke right?


----------



## Crowe (Sep 10, 2021)

jononotbono said:


> @Crowe You do realise that was just a joke right?


Absolutely, I was considering a rebuttal but got sidetracked. XD

EDIT: As in, I'd take you up on that but I'm not sure I could be friends with someone who insults Psyduck like that. He's a true friend. Chose me chose him and all that jazz.


----------



## MartinH. (Sep 10, 2021)

Drjay said:


> I remember the first time I read the Kernighan/Ritchie



No joke, I used to read in that book to fall asleep. Rarely needed more than a page or two.


----------

