GitHub Atom


  • :belt_onion:

    So after someone linked LightTable editor I went to check it out. Of course, with anything "simple", I can't figure out how to use some of it's "simple" features, such as live-updating when editing HTML. Oh well, fine, to googles!

    First (useless) result mentioned another editor, however. Atom, apparently made by GitHub guys. Screenshots look nice, it does the whole live debugging thing as well, screw it, download a binary, try, if it sucks ShiftDelete, right?

    Nope, no Linux build. Fine, I'll build it myself, are there instructions by any chance? Well, yes! Nice!

    Does that... does that say node.js? Node fucking js? For a desktop fucking code editor?

    I swear, this JS-mania is going too far.


  • Winner of the 2016 Presidential Election

    Wasn't Atom the editor that is eccentially a browser. Where you can change designs by using CSS and implement macros with JS?

    Because if that is so, then node.js makes sense.

    Filed Under:Just saying...

    Addendum checking their frontpage for 5 seconds:

    
    Atom is a desktop application based on web technologies. Like other 
    desktop apps, it has its own icon in the dock, native menus and dialogs,
     and full access to the file system.
    
    Open the dev tools, however, and Atom's web-based core shines 
    through. Whether you're tweaking the look of Atom's interface with CSS 
    or adding major features with HTML and JavaScript, it's never been 
    easier to take control of your editor```
    
    Markup by codeblocks not by me :D

  • :belt_onion:

    @Kuro said:

    Because if that is so, then node.js makes sense.

    In a sense that yes, it works. So would installing apache so I can edit shit in TinyMCE and then use PHP to upload it all to my webserver when I'm done!

    Or, you know, take webkit, stick it in there and let it render stuff for you? Naaaah, not enough buzz.


  • Winner of the 2016 Presidential Election

    Wait, how is that the same?

    One thing is an edtior catering towards web-devs that use CSS and JS to design things all the time. By giving them the ability to completely change the way their editor works by using their tools of trade. (Surely hacking some shitty JS together but then again it's for personal use only)

    The other thing might be your workflow for editing a webfile that does not change how your editor works at all.

    Maybe I don't get you. Or maybe you don't get that the editor is not a WYSIWYG-Editor but your average notepad++ using HTML, CSS and JS for configuration and plugins.

    Filed Under: Still seems reasonable to me, tbh

    Addendum: According to the likes, @Arantor agrees with you. Let's mention him so maybe he can tell me where you are right and I am wrong :smiley:



  • Why aren't you using jQuery?


  • :belt_onion:

    Oh, I thought the point was that I see the file I work on update in realtime, not that I can mess with the editor using JS and CSS. Ok, that's nice and all, but why the hell did they even bother with making it a desktop app then?

    Also, you know you could do that without messing with additional server software like node.js? Pretty sure you can style GTK with CSS. I know you can style Qt with CSS. Hell, with Qt, you can actually make the whole interface in QML and allow JS plugins that can even hook into the C++ functions in the background, enabling you to do high-performance stuff in JS at almost no cost!

    Not to mention that we had UI customization and scripting in software for years now and I never saw any of it require a component that was, at least initially, intended to be a freaking server.

    To each his own I guess. But sounds like reinventing the wheel to me.


  • sockdevs

    Of course it's the same. Node.js is generally a JS application server whose primary use is web serving.

    In this case I don't see how its use is substantially any different to the case described: Apache/PHP for serving shit and saving files, which is where the browser does kind of fall down.

    Now, if only Node fused with Webkit were a thing and you could rule the... fuck it already is a thing.

    If you're treating it as a Notepad++-a-like then the entire workflow of smashing together Node and crap is essentially a serious waste of resources, isn't it?


  • Winner of the 2016 Presidential Election

    Oh god, I thought I'd just look through their Forum to find out why they made this browser...
    They call the Link: "Discuss" but viewer discretion is adviced. Looking at this "forum" might shock you!

    Filed Under: Now I can never install Atom anymore, thanks Jeff :D


  • :belt_onion:

    I wanted to make a joke about Discourse and Atom, but I thought naaah, that would be stretching it.

    Well... yeah...



  • @Kuro said:

    is not a WYSIWYG-Editor but your average notepad++ using HTML, CSS and JS for configuration and plugins.

    Then why the fuck should I bother with the thing and its crapload of dependencies? Just so I can write myself a plugin (which I don't want to do anyway - I kinda expect my basic text editor to "just work", and if I need anything more than that, I use an IDE) without knowing anything but Teach Yourself Web Design In 24 Hours?

    That LightTable thing seems amazing, though. I might check it out.


  • Winner of the 2016 Presidential Election

    @Kuro said:

    One thing is an edtior catering towards web-devs that use CSS and JS to design things all the time. By giving them the ability to completely change the way their editor works by using their tools of trade. (Surely hacking some shitty JS together but then again it's for personal use only)

    If only I ever said why I think this exists... for certain people. It's the same problem for Notepad++, Sublime, <INSERT TEXT-EDITOR OF CHOICE HERE> you either use them because "why not, they do what I want out of the box and you can configure them if need be (and there are plugins available,I guess" or you say "I want to get shit done. So I'll use an IDE or another editor that supports the languages I am confident in."

    Atom might not be for you and it might be slightly weird but I don't think it's as bad as you guys are trying to make it. It might have started as some university-final-project or something. It gives me those vibes :smiley:

    Filed Under: It's also free and openSource so there you go.



  • @Kuro said:

    Wasn't Atom the editor that is eccentially a browser. Where you can change designs by using CSS and implement macros with JS?
    Depends. Maybe you were thinking of Adobe Brackets?


  • :belt_onion:

    @Zecc said:

    Depends. Maybe you were thinking of Adobe Brackets?

    I think the point was that you can change the actual editor using JS and CSS.

    I'm slightly tempted to knock up a quick and dirty example of this in QML. Very, very slightly.

    And I'd have to cheat actually, it would have to be QML, not CSS, but that shit is too hard!

    import QtQuick 1.0
     
     Rectangle {
         id: canvas
         width: 200
         height: 200
         color: "blue"
     
         Image {
             id: logo
             source: "pics/logo.png"
             anchors.centerIn: parent
             x: canvas.height / 5
         }
     }
    

    ... oh.



  • @Onyx said:

    I think the point was that you can change the actual editor using JS and CSS.
    You didn't really read what Brackets is, did you?


  • :belt_onion:

    @Zecc said:

    You didn't really read what Brackets is, did you?

    Skimmed. But I didn't see that bit as something they push as a main feature, other than the standard "it's open source, you can help too!", not "hack your own for your personal use". Not that anyone is stopping you, of course.

    Atom, however:

    Open the dev tools, however, and Atom's web-based core shines through. Whether you're tweaking the look of Atom's interface with CSS or adding major features with HTML and JavaScript, it's never been easier to take control of your editor.



  • I have some experience with this technology. A few clarifications.

    • node.js is a wrapper around Google's V8 javascript engine, allowing you to run js based apps outside of browser. It has nothing to do with webkit, which is a DOM layout engine.
    • The current killer-app usage for node.ja is a web server (express.js), however there's nothing about node itself that would prevent it from being used for console (eg. grunt) or desktop apps (which Atom tries to do).
    • Is node's javascript slow? Compared to compiled languages (c, c++)? Definitely. Compared to bytecode statically typed languages (java, c#)? Probably. Compared to other dynamic languages, such as python or ruby? No way.

      V8 is pretty damn good and it's getting better all the time. And if you can write games in python, why couldn't you write apps in javascript (respecting its limitations)?

    • The framework atom editor uses to create a desktop app is [atom-shell](https://github.com/atom/atom-shell). This is some kind of custom desktop wrapper that the guys at github have written specifically for atom. I have practical experience with a similar shell called [app.js](http://appjs.com/), so I will talk about that instead and presume atom-shell is similar.

      So, app.js is a combination of bundled node executable and a chrome browser control wrapped in a simple app. You write your business logic code in javascript and run it in node.js environment (with full access to all the usual modules). But then you have a special module that serves as a bridge to the V8 running in bundled webkit. It's been a while since I messed around with this, but I think they use some kind of shared memory hack, or something.

      Whatever may be the case, bottom line is you can seamlessly switch between your 'backend' and 'frontend' javascript contexts and easily exchange data, update DOM, then database etc. Kind of like developing WPF/Windows store apps using html/css/js for layout. I found it a pretty comfortable experience.

    • The main idea behind atom editor is extensibility. Since the UI layer is just a web page, there's a LOT you can do in a plugin. That's not the case with other competing editors, such as sublime text, where plugins are rather limited.
    • The biggest downside: speed, memory and size. The entire node.js and all dependencies are packaged with the app. That means you have a huge-ass bundle to drag around (100-s of megabytes) and equally big bundle to load into RAM. People have complained about atom's memory and cpu performance, which is abysmal when compared to other lightweight editors it will be competing against.
    • On the other side, that means zero dependencies. Put this thing on an USB stick and you're good to go (probably not during the alpha stage, but eventually).

    Bottom line, if you're ok with system requirements (eg. you're normally an IDE user), atom editor could be interesting. Unfortunately, I think the kind of people who would look for a text editor instead of an IDE are also the people for whom performance will be a deal breaker.



  • Well, the bottom line is that Brackets is also based on HTML+CSS+JS through this thing called the Chromium Embedded Framework. They also encourage plugins, though not as much as the Atom people.

    "Brackets is a sandbox for trying out new ideas for web tooling. New features and extensions are released every 2.5 weeks. It's like getting presents all year long."

    Woo. Yey. :|



  • Unrelated quick observation about LightTable from the original post: It uses diffs for various configuration files... which, I think, are then merged into the final config when you run the app. How rad is that?

    ;; User behaviors
    ;; -----------------------------
    ;; Behaviors are stored as a set of diffs that are merged together
    ;; to create the final set of functionality that makes up Light Table. You can
    ;; modify these diffs to either add or subtract functionality.
    ;;
    ;; Behaviors are added to tags, objects with those tags then automatically gain
    ;; whatever logic the behavior imparts. To see a list of user-level behaviors,
    ;; start typing a word related to the functionality you want in between the square
    ;; brackets (e.g. "theme").
    
    {:+ {
         ;; The app tag is kind of like global scope. You assign behaviors that affect
         ;; all of Light Table here
         :app [(:lt.objs.style/set-skin "light")]
    
         ;; The editor tag is applied to all editors
         :editor [:lt.objs.editor/no-wrap
                  (:lt.objs.style/set-theme "default")]
    
         ;; Here we can add behaviors to just clojure editors
         :editor.clojure [(:lt.plugins.clojure/print-length 1000)]}
    
     ;; You can use the subtract key to remove behavior that may get added by
     ;; another diff
     :- {:app []}}
    
    

  • :belt_onion:

    Nice, thanks for the explanation. Some bits about node here that I didn't know. "Marketing" I guess, everywhere I saw it it was pretty much touted as a JS-based server.

    It all makes slightly more sense when you put it that way. Though I still feel like it's reinventing the wheel using the technologies that were never intended for something like this. At the point where you get to it doing whatever you want it too you could've just wrapped a web application into a web view that can render it properly and call it a day. Hell, aren't dev tools in browsers these days nothing more than glorified JS apps? That's half your editor right there. I actually do sometimes edit code directly in the DOM inspector to test CSS changes quickly before figuring out where I actually want to put them in my CSS hierarchy.

    Also, there already were ways to customize stuff in the application using scripting languages before. How much control you're given is more up to the devs than any other limitations. Again, reinventing the wheel, IMHO.



  • @Onyx said:

    Though I still feel like it's reinventing the wheel using the technologies that were never intended for something like this. At the point where you get to it doing whatever you want it too you could've just wrapped a web application into a web view that can render it properly and call it a day.

    Well, that's exactly the idea. The only missing piece is connecting it to a backend that can actually do things other than DOM manipulation. That's what all these new frameworks (app.js, chrome's packaged apps, atom-shell) are trying to achieve.

    Reinventing the wheel? Not sure. Every new technology is reinventing the wheel in some sense. This is just pushing it in a new direction (bringing web sites and desktop apps even closer together).

    @Onyx said:

    Hell, aren't dev tools in browsers these days nothing more than glorified JS apps? That's half your editor right there.

    I don't think so. I thought chrome dev tools are part of the native chrome window... but I'm not really sure any more (which is, I suppose, the point).

    @Onyx said:

    Also, there already were ways to customize stuff in the application using scripting languages before. How much control you're given is more up to the devs than any other limitations. Again, reinventing the wheel, IMHO.

    Sure, they could spend a few years re-implementing DOM and CSS, and trying to recreate all the flexibility they provide. Or they could take this super-sophisticated open-source layout engine that already exists and get all the benefits (and downsides) that come with it.

    Sublime and GitHub guys each went the separate way. We'll see who was right in the end (not picking a favorite at this point).



  • Are you fucking kidding? Node JS isn't just used as an application server. People have written modules to make using it as a application server easier, but NodeJS by itself is quite low level with effectively just TCP/UDP sockets, some Filesystem tools, and an Event system.

    There's a few random other things built in, but fundamentally NodeJS isn't anything at all. It's up to the developer to build what they want in it, be it a network service, something to manipulate physical hardware, a desktop application or a web application. It's the flexibility and power that the module system gives the developer which enables them to write bridges to Webkit, to be accessed from JS. It's an amazing environment to write things in, and there's modules for virtually anything you could think of as well.



  • I really want to like node, but it's quite clearly not ready for prime time (or it is, and people just absolutely refuse to tell you how to do anything in it). I've been writing code in all sorts of languages, Javascript included, and I can't make it do anything. As a developer I want to write modules, not Google for something that does something similar to what I want and hope for the best.

    Example, I decided to start writing a sample project using node. After the hassle that is installing it on all my dev machines, I go looking for a framework because someone else probably figured out the absolute basics. Install the framework, called sails, try to create a sample object. Nothing. No errors, no logs, just nothing. Moved on.



  • I bought a new computer yesterday. After all the hassle to unpack it and plug it in, finally a screen lit up.

    I took the communicator device and and spoke into the red light: "Computer, show me cat pictures".

    The white arrow moved a bit, but nothing else happened.

    I tried again: "Computer, show me porn"

    I even pressed one of the buttons on the other side of the communicator and spun the little wheel. Nothing.

    I threw the damn thing away and moved on. What a piece of garbage!


  • sockdevs

    Mr. Scott says hello.



  • In your example, all I did was yell at the computer. In the real world, I spent several hours looking for the correct way to define objects in node (went through 2 pages on Google before the results started repeating). The most amazing part? That I actually had to search for how to create objects (with methods and properties) in node, and that there were several different (and conflicting) ways to do it.

    Have you ever looked at the source code for some of these modules? The authors shouldn't be writing JS AT ALL, let alone for this newfangled engine.

    Nodejs is a joke. A hipster joke, if such a thing could exist.





  • Takes me all of five seconds to set it (node) up on vagrant with a shell command. You can even install it via powershell if you are so inclined.



  • Lovely. If I had heard of whatever vagrant is, or had never tried installing it via the CLI, that might be good to know. It isn't the fact that setup is easy or hard, it's the fact that it's a complete shitshow once you do manage to install it.



  • node.js:

    What jackass was writing shitty javascript for the browser one day and thought: I want to write all my code in this language!

    I swear to god, if a manager ever tells me we're going to start using node, I will so nod in agreement and then come to w.tdwtf to bitch my ass off about it.



  • @aapis said:

    I spent several hours looking for the correct way to define objects in node (went through 2 pages on Google before the results started repeating). The most amazing part? That I actually had to search for how to create objects (with methods and properties) in node, and that there were several different (and conflicting) ways to do it.

    Yup, that's javascript for you. If you only ever used jQuery spaghetti to manipulate the DOM, you need to go through one of the many great books on the subject and raise your skills to the level where you can write actual server code.

    And, once again, that's javascript, not node.js.


  • sockdevs

    Because callback hell is so much fun.



  • Can get dicey. Or you can switch over to promises.

    The problem is, closures are super cool to use, but the only way to use them leads to callback hell.



  • Well, node.js might not be such a bad idea, but every one of those new editors (Brackets, Atom, etc.) has terrible performance compared to existing editors. This is noticeable on older as well as the latest hardware.



  • @Arantor said:

    Node.js is generally a JS application server

    Node.js is a JavaScript interpreter. Like python, perl, ruby, JRE, mono,… And, mind you, the basic node.js installation is still an order of magnitude smaller than basic installation of JRE.

    @Arantor said:

    whose primary use is web serving.

    It has some extra support for event-driven programming. That is useful for web serving, but all GUI stuff is event-driven as well. Web serving might have been primary motivation for writing it, but there is no law prohibiting use of software for other purposes than it was originally intended for.



  • @cartman82 said:

    [Callback hell] Can get dicey. Or you can switch over to promises.
    Promises can get dicey too. Error handling, in general, makes a mess of otherwise nice code.

    Now add async to that and even the happy paths can get hairy, because they still require you to add at least one level of nesting. Promises help, but they don't completely eradicate the problem.



  • @aapis said:

    Install the framework, called sails

    I was going to say you were already a step ahead of me because I didn't manage to install sails a few days ago, but I just gave it another go so I could see what error I had. And it installed successfully. *shrugs*

    Creating and running a test project also worked. I got a boat on the console:

    info: 
    info: 
    info:    Sails              <|
    info:    v0.10.1             |\
    info:                       /|.\
    info:                      / || \
    info:                    ,'  |'  \
    info:                 .-'.-==|/_--'
    info:                 `--'-------' 
    info:    __---___--___---___--___---___--___
    info:  ____---___--___---___--___---___--___-__
    
    I didn't go further than that though, so I can't say if it's working 100%.

  • Discourse touched me in a no-no place

    It's the “fun and games” with scopes in JS that really grinds my gears. (To get the same level of annoyance in Java, you have to start playing games with the thread context classloader. If you don't know what that is, you are a Lucky Bastard.)



  • @dkf said:

    It's the “fun and games” with scopes in JS that really grinds my gears. (To get the same level of annoyance in Java, you have to start playing games with the thread context classloader. If you don't know what that is, you are a Lucky Bastard.)

    Scopes are easy for me, that java thing sounds dicey :smile:

    @Zecc said:

    I was going to say you were already a step ahead of me because I didn't manage to install sails a few days ago, but I just gave it another go so I could see what error I had. And it installed successfully. shrugs

    • Go to http://sailsjs.org/
    • Oooh nice, a video
    • Hmm, hipster mac trash, whatever
    • Lets see, he sets up demo app with sails demo, but the annotation says this has changed. Ok, not stable yet, fair enough
    • sails lift... Not start, but lift. Because these are sails, you see
    • Sails lifted at port 1337

      port 1337

    ...oh... I see...

    'nuff said about sails


  • :belt_onion:

    @dkf said:

    It's the “fun and games” with scopes in JS that really grinds my gears. (To get the same level of annoyance in Java, you have to start playing games with the thread context classloader. If you don't know what that is, you are a Lucky Bastard.)

    Sigh... I really have to continue the Asterisk saga/post.

    The things I have seen...



  • @cartman82 said:

    Oooh nice, a video

    Hah, I hadn't seen the video. Just watched the first few seconds. That intro... >_<

    And then the guys says he's going to try to keep the demo under 5 minutes, but the video is 14:44.



  • Oooh, wait! There's more, I paused the video too soon.

    He immediately goes off to demonstrate rails-like scaffolding functionality. "... except, sails(tm) scaffolds REST api instead of web pages, because that's the waay of the futureeee". Fine, makes sense.

    But then, he demonstrates creating records using his newly created API

    Yup, that's right. To create a DB record, you call a GET ( :heavy_exclamation_mark:) method and provide your data in the query string.

    ... because that's how REST api should work according to these jokers.



  • Oh boy! That video is just the gift that keeps on giving!

    Not 10 seconds later, he wants to demonstrate how update works by giving one of the users an email address.
    Of course, we are still using GET methods, what else is there?

    But then he mistypes and forgets to add email= in the query.
    "Hmm, I wonder what kind of error will this show......... oh"

    I guess our user now has "lisa@balderdash.co" attribute?


  • area_deu

    That is comedy gold right there.
    I'm already looking forward to watching that after work.

    Filed under: What's that giant squid their website mentions?



  • I guess our user now has "lisa@balderdash.co" attribute?

    Well the theory of nosql is the developer enforces the schema. Honestly, I'm terrified to go look at other projects using it now iwth that thought.



  • Fixed schema is like unit-testing for your data.
    You have one piece of code in your application and another in the DB. They both deal with the same entity. They both must agree on its structure. That gives you a great deal of security. If one of these is buggy, there's a good chance the other will scream bloody murder and give the opportunity to fix things before your data gets screwed.

    NoSQL removes that safety net entirely. Make one mistake in your code and there goes the data.

    I find schemeless NoSQL super-useful in auxiliary roles, but it can't replace the standard RDBMS when it comes to the main data store.



  • @cartman82 said:

    Yup, that's right. To create a DB record, you call a GET ( ) method and provide your data in the query string.

    For the record, if the REST API is being used with JSONP, you're limited to GET methods.

    He may have a good reason for using GET instead of POST, is all I'm saying. It seems just as likely that if you talked to him and said, "oh you used GET for JSONP compatibility?" he'd reply, "GET? What's that? And no I don't pee all over my JSON you sicko!"



  • I've never used Sails.js, but I wouldn't be surprised if that scaffolding URL he was using accepted GET and POST.
    And if so he was probably using it because its a lot easier to type out the url in the address bar than a curl command (Also it looks like he has a browser extension to pretty print the JSON?)

    And scaffolding is just that-- scaffolding. Its there to support you while you build an application, but it doesn't stay there until production.



  • @razerwolf said:

    I've never used Sails.js, but I wouldn't be surprised if that scaffolding URL he was using accepted GET and POST.And if so he was probably using it because its a lot easier to type out the url in the address bar than a curl command (Also it looks like he has a browser extension to pretty print the JSON?)

    Yeah, later he uses POST too.
    But even allowing GET is a huge WTF. Can't wait for bots to start crawling his site and randomly changing the database.

    @razerwolf said:

    And scaffolding is just that-- scaffolding. Its there to support you while you build an application, but it doesn't stay there until production.

    Scaffolding should quickly create the rote boilerplate code to help you get started. But it SHOULDN'T create dangerous WTF code you need to manually remove.

    Even greater problem is that this is NOT the best practice when designing API-s. Your url-s shouldn't have action verb in them; the verb should be provided within the HTTP headers.

    Knowing they use express.js, I presume they generate something like this:

    app.get("/users/update/:user", editUser);
    app.post("/users/update/:user", editUser);
    

    or maybe even

    app.any("/users/update/:user", editUser);
    

    (if they are completely insane)

    Putting aside the fact they needlessly add get method where it doesn't belong, why is update a part of this url? That's not a resource, that's an action. The correct design would be something like:

    app.post("/users/:user", editUser)
    

    or

    app.patch("/users/:user", editUser)
    

    This kind of hack might be OK when you're just slapping together some throwaway app. It's inexcusable in a framework.



  • @blakeyrat said:

    For the record, if the REST API is being used with JSONP, you're limited to GET methods.

    JSONP is used for fetching data.
    This guy creates a GET method that alters data.


  • Discourse touched me in a no-no place

    @cartman82 said:

    This guy creates a GET method that alters data.

    Attack of the legion of spiders! (Just put the URLs in a page somewhere discreet and wait for Google and Bing to find it.)


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.