Club PA 2.0 has arrived! If you'd like to access some extra PA content and help support the forums, check it out at patreon.com/ClubPA
The image size limit has been raised to 1mb! Anything larger than that should be linked to. This is a HARD limit, please do not abuse it.
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

[Programming] Thread: Fixed last bug in 5 month thread

19495969799

Posts

  • GnomeTankGnomeTank Registered User regular
    edited August 2015
    bowen wrote: »
    bowen wrote: »
    I've still yet to figure out just exactly what the point of each of these JS frameworks is supposed to fulfill.

    You've got handlebars, react, express, node.

    When should I use which? What are some examples!

    I see a lot of hello world with a print or something, but real world practical examples are kind of missing.

    Handlebars is a templating language that lets you generate HTML more easily. React is an end-to-end framework for making web apps. Express is a framework that sits on top of Node and lets you make webservers more easily. Node is a low-level way to run javascript natively and do network-y things.

    Of those, React is the only "framework" in the way it's most commonly used; the other big-name frameworks right now are Angular and Ember. There's things like backbone which is much smaller and just gives you a way to get events/data moving around, without any rendering.

    See http://stackoverflow.com/questions/5284340/what-is-node-js-connect-express-and-middleware for more about node/express; see many religious war pages for more about react/angular/ember.

    Why do people talk about using react and handlebars together? It's confusing as fuck.

    Because React is a logic framework, it's not a view layer. You can just use POHT (plain ol' HTML templates) for templates, or you can use a more full blown templating engine like Handlebars. Angular works much the same way. A lot of people just use HTML, but Jade is also very big in the Angular space.

    For most people, just using good ol' HTML is perfectly fine (it's what I do in most of my Angular and React work).

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • NogsNogs Crap, crap, mega crap. Registered User regular
    what.

    why would anyone use react and rip out JSX?

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • NogsNogs Crap, crap, mega crap. Registered User regular
    edited August 2015
    react is a view layer. thats the entire point of react.

    instead of putting weak psuedo logic into html (like handlebars, dust, mustache), you put html inside a powerful logic language i.e. javascript.

    using handlebars or some other templating thing inside react to attempt to "separate concerns" completely misses the point.

    Nogs on
    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • GnomeTankGnomeTank Registered User regular
    edited August 2015
    JSX is not a view layer. JSX is basically string interpolation on steroids. You can just as easily have Handlebars inside your JSX. It's been done, people do it, it's not hard.

    e: And the reason to do it is that for some people HTML is offensively terrible. It's over verbose and gross. I agree with those people, but not enough to actually use a template engine.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • NogsNogs Crap, crap, mega crap. Registered User regular
    but why

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • GnomeTankGnomeTank Registered User regular
    I edited with the why.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • NogsNogs Crap, crap, mega crap. Registered User regular
    i think we are gonna have to agree to disagree because i fundamentally dont think thats a good way to implement react.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    http://cpphints.com

    PVS-studio publishes some pretty godlike articles critiquing C++ codebases, and they are bite-sizing it!

  • djmitchelladjmitchella Registered User regular
    GnomeTank wrote: »
    Angular works much the same way. A lot of people just use HTML, but Jade is also very big in the Angular space.

    Jade's a preprocessor, right? How would you mix Jade in with <ng-repeat> and stuff and keep track of what's getting put in from where? (alternatively, when would you use ngIf -vs- Jade's "if"? the answers to this question seem to suggest that you'd just use Jade as an alternative to HTML, which then falls out as HTML and that HTML goes to Angular? (like writing your angular code in Coffeescript sort of thing).

  • InfidelInfidel Heretic Registered User regular
    React most definitely is a view/layout thing and you should use it for all of that, JSX and such.

    We are using Jade with ours for content only. So, like, our "About Us" page is rendering Jade content into the component, and you can do up your markup that way for all the "static" content. It's replacing the CMS for us right now. When I build a more dynamic database style CMS, it may continue to use Jade.

    So if you like Handlebars, you could have done the same as above, just swap it in instead of Jade.

    Not sure what other combinations would make sense though, you should be doing React for all your application goodness.

    OrokosPA.png
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    Is anybody else having an issue with the MSDN layout being garbage?
    As of about 2 weeks ago, all the content is using the center half of the screen on my widescreen monitor, with giant blank areas on the side.p11cgnmkz3tp.png
    Look at that eensy weensy scrollbar.
    It's the same in IE and Chrome.

    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    Seems like that's perfect, unless you have a 48" monitor.

    Ladies.
    urahonkyDisruptedCapitalist
  • InfidelInfidel Heretic Registered User regular
    That's because too long of lines in content is poor for readability, they're doing that intentionally.

    Zoom in with Ctrl +!

    OrokosPA.png
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
    bowenecco the dolphinEndDisruptedCapitalist
  • ecco the dolphinecco the dolphin Registered User regular
    Huh, so it is.

    Same here as well.

    Only just noticed, because I normally operate at around 175% zoom (because I've found that this reduces my eye strain problems). Had to go back to 100% to see the blanks.

    Penny Arcade Developers at PADev.net.
  • GnomeTankGnomeTank Registered User regular
    Nogs wrote: »
    i think we are gonna have to agree to disagree because i fundamentally dont think thats a good way to implement react.

    At a fundamental level it's no different than just using HTML. The syntax differs. You're not using Jade or Handlebars for the templating so much in this case as using it for syntax, which many people prefer over HTML. No different than writing your React's JavaScript code in Coffee or TypeScript (which is a touch harder because of the way JSX works, but people are doing it).

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • GnomeTankGnomeTank Registered User regular
    edited August 2015
    GnomeTank wrote: »
    Angular works much the same way. A lot of people just use HTML, but Jade is also very big in the Angular space.

    Jade's a preprocessor, right? How would you mix Jade in with <ng-repeat> and stuff and keep track of what's getting put in from where? (alternatively, when would you use ngIf -vs- Jade's "if"? the answers to this question seem to suggest that you'd just use Jade as an alternative to HTML, which then falls out as HTML and that HTML goes to Angular? (like writing your angular code in Coffeescript sort of thing).

    Yes, basically. The Jade becomes HTML which is then what actually builds the DOM for Angular. You're using it as a syntax replacement, not for all the logic-light templating. It's likely you'd never use Jade 'if', but always use ng-if, unless you had a very specific reason to have logic in the pre-process, which I would almost certainly want most developers to think very hard about. One reason might be that you need something in the view processed server side instead of client side, since Angular does not do progressive enhancement like React.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • NogsNogs Crap, crap, mega crap. Registered User regular
    that is crazy.

    you are all crazy.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • DehumanizedDehumanized Registered User regular
    every time i see the javascript framework holy wars

    i am glad i mostly develop desktop stuff

    iTunesIsEvilThe AnonymousDisruptedCapitalist
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    edited August 2015
    Infidel wrote: »
    That's because too long of lines in content is poor for readability, they're doing that intentionally.

    Zoom in with Ctrl +!
    Maybe to a point, but I'm pretty sure they overshot because at normal zoom level I get about 6 words per line and it makes it really fucking hard for me to read because I'm constantly jumping to a new line and having to scroll for ages to find anything.
    edit: actually zoom doesn't help. I don't want bigger text. I want more text.

    Tofystedeth on
    steam_sig.png
  • ecco the dolphinecco the dolphin Registered User regular
    Nogs wrote: »
    that is crazy.

    you are all crazy.

    I'M BROWSING THE PA FORUMS AT 175% ZOOM RIGHT NOW HAHAHAHAHAHAHAAH

    It's like everyone's got loud thoughts!

    Penny Arcade Developers at PADev.net.
  • AngelHedgieAngelHedgie Registered User regular
    So, I got to spend my evening last night on the 4 hour conference call from hell trying to get the app I work on running in our Disaster Recovery simulation environment.

    Then this morning was managed chaos as I had to do some last minute build corrections.

    At least management is appreciative.

    XBL: Nox Aeternum / PSN: NoxAeternum / NN:NoxAeternum / Steam: noxaeternum
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    I'm reading accounting textbooks on the side to try and catch up in domain knowledge. Given that I work building accounting software now...this is a good thing. Most of it is pretty dry stuff, but hey - I've learned more than a dozen ways people commit fraud in large corporations!

    Plus, I'm certain that accounting + programming is a skillset that will never lack for job opportunities.


    ecco the dolphinRendMahnmutTryCatchercrimsoncoyoteironsizideDisruptedCapitalistAngelHedgiejjae2123
  • ecco the dolphinecco the dolphin Registered User regular
    edited August 2015
    Oh gawd Javascript why do you let me use double and single quotation marks for strings?

    WHY ARE THERE TWO CHOICES FOR A FUNDAMENTAL DATA TYPE LIKE THIS??

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • DelmainDelmain Registered User regular
    Oh gawd Javascript why do you let me use double and single quotation marks for strings?

    WHY ARE THERE TWO CHOICES FOR A FUNDAMENTAL DATA TYPE LIKE THIS??

    yeah I hate that

    syndalis wrote: »
    Apple is a terrible company.
    iTunesIsEvil
  • DehumanizedDehumanized Registered User regular
    Much like Js looks at your types and says, "eh, all the same to me"

    ecco the dolphin
  • crimsoncoyotecrimsoncoyote Registered User regular
    Delmain wrote: »
    Oh gawd Javascript why do you let me use double and single quotation marks for strings?

    WHY ARE THERE TWO CHOICES FOR A FUNDAMENTAL DATA TYPE LIKE THIS??

    yeah I hate that
    Not sure about js, but in perl, double quotes interpolate, while single do not

  • NogsNogs Crap, crap, mega crap. Registered User regular
    Oh gawd Javascript why do you let me use double and single quotation marks for strings?

    WHY ARE THERE TWO CHOICES FOR A FUNDAMENTAL DATA TYPE LIKE THIS??

    single quotes almost always.




    unless it's json.

    then double quotes always.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • NogsNogs Crap, crap, mega crap. Registered User regular
    it gets really fucky when you need to do something like
    var guyVar = "guy";
    var concatString = "some " + guyVar + " said \"Hello!\"";
    

    which is why single quote can be easier:
    var guyVar = "guy";
    var concatString = 'some ' + guyVar + ' said "Hello!"';
    

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
    crimsoncoyote
  • EndEnd Registered User regular
    edited August 2015
    I think I prefer double quote for longer strings, but I'm not really sure. I'm not terribly consistent about it, unfortunately.

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpgsteam~tinythumb.png
  • DelmainDelmain Registered User regular
    edited August 2015
    Delmain wrote: »
    Oh gawd Javascript why do you let me use double and single quotation marks for strings?

    WHY ARE THERE TWO CHOICES FOR A FUNDAMENTAL DATA TYPE LIKE THIS??

    yeah I hate that
    Not sure about js, but in perl, double quotes interpolate, while single do not

    Yeah, that one makes sense. It's like {at}"" in C#, but no, in JS you can just freely interchange '' and ""

    E: I mean, in the same code. A single string has to be either 'something' or "something else", not 'a third thing"

    Delmain on
    syndalis wrote: »
    Apple is a terrible company.
  • DehumanizedDehumanized Registered User regular
    edited August 2015
    nm

    Dehumanized on
  • ecco the dolphinecco the dolphin Registered User regular
    I'll take some small consolation that at least it's simpler than bash scripting's: "This is `echo 'an example to show a dollar ($) sign' `"

    Penny Arcade Developers at PADev.net.
    Delmaincrimsoncoyotea5ehren
  • SaerisSaeris Chronogestaltist Trinity, New MexicoRegistered User regular
    Nogs wrote: »
    that is crazy.

    you are all crazy.

    I think they're talking about using Handlebars to render mostly-static, non-interactive HTML, maybe with some formatting helpers and loops but without any conditional blocks.

    At least, that's the only explanation that makes any sense at all to me. Rendering with Handlebars and then trying to bind event handlers after the fact... I don't know, it sounds messy. All you get back from Handlebars is an HTML string. Would you... create a DocumentFragment, plop the HTML in there, and then bind the event handlers? Yuck.

    Nlgya.png
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    bash strings are not understood by modern science

  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    Oh gawd Javascript why do you let me use double and single quotation marks for strings?

    WHY ARE THERE TWO CHOICES FOR A FUNDAMENTAL DATA TYPE LIKE THIS??

    'Because then I can do "this" without going crazy with what the kids call "backslashes"'

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
    Getha5ehren
  • Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    edited August 2015
    Infidel wrote: »
    That's because too long of lines in content is poor for readability, they're doing that intentionally.

    Zoom in with Ctrl +!

    Eh, only if you are not used to it. I think using huge margins like that is a far too common web design crutch. If you were really worried about readability you could use columns or dynamic font sizes or something.

    Although compared to the horrible things microsoft has been doing with UI's the past several years it is relatively benign. I played around with Win10 a bit. They are completely obsessed with right angles. And hiding the edges of UI elements so you have to guess where they are or hover over them.

    Monkey Ball Warrior on
    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • Jimmy KingJimmy King Registered User regular
    wheee. Demo of our latest website today internally. Not at all a complete product yet, just a "here's what it currently is". Hopefully I'm finding all of the "this works in dev, why the fuck is it broken on the staging site?" shit right now so that I can fix them or explain why it's reasonable for the issue at this point. Definitely found a few things.

    ecco the dolphin
  • bowenbowen How you doin'? Registered User regular
    Infidel wrote: »
    That's because too long of lines in content is poor for readability, they're doing that intentionally.

    Zoom in with Ctrl +!

    Eh, only if you are not used to it. I think using huge margins like that is a far too common web design crutch. If you were really worried about readability you could use columns or dynamic font sizes or something.

    Although compared to the horrible things microsoft has been doing with UI's the past several years it is relatively benign. I played around with Win10 a bit. They are completely obsessed with right angles. And hiding the edges of UI elements so you have to guess where they are or hover over them.

    There's not enough text to fill it.

    Dynamic font sizes would be crazy. The point of high resolution monitors isn't "HOW BIG CAN I MAKE MY ONE PROGRAM?!" it's "Yay now I can have more programs open at once at their native resolution!"

    There's never really a good answer to this, it's almost certainly "change your browser for your monitor and zoom/unzoom" and has been that way since the late 90s when people started having wildly different monitor sizes.

    Ladies.
  • crimsoncoyotecrimsoncoyote Registered User regular
    Woo, hackathon has begun!

    DelmainInfidelurahonkyecco the dolphin
  • EchoEcho Moderator mod
    Dear person who makes registration codes that are hexadecimal strings and make them case-sensitive:

    cut%20yourself.jpg

    Echo wrote: »
    Let they who have not posted about their balls in the wrong thread cast the first stone.
    DelmainbowenEtheaLD50DisruptedCapitalistmightyjongyocrimsoncoyotedjmitchellaecco the dolphinironsizideAngelHedgie
This discussion has been closed.