As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

[Programming] Mirror, mirror, on the wall, show the git diff for them all

24567100

Posts

  • Options
    TofystedethTofystedeth Registered User regular
    for i in range(1,11):print("{0}  {1}".format(i,10-(i-1)))
    

    steam_sig.png
  • Options
    DehumanizedDehumanized Registered User regular
    whitespace can't save you from that loop

    nothing can

  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    For you React folks, this looks pretty nifty - live editing of code in the browser which then gets re-run, while preserving state. (in the real world, it's when you save files, but still pretty handy).

    video here. It's not quite the same as the existing livereload you get with grunt/ember-cli/etc, this one preserves the state of your app and changes the code under it, rather than just automatically hitting "refresh".

    ya man, its pretty sweet. been using it for about a month now.

    one thing that is weird with it though, is when you pair it with flux or something. its a little hard to know/handle state stuff. hard to explain, but its hard to know what your state truly is at any given time with hot-loader.

    but it is super slick for working with css and messing around with markup in the render() method.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    EndEnd Registered User regular
    edited August 2015
    bowen wrote: »
    Rend wrote: »
    bowen wrote: »
    Sometimes I do stuff like this:
    for(int i = 0, j = 11; i < 10 && j >0; printf("%d  ",++i), printf("%d\r\n",--j));
    

    This is the strongest argument for controlled whitespace that I have seen to date.

    I bet there's still a legal move in python that does something like that.

    outside of using eval, not really something "like that" that I know of

    you can use semicolons to contain multiple statements on a line, but it's limited to "simple statements", which excludes block defining statements (if/while/etc), specifically they can't come after the semicolon

    with that specific example you could zip on range or just unroll the damn loop, but I don't think that's really the intent here, is it

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    EndEnd Registered User regular
    not that there isn't other ways to make garbage looking python code, though

    indentation is just one place where it tries to save you from yourself

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    SyphyreSyphyre A Dangerous Pastime Registered User regular
    Look, we have scrolling editors for a reason. People who jam 4 lines of code into one line drive me nuts. Clarity people. Clarity.

    On the other hand, vertical space is valuable as well. People who only put one bracket on a line deserve to eat horrible things from the fridge for a month. I'm looking at you default C# settings in VS.

    As much as I enjoy C#, god the naming and coding conventions are horrible.

  • Options
    RendRend Registered User regular
    edited August 2015
    Syphyre wrote: »
    Look, we have scrolling editors for a reason. People who jam 4 lines of code into one line drive me nuts. Clarity people. Clarity.

    On the other hand, vertical space is valuable as well. People who only put one bracket on a line deserve to eat horrible things from the fridge for a month. I'm looking at you default C# settings in VS.

    As much as I enjoy C#, god the naming and coding conventions are horrible.

    I actually prefer the bracket on the next line (though I usually don't use it since it defies convention for most of the code base I write in). I feel like most people use blank lines as "paragraphs" in code, right? Having a bracket on the next line is just the same as starting your functions and classes with a paragraph.

    Rend on
  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    #1
    x = {
         "some": thing
    }
    

    or

    #2
    x =
    {
         "some": thing
    }
    
    the answer is #1.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    RendRend Registered User regular
    Nogs wrote: »
    #1
    x = {
         "some": thing
    }
    

    or

    #2
    x =
    {
         "some": thing
    }
    
    the answer is #1.

    In fairness, usually in C# the "x=" line is significantly longer :p

  • Options
    RendRend Registered User regular
    public Boolean canBeProcessed(Foo toBeProcessed) {
      if(toBeProcesssed != null && toBeProcessed.field != SOME_CONSTANT){
        //Start verifying with the Bar object about some crap
        ...
        ...
    
    public Boolean canBeProcessed(Foo toBeProcessed) 
    {
      if(toBeProcesssed != null && toBeProcessed.field != SOME_CONSTANT)
      {
        //Start verifying with the Bar object about some crap
        ...
        ...
    

  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    still prefer #1

    by a lot

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    DelmainDelmain Registered User regular
    edited August 2015
    brackets on new lines unless it's a one-liner a la
    var thing = new Thing { Prop = p, Name = n };
    

    Delmain on
  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    again

    you are all crazy

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    DelmainDelmain Registered User regular
    you're welcome to have your own opinion

    no matter how wrong it is

  • Options
    hippofanthippofant ティンク Registered User regular
    edited August 2015
    Delmain wrote: »
    you're welcome to have your own opinion {

    no matter how wrong it is
    }

    hippofant on
  • Options
    LD50LD50 Registered User regular
    I like #1. I like tabs instead of spaces too, because all you fucks have editors where you can change the tab width. Any other holy wars we should revive while we still have the new thread smell?

  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    i like you LD50

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    RendRend Registered User regular
    Nogs wrote: »
    again

    you are all crazy

    I just prefer vertical whitespace separating blocks of code is all.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Takes gulp 15 seconds to compile everything but if you are missing a parenthesis ANYWHERE the shit breaks in an instant.

  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    edited August 2015
    urahonky wrote: »
    Takes gulp 15 seconds to compile everything but if you are missing a parenthesis ANYWHERE the shit breaks in an instant.

    eslint booooi

    http://eslint.org/

    Nogs on
    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Nogs wrote: »
    urahonky wrote: »
    Takes gulp 15 seconds to compile everything but if you are missing a parenthesis ANYWHERE the shit breaks in an instant.

    eslint booooi

    http://eslint.org/

    God the changes I'm going to make to this project when I get some breathing space...

    I'm at 65 hours this week so far...

  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    urahonky wrote: »
    Nogs wrote: »
    urahonky wrote: »
    Takes gulp 15 seconds to compile everything but if you are missing a parenthesis ANYWHERE the shit breaks in an instant.

    eslint booooi

    http://eslint.org/

    God the changes I'm going to make to this project when I get some breathing space...

    I'm at 65 hours this week so far...

    :(

    I know it means nothing, but if the project was open source i would totally be helping you right now

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    TraceTrace GNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam We Registered User regular
    Nogs wrote: »
    urahonky wrote: »
    Nogs wrote: »
    urahonky wrote: »
    Takes gulp 15 seconds to compile everything but if you are missing a parenthesis ANYWHERE the shit breaks in an instant.

    eslint booooi

    http://eslint.org/

    God the changes I'm going to make to this project when I get some breathing space...

    I'm at 65 hours this week so far...

    :(

    I know it means nothing, but if the project was open source i would totally be helping you right now

    hey I've got an open sourced project you can get involved with.

    *winkhelpmecreateskynetwink*

  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    edited August 2015
    if you are talking about machine learning, i am down.

    i am actually in the talks with my old uni professor to do some stuff for using neural networks to analyze fragments of original papyrus texts.

    i have no idea how to do ANY of it yet, but I'm not really too worried. learning is just time, and I got plenty right now.

    Nogs on
    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    hmmm

    not sure how I feel about that, Geth.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    TraceTrace GNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam We Registered User regular
  • Options
    UselesswarriorUselesswarrior Registered User regular
    urahonky wrote: »
    Nogs wrote: »
    urahonky wrote: »
    Takes gulp 15 seconds to compile everything but if you are missing a parenthesis ANYWHERE the shit breaks in an instant.

    eslint booooi

    http://eslint.org/

    God the changes I'm going to make to this project when I get some breathing space...

    I'm at 65 hours this week so far...

    That's rough. I've slogged through projects like that were every step of the way you are like "this is terrible, this sucks". You'll plan to revisit but most likely never get the time to do so because the next 65 hour week of hack job shit will eat into refactoring time.

    #startuplife

    Hey I made a game, check it out @ http://ifallingrobot.com/. (Or don't, your call)
  • Options
    TraceTrace GNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam We Registered User regular
    getTabs().add(new LazyTabX("Space", () -> new WebMap()) /*"Space", "Navigate a 2D map to input (map region-as-shape analysis, and lists of features and their locations)")*/);
    +
    +        getTabs().add(new Tab("Narsese", new NarseseInput(n)));
    +        getTabs().add(new ComingSoonTab("Library", "Apps, APIs, Interfaces, and Examples (ex: from .NAL files) that can be input"));
    +
    +        getTabs().add(new ComingSoonTab("Natural", "Natural language input in any of the major languages, using optional strategies (ex: CoreNLP)"));
    +        {
    +            /*getTabs().add(new Tab("En"));
    +            getTabs().add(new Tab("Es"));
    +            getTabs().add(new Tab("Fr"));
    +            getTabs().add(new Tab("De"));*/
    +        }
    +        getTabs().add(new ComingSoonTab("Sensors", "List of live signals and data sources which can be enabled, disabled, and reprioritized"));
    +        getTabs().add(new ComingSoonTab("Data", "Spreadsheet view for entering tabular data"));
    +        getTabs().add(new ComingSoonTab("Draw", "Drawing/composing an image that can be input"));
    +        getTabs().add(new ComingSoonTab("Webcam", "Webcam/video stream record; audio optional"));
    +        getTabs().add(new ComingSoonTab("Audio", "Microphone/audio stream record, w/ freq and noise analyzers, and optional speech recognition via multiple strategies"));
    +
    +
    +        getTabs().add(new ComingSoonTab("Time", "Navigate a timeline to view and edit significants in any time region"));
    +        getTabs().add(new ComingSoonTab("Patterns", "Frequently-used inputs and templates selectable via speed-dial button grid"));
    +        getTabs().add(new ComingSoonTab("URL", "Bookmarks that will create a new browser tab for web pages. Also includes URL navigation textfield"));
    +
    +    }
    

    coming soon...

  • Options
    Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    Spaces over tabs because we want to be able to precisely line up multi-line statements.

    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.
  • Options
    DelmainDelmain Registered User regular
    Spaces over tabs because we want to be able to precisely line up multi-line statements.

    Nah, that is accomplished with tabs and spaces. You tab to the beginning of the line and then space over however much you need.

  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    tabs or die

  • Options
    crimsoncoyotecrimsoncoyote Registered User regular
    So apparently we won "most fun" at the hackathon. I'm OK with that

  • Options
    djmitchelladjmitchella Registered User regular
    One of the guys on the project-with-lots-of-warnings has removed ~96% of them by disabling the warning that boost headers generate for the parts of the compile where we're including boost, and turning them back on again afterwards:

    and after a few other bits of real fixing, and disabling the "deprecated register keyword" warning for some elderly third party libraries, we're now down to 250 warnings (which are pretty much all "Apple isn't going to support that API much longer, watch out", and yes, yes, we know, there is a nontrivial amount of schedule overhead for every new OSX/windows release for that sort of thing). Build logs are now down to just under 4 meg, down from 270mb.

  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Current dev environment has a bug that makes a build take roughly 5 minutes. Fixing bugs one line change at a time. So boring...

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    a5ehrena5ehren AtlantaRegistered User regular
    edited August 2015
    Hahahaha a 5 minute build being slow. Our no-op build is about 15 minutes on a fast machine, clean builds (for just the company codebase) are almost an hour.

    A full build with all dependencies being redone would be most of a day, I think, since it is building a full Linux-based OS. I've done it a few times since I'm basically the distro maintainer, but I just run it overnight when needed.

    a5ehren on
  • Options
    EtheaEthea Registered User regular
    Our no-op is < 1min, incremental is ~1-5min, full build no dependencies 30min, full build plus deps 1.5 hour. Running the full test suite adds 40-60minutes ontop of that.

  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    What's a no-op build?

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    a5ehrena5ehren AtlantaRegistered User regular
    No code changes, just the time it takes the build system to check everything and repackage it.

  • Options
    RendRend Registered User regular
    gavindel wrote: »
    What's a no-op build?

    7lbnmayac02j.png

  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    A no op build is a teenage boy screaming obscenities at me for not capping bomb when I have been dead since round start, Rend?

    I always thought programming was more like that game of Civ where you load up someone else's game at 1000 AD to find out Attila is on your left, Ghandi is on your right, and you have no strategic resources but horses.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
This discussion has been closed.