You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi Matt,

    I'm very happy for some tidying up (I want this to be as maintainable and easy for people to tweak as possible) - but please try to change it such that it really is easier for people to get into, and not just easier for you because you're used to working on websites with Angular :)

    For example I actually found it extremely difficult to see what was going on in your project. This isn't meant as criticism, it's just that I'm not used to AngularJS:

    The folder names are not obvious to me (I've had to look inside them to figure out what they're meant to be). I found the port picker view relatively easily, but the actual JavaScript that drives it is actually spread between the template and the JS file which is in a different folder with a different name and capitalisation. The port picker is also in AngularJS's special template HTML so I've got to delve around in AngularJS docs to see what's meant to happen...

    I can't think I'm the only person that doesn't know AngularJS... I want to make the IDE really easy to understand and modify, even if you have a relatively simple grasp of JS, HTML and CSS (and probably jQuery). I think it's quite a hard balance (which I'm fully aware I haven't got right).

    The movement of HTML creation into the JS was actually something I'd started doing in the refactor, to avoid stuff like this where there are a bunch of things defined and it's not clear which file is responsible for their implementation (especially if buttons can be turned on and off from the Settings menu). There's so much code in the IDE that you can't have a single JS file per view, and if you can't do that, things get difficult very quickly if you don't somehow define the HTML along with the code that expects to use it.

    So what's the alternative to JS generating HTML? IMO, my usage of CSS/HTML is quite poor - but it feels like when used properly the actual HTML that's generated ends up being about as simple as you can get (and any abstraction might actually make it harder to understand what was going on).

    As far as libraries - I'm happy to use other libraries, but again - personal taste. The only library in your vendor folder I know of is jQuery, so to me, every time one of them is used in code it's something I have to Google, try and find documentation for (which is hard in some cases) and understand before I can work with it.

    • What does Ace actually do better than CodeMirror? I've already tweaked jshint to get rid of warnings for Espruino-specific things (eg. ES6's binary numbers), and the autocomplete suggestions are at least vaguely Espruino-related, so just changing for the sake of it would be a bit of a step backwards.
    • The Terminal was written over a year ago when I couldn't find a terminal plugin that I could get working nicely. I guess things have moved on now - however it still has changes that make it well suited to Espruino (like the ability to insert HTML between terminal lines, which helps with the tutorial). If the terminal really adds something we could change it over - but I don't want to be in a position where any changes are actually removing functionality from the Web IDE.

    Anyway, that's all a bit long - but I hope it explains where I'm coming from...

    As an aside, it strikes me that we might be able to forward serial communications over HTTP (or WebSockets when Espruino implements them)... If we could do that, it might actually be possible to serve up the Web IDE from the Espruino itself - which would be pretty awesome :)

About

Avatar for Gordon @Gordon started