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/

My Little [Programming] Thread: Debugging is Magic

12357100

Posts

  • RendRend Registered User regular
    Just as a note for anyone: If your coordinate system is set in landscape, ensure the destination for the data is ALSO in landscape.

    Carry on.

  • urahonkyurahonky Registered User regular
    Alright my last choice in this matter is to delete the server from pdadmin and recreate it... But I really, really, REALLY don't want to do that because I have no idea what I'm doing and removing a server from there seems like a very poor choice.

  • MahnmutMahnmut Registered User regular
    edited March 2014
    I'm learning PHP to do some so-called web-development for my so-called job at a non-profit (sure to go well!). So far I'm a little bit horrified by the prospect of dynamic typing. Like, it's fine, I'm aware that this is sometimes a thing, and maybe it's even sometimes nifty, but aaaaaaaaaaaaaaaaaaa

    Mahnmut on
    Steam/LoL: Jericho89
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    I feel like whichever form of typing you learn first is how your brain works forever. I started with dynamic languages and am always mystified when people describe them as scary or dangerous.

  • RendRend Registered User regular
    admanb wrote: »
    I feel like whichever form of typing you learn first is how your brain works forever. I started with dynamic languages and am always mystified when people describe them as scary or dangerous.

    Well you may be good at it, but it still requires objectively more mental mapping. That's what's scary and dangerous about them, and that's not really a statement of opinion so much as it is an assessment of the situation. As a person who learned on it, you're just perhaps more equipped to mitigate the disadvantages in order to exploit the advantages of the system, but the disadvantage of "scary and dangerous" is still there :p

  • iTunesIsEviliTunesIsEvil Cornfield? Cornfield.Registered User regular
    edited March 2014
    Dynamic typing doesn't bug me too much until php-esque things start happening. Constructors/initializers returning a handle to a valid object, or wait maybe a null value, or wait maybe a boolean (always false though!) is freaking stoopid and I will continue to harp on this example because it still makes my head hurt.

    I do enjoy my static-typing though. I feel like it results in a little more clarity, but I know that's just a personal opinion. :P

    iTunesIsEvil on
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited March 2014
    admanb wrote: »
    I feel like whichever form of typing you learn first is how your brain works forever. I started with dynamic languages and am always mystified when people describe them as scary or dangerous.

    Not really true everyone. I learned static typing first, but eventually was able to wrap my mind around dynamic typing and really flow with it. I was then able to take a lot of the lessons from dynamically typed environments and apply them back to statically typed ones (care less about identity, more about functionality being the primary one).

    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
  • EchoEcho ski-bap ba-dapModerator mod
    whyyyyy does PHP not have a sane string literal for arrays

    screw you "Array to string conversion error"! Makes it so damn annoying to debug by printing an array.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Wrote my first AngularJS app this weekend. It's nifty, if a bit overwrought. I can see it's use for writing web applications with rich client side features, but I would frown on a regular website being written this way. Browsers are not fast or efficient tools. Moving your entire sites logic to the client side is dubious at best in a non rich interaction environment.

    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
  • EtheaEthea Registered User regular
    programming to an interface(s) instead of a type is my favorite part of dynamic languages. Somebody please point me to a dynamic language with good way to state interface requirements and I will most likely have a new favorite language.
    def foo(n) <n : { [ ], len } > : 
      #function foo needs n to handle len calls, and slice/operator access
      sum = reduce(lambda x, y: x+y, n)
    return (len(n) / sum)
    

  • bowenbowen How you doin'? Registered User regular
    Echo wrote: »
    whyyyyy does PHP not have a sane string literal for arrays

    screw you "Array to string conversion error"! Makes it so damn annoying to debug by printing an array.

    You should use hack!

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • CoolTrainerCoolTrainer Registered User regular
    edited March 2014
    Alright, so this is going to be a really open ended question, but:

    What would be a really good programming language to make budgeting software in?

    Background: I've had this idea floating around in my head about budgeting software for a couple of years now. I've finally decided to try to do something about it. I've got a LITTLE background in Visual Basic, but that's pretty much the extent of my programming experience.

    I would want this to be a desktop application in the beginning, but the dream would be to eventually have it as a smart phone app as well. Are there any languages that scale well both ways?

    Don't take this as me being naive about the whole thing. I know I can't just walk into it and expect to have something thrown together over night. Heck, it would probably take years to put together what I have in mind. I just figured this would be a good place to start, to at least get some direction.

    CoolTrainer on
    League of Legends ID: Cloogr

    3DS / Pokemon XY: 0774-5590-9276
  • DelmainDelmain Registered User regular
    Java? You could build the framework and then build both a desktop app and an Android app on top of it. Of course, if you want them to be cross compatible, you'd have to build some sort of server architecture in which case you'd have three components (desktop app/mobile app/server [which to be fair, could be website/server]) and each component could be written in different languages as long as they all communicate in something standard like sockets or rest.

  • oldmankenoldmanken Registered User regular
    edited March 2014
    COBOL?

    oldmanken on
  • KambingKambing Registered User regular
    Ethea wrote: »
    programming to an interface(s) instead of a type is my favorite part of dynamic languages. Somebody please point me to a dynamic language with good way to state interface requirements and I will most likely have a new favorite language.
    def foo(n) <n : { [ ], len } > : 
      #function foo needs n to handle len calls, and slice/operator access
      sum = reduce(lambda x, y: x+y, n)
    return (len(n) / sum)
    

    That's the thing. Types are the interface. More so when they're sufficiently rich.

    When most people think of static typing, they think of Java and C-like languages where the annotation burden is large compared to the amount of expressiveness that the types give you.

    As far as dynamic languages go, Racket's contract system with some encoding is sufficient to cover structurally checks that you are getting at with the example. Something more exotic are languages like Pyret whose gradual typing schemes allow you to express structure when necessary.

    (C++'s concept system was essentially what you described if you take templates as a dynamic programming language. Unfortunately that's been shelved for post C++14...)

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • CoolTrainerCoolTrainer Registered User regular
    edited March 2014
    Delmain wrote: »
    Java? You could build the framework and then build both a desktop app and an Android app on top of it. Of course, if you want them to be cross compatible, you'd have to build some sort of server architecture in which case you'd have three components (desktop app/mobile app/server [which to be fair, could be website/server]) and each component could be written in different languages as long as they all communicate in something standard like sockets or rest.

    Awesome, thanks for the suggestion. I figured JAVA might be something people said, so I'll definitely look into it.

    Any good compilers/work environments for JAVA that I should look into? Free preferably, since this is all pretty much a pipe dream at this point.

    oldmanken wrote: »
    COBOL?

    You so funny.

    CoolTrainer on
    League of Legends ID: Cloogr

    3DS / Pokemon XY: 0774-5590-9276
  • oldmankenoldmanken Registered User regular
    Now that JAVA has been mentioned, should we all split into our respective camps and prepare for the ensuing page long JAVA hate/love fest?

  • KambingKambing Registered User regular
    Delmain wrote: »
    Java? You could build the framework and then build both a desktop app and an Android app on top of it. Of course, if you want them to be cross compatible, you'd have to build some sort of server architecture in which case you'd have three components (desktop app/mobile app/server [which to be fair, could be website/server]) and each component could be written in different languages as long as they all communicate in something standard like sockets or rest.

    Awesome, thanks for the suggestion. I figured JAVA might be something people said, so I'll definitely look into it.

    Any good compilers/work environments for JAVA that I should look into? Free preferably, since this is all pretty much a pipe dream at this point.

    oldmanken wrote: »
    COBOL?

    You so funny.

    I highly recommend you stick with a simpler language like Python for this project. What you scoped is pretty large; merely getting a desktop version of what you want will take substantial effort. You'll likely be more productive and enjoy what you're doing more if you stuck with Python to build a first version to hone your skills and prototype what you want. After that, consider moving to another language if your requirements take you elsewhere, e.g., to Java if you want an Android version of your app.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • SpawnbrokerSpawnbroker Registered User regular
    Holy crap, that took less than a minute!

    Steam: Spawnbroker
  • CoolTrainerCoolTrainer Registered User regular
    Holy crap, that took less than a minute!

    I would say that I hope I haven't started something....but I actually kinda hope I have. Just for the fact that it's really hard for me to know the positives and negatives of all these different languages, so it's nice to see what people who have actually used them think.

    Time to make some popcorn and watch the show.

    League of Legends ID: Cloogr

    3DS / Pokemon XY: 0774-5590-9276
  • urahonkyurahonky Registered User regular
    So this whole http/https problem I was having...

    Apparently the server I've been trying to connect to has been having issues with WebSEAL and they gave me a different server to try and it worked.

    Seriously. A whole week could have been saved. On the plus side I'm much more comfortable using command-line stuff so it's not THAT much of a wash but oh man I'm upset for not knowing that.

  • EtheaEthea Registered User regular
    Kambing wrote: »
    Ethea wrote: »
    programming to an interface(s) instead of a type is my favorite part of dynamic languages. Somebody please point me to a dynamic language with good way to state interface requirements and I will most likely have a new favorite language.
    def foo(n) <n : { [ ], len } > : 
      #function foo needs n to handle len calls, and slice/operator access
      sum = reduce(lambda x, y: x+y, n)
    return (len(n) / sum)
    

    That's the thing. Types are the interface. More so when they're sufficiently rich.
    In a perfect world types are the interface. Maybe I am being unclear, but with 'Object' Oriented programming it seems that the user types are so bad.
    But since I am a C-language person I am generally assaulted with code that looks like:
    double foo( ObjectFooType* foo ): 
     SuperDerivedType* sdt = dynamic_cast<SuperDerivedType*>(foo)
     if(sdt) 
      {
      return sdt.length() / sdt.actualSum();
      }
      return ( foo.length() / foo.sum() )
    

  • KambingKambing Registered User regular
    Ethea wrote: »
    Kambing wrote: »
    Ethea wrote: »
    programming to an interface(s) instead of a type is my favorite part of dynamic languages. Somebody please point me to a dynamic language with good way to state interface requirements and I will most likely have a new favorite language.
    def foo(n) <n : { [ ], len } > : 
      #function foo needs n to handle len calls, and slice/operator access
      sum = reduce(lambda x, y: x+y, n)
    return (len(n) / sum)
    

    That's the thing. Types are the interface. More so when they're sufficiently rich.
    In a perfect world types are the interface. Maybe I am being unclear, but with 'Object' Oriented programming it seems that the user types are so bad.
    But since I am a C-language person I am generally assaulted with code that looks like:
    double foo( ObjectFooType* foo ): 
     SuperDerivedType* sdt = dynamic_cast<SuperDerivedType*>(foo)
     if(sdt) 
      {
      return sdt.length() / sdt.actualSum();
      }
      return ( foo.length() / foo.sum() )
    

    Yup, they are. And in particular, with languages like Java, the type system is weak and brittle so that it is the norm to break it with operations like dynamic_cast. In contrast with a more rigorous language like Haskell:
    class ObjectFoo a  where
      olength :: a -> Int
      osum :: a -> Int
    
    instance ObjectFoo SuperDerivedType where
      olength f = -- impl goes here
      osum f = -- impl goes here
    
    foo :: (ObjectFoo a) => a -> Double
    foo x = olength a / olength a
    

    the type system is sufficient to express the sorts of constraints that you want and actively dissuades you from trying to break it.

    Such type systems and discipline are not unique to functional programming. For example, you can obtain the same effect with Scala traits and implicit conversions.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • RendRend Registered User regular
    edited March 2014
    Been the sole developer working on infrastructure for some new tech for about three weeks now, demo'd my progress to my project lead today.

    I believe his words were "that's exactly what I wanted."

    Not only that, but evidently I have about 3x as much time as I thought I did to get everything finished and polished.
    DT-feels-good-to-be-a-gangster.jpg

    Rend on
  • LD50LD50 Registered User regular
    I learned programming in C, and then OOP in Java, and then I promptly moved onto Ruby and saw the light. I can easily and happily use static or dynamic typing. I just think that in OO languages there's far to many types for static typing to handle in a sane way, and in java they're all named something like MyOtherAkwardlyNamedObject.

  • SmasherSmasher Starting to get dizzy Registered User regular
    admanb wrote: »
    I feel like whichever form of typing you learn first is how your brain works forever. I started with dynamic languages and am always mystified when people describe them as scary or dangerous.
    On a similar note, I wonder if the fact that TI-Basic was my first programming language is the reason I don't mind the problems various other languages have very much. It's hard to lose to a language where, among other things, evaluating an if statement takes a perceivable amount of time and micro-optimizations are not only worthwhile but practically mandatory.

  • AnteCantelopeAnteCantelope Registered User regular
    My problem with dynamic typing is that it puts the burden of specifying the API on comments. With static typing, I know that void foo(Bar baz) takes either a Bar object or a subclass, or something that implements the Bar interface. With dynamic typing, void foo(baz) doesn't tell me exactly what I need, and if the comments aren't accurate or helpful, I'm in trouble, and need to start digging through the source code to try to guess what sort of object it needs.

  • undergroundmonorailundergroundmonorail single-track subway Registered User regular
    My problem with dynamic typing is that it puts the burden of specifying the API on comments. With static typing, I know that void foo(Bar baz) takes either a Bar object or a subclass, or something that implements the Bar interface. With dynamic typing, void foo(baz) doesn't tell me exactly what I need, and if the comments aren't accurate or helpful, I'm in trouble, and need to start digging through the source code to try to guess what sort of object it needs.

    In theory, anything that makes sense should be able to go in there. In theory, a function expecting an int shouldn't choke on 2.0, for example.

    In theory. It rarely works out that way.

    Pokémon X | 3DS Friend Code: 0490-4897-7688
    Friend Safari: Fighting - Machoke, Pancham, Riolu | In game name: Jessica
    Official Weather Gym Leader of the G+T Pokémon League. @me to try for the Climate Badge!
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    My problem with dynamic typing is that it puts the burden of specifying the API on comments. With static typing, I know that void foo(Bar baz) takes either a Bar object or a subclass, or something that implements the Bar interface. With dynamic typing, void foo(baz) doesn't tell me exactly what I need, and if the comments aren't accurate or helpful, I'm in trouble, and need to start digging through the source code to try to guess what sort of object it needs.

    In theory, anything that makes sense should be able to go in there. In theory, a function expecting an int shouldn't choke on 2.0, for example.

    In theory. It rarely works out that way.

    The problem is when you don't have 2, you have 2.00001. Is it still valid? Maybe!

  • KambingKambing Registered User regular
    Phyphor wrote: »
    My problem with dynamic typing is that it puts the burden of specifying the API on comments. With static typing, I know that void foo(Bar baz) takes either a Bar object or a subclass, or something that implements the Bar interface. With dynamic typing, void foo(baz) doesn't tell me exactly what I need, and if the comments aren't accurate or helpful, I'm in trouble, and need to start digging through the source code to try to guess what sort of object it needs.

    In theory, anything that makes sense should be able to go in there. In theory, a function expecting an int shouldn't choke on 2.0, for example.

    In theory. It rarely works out that way.

    The problem is when you don't have 2, you have 2.00001. Is it still valid? Maybe!

    The worst examples I have of working with dynamically typed languages in recent memory are working with various parser generators in Javascript and Python. If I parse a list of things, what do I get back? A list of parsed objects? A record that contains a list of parsed objects? If the list is empty, what do I get back? An empty list or record? A null reference?

    I've spent an unnecessary amount of time trying to understand what the generator APIs were giving back to me, something that is (nearly) completely obviated in a statically-typed language. More generally, working with reasonably complicated libraries in dynamically-typed languages that don't thoroughly document their interfaces (to the point of giving quasi-type signatures of some form or another) have always caused me more grief than they should.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • MahnmutMahnmut Registered User regular
    edited March 2014
    Kambing wrote: »
    Phyphor wrote: »
    My problem with dynamic typing is that it puts the burden of specifying the API on comments. With static typing, I know that void foo(Bar baz) takes either a Bar object or a subclass, or something that implements the Bar interface. With dynamic typing, void foo(baz) doesn't tell me exactly what I need, and if the comments aren't accurate or helpful, I'm in trouble, and need to start digging through the source code to try to guess what sort of object it needs.

    In theory, anything that makes sense should be able to go in there. In theory, a function expecting an int shouldn't choke on 2.0, for example.

    In theory. It rarely works out that way.

    The problem is when you don't have 2, you have 2.00001. Is it still valid? Maybe!

    The worst examples I have of working with dynamically typed languages in recent memory are working with various parser generators in Javascript and Python. If I parse a list of things, what do I get back? A list of parsed objects? A record that contains a list of parsed objects? If the list is empty, what do I get back? An empty list or record? A null reference?

    I've spent an unnecessary amount of time trying to understand what the generator APIs were giving back to me, something that is (nearly) completely obviated in a statically-typed language. More generally, working with reasonably complicated libraries in dynamically-typed languages that don't thoroughly document their interfaces (to the point of giving quasi-type signatures of some form or another) have always caused me more grief than they should.

    This is basically what started me twitching today. A function that returns either an int, or false? Not meaningfully harder to use than one of those string-searching functions that might return -1 instead of an int index if the character you're looking for isn't found. But what if sometimes it returns Cat?

    Mahnmut on
    Steam/LoL: Jericho89
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    the biggest problem I had with dynamic languages was having to remember a substantially larger quantity of information about my codebase than with a competing static langauge

    this was especially problematic with Javascript, where I have handwritten fairly substantial pieces of production code by hand in raw JS (unaided by libs, etc), and then have to edit it 3 months later only to discover I have to relearn a lot of things like what this was returning and what that was expecting as argument

  • LD50LD50 Registered User regular
    Jasconius wrote: »
    the biggest problem I had with dynamic languages was having to remember a substantially larger quantity of information about my codebase than with a competing static langauge

    this was especially problematic with Javascript, where I have handwritten fairly substantial pieces of production code by hand in raw JS (unaided by libs, etc), and then have to edit it 3 months later only to discover I have to relearn a lot of things like what this was returning and what that was expecting as argument

    I think this is why many of the better dynamic languages have good tools for generating documentation.

  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    i very much prefer it to have my code be self-documenting

    I am a commenter. but fuck specially formatted blocks that must be in a given location in order to be picked up by some docgen.... i got bills to pay

  • CarpyCarpy Registered User regular
    This is probably a dumb c++ question but here it goes. I have a class Foo which has a member object Bar. Bar's constructor takes a string.
    Can I do something like:
    Foo.cpp
    Foo:Foo(string s):Bar(s){
    }
    int main(int argc, char *argv[]{
    foo(argv[1]);
    }
    

  • KambingKambing Registered User regular
    Carpy wrote: »
    This is probably a dumb c++ question but here it goes. I have a class Foo which has a member object Bar. Bar's constructor takes a string.
    Can I do something like:
    Foo.cpp
    Foo:Foo(string s):Bar(s){
    }
    int main(int argc, char *argv[]{
    foo(argv[1]);
    }
    

    Yes, modulo syntax. std::string has the following constructor:
    std::string(const char *s);
    
    which is implicitly invoked when you pass argv[1] to Foo(string). Fixing up your syntax:
    #include <string>
    
    using namespace std;
    
    struct Bar {
        Bar(string s) { }
    };
    
    struct Foo {
        Bar bar;
        Foo(string s) : bar(s) { }
    };
    
    int main(int argc, char *argv[]) { 
        Foo f (argv[1]);
    }
    
    compiles successfully.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • CarpyCarpy Registered User regular
    Kambing wrote: »
    Carpy wrote: »
    This is probably a dumb c++ question but here it goes. I have a class Foo which has a member object Bar. Bar's constructor takes a string.
    Can I do something like:
    Foo.cpp
    Foo:Foo(string s):Bar(s){
    }
    int main(int argc, char *argv[]{
    foo(argv[1]);
    }
    

    Yes, modulo syntax. std::string has the following constructor:
    std::string(const char *s);
    
    which is implicitly invoked when you pass argv[1] to Foo(string). Fixing up your syntax:
    #include <string>
    
    using namespace std;
    
    struct Bar {
        Bar(string s) { }
    };
    
    struct Foo {
        Bar bar;
        Foo(string s) : bar(s) { }
    };
    
    int main(int argc, char *argv[]) { 
        Foo f (argv[1]);
    }
    
    compiles successfully.
    Thank you, that's what I had thought. Compiling with mingw on my laptop just exits as soon as I try to access any of Bar's methods so I was thinking I was doing something wrong there. Loaded it onto my unix account at school and it runs fine. I guess I will solve that discrepancy tomorrow.

  • ecco the dolphinecco the dolphin Registered User regular
    Yessss

    The feeling you get when it all falls into place

    Memory mapped I/O registers, auto configuration, hardware interrupts and more.

    I didn't actually expect PCIe implementation to be this easy!

    Penny Arcade Developers at PADev.net.
  • undergroundmonorailundergroundmonorail single-track subway Registered User regular
    edited April 2014
    Here are some games that I think people in this thread will like. At least, I like them. If you happen to know more that are similar I'd love to try them out :)

    Jahooma's LogicBox
    qhZdafz.png

    The game has you working with a Befunge-style language, with "boxes" rather than characters. A symbol with a string attached travels through the mechanism, being redirected by boxes and modifying the string. For example, the first challenge is "Rotate", or "Move the first character of the string to the end", and your available boxes are "Copy the first character to the end" and "Delete the first character". That one's pretty trivial, obviously, but some later levels are much harder.

    Some completed levels are turned into boxes for you to use later. This comes into play in levels like level 13, which is impossible to get a perfect score on without first mastering level 8.

    A slightly easier version of this game would be a great teaching tool, I think. It's a very good way to practice designing an algorithm and implementing it without having to struggle with a specific language along the way. Later levels introduce recursion (sorry, bowen) in a way that some people might find a bit easier to grok. I think the only thing holding this back from being a great way to introduce children to programming is the difficulty; I still can't beat some of the challenge levels.

    Manufactoria
    DL2qbUe.png

    This game puts you in charge of a robot factory. Robots have a string of dots, with each dot being red or blue. Your tools are "Add a red to the end", "Add a blue to the end", "Check for a red or blue at the beginning, deleting it if you find it", and all those things but with yellow and green (available to you but guaranteed never to be in the input). While simple, these allow you to do a lot of things.

    The kinds of challenges in this game are varied. About half want you to modify the input somehow, and output the modified robot. The other half have you testing a condition, outputting a robot with any (or no) modifications to its string of dots if the condition is met and dumping it to the factory floor otherwise. Some have you doing binary math, with blue dots considered 1 and red dots considered 0. Others have you doing things like testing a string for symmetry, or ensuring there are more blue dots than red ones.

    Working out ways to solve these complex problems with simple tools is mind-boggling, and figuring out a solution is incredibly satisfying. You start to anticipate failure, and seeing "The malevolence engine has found no flaw!" is a genuine shock when you realize you've covered all the edge cases. Of the bunch, this one is my personal favourite.

    KOHCTPYKTOP: Engineer of the People
    158nwmZ.png

    This one's a mouthful. Apparently the first word in the title is pronounced "Constructor" in Russian, but I don't speak Russian so I can't verify that myself.

    This one's really bare bones. In this game, you don't even have transistors, you make transistors. You have metal wire, N silicon, and P silicon. P silicon drawn over N silicon creates an NPN gate, allowing power to flow through the N silicon if the P silicon is powered. N over P creates a PNP gate, allowing power to flow through the P silicon if the N silicon isn't powered. And that's the whole game.

    It's a fun peek into the world of incredibly low-level electronics. You're forced to abuse the fact that gates take time to activate in order to create delays for oscillators and the like. You have to take shortcuts to save room ("I should use the +VCC for this, but it's far away and this gate will only ever be used while this other one is on, so I'll just wire it up to that output") and it's exactly the right mix of fun and frustrating to keep you coming back.

    It also appears to be set in an alternate universe where the Soviet Union never fell, so you know. If that does anything for you.

    The Codex of Alchemical Engineering
    qJ5WqwG.png

    I'm going to be honest: I couldn't get into this one. I don't know. It seems similar enough to the last two, and I hear people do nothing but sing its praises, but I'm just not feeling it. Definitely including it for completeness, though.

    This game has you transmuting glyphs and moving them around. You have to combine them, rotate them, move them around... Listen, I'm making this game sound boring because I don't like it so I don't know much about it. If the other games I'm mentioning at all interest you, check this one out. Honestly, you'll probably like it.

    The much harder sequel can be found here.

    Spacechem
    bFMblGs.jpg

    This one's almost identical to The Codex of Alchemical Engineering, as far as I can tell, but I love Spacechem. I have no idea why that is.

    This game has you automating a factory. Molecules come in, you do something to them, molecules go out. Some levels have you hooking up multiple factories, forcing you to decide what the scope of each one should be. Other ones have you using these factories to power lasers to fight of space monsters (???).

    My favourite thing about this game is the fact that there are two tracks, honestly. It allows for a lot more efficiency when you have two arms moving around doing their job independently, but also demands that you know exactly what you're doing to keep them synced up.

    Unfortunately, this is the only game on the list that costs money to play, but it's absolutely worth it. It's available for all major operating systems, including Android and iOS.

    Untrusted
    SsjktgK.png

    Uniquely, this game is the only one on the list that involves literal programming! The rest are essentially metaphors, but this one is pure javascript. (Or are programming languages metaphors for what the other games have you doing? Truly, these are important questions in our quest for knowledge of the universe.)

    It's pretty simple. You're an @, the exit's a ▯. The arrow keys, WASD or Vim keys (!!) move you, hopefully towards the exit. However, you also have access to the source code that generated the level. Most of it tinted red, making it editable, but anywhere the background is black is fair game for you to add to, modify or remove. Can you figure out how to add four characters to make this level beatable? (I chose this one for the screenshot because it's the most visually impressive, the actual puzzle is kind of silly.)

    I ran into a pretty nasty bug (in part of the code I can't modify!) on level 9 which is impeding my progress until I get a dev response. It doesn't appear to be universal (I've seen people talk about levels I can't get to yet), but even only based on the beginning I've had a lot of fun with it.

    undergroundmonorail on
    Pokémon X | 3DS Friend Code: 0490-4897-7688
    Friend Safari: Fighting - Machoke, Pancham, Riolu | In game name: Jessica
    Official Weather Gym Leader of the G+T Pokémon League. @me to try for the Climate Badge!
  • AnteCantelopeAnteCantelope Registered User regular
    Kambing wrote: »
    Phyphor wrote: »
    My problem with dynamic typing is that it puts the burden of specifying the API on comments. With static typing, I know that void foo(Bar baz) takes either a Bar object or a subclass, or something that implements the Bar interface. With dynamic typing, void foo(baz) doesn't tell me exactly what I need, and if the comments aren't accurate or helpful, I'm in trouble, and need to start digging through the source code to try to guess what sort of object it needs.

    In theory, anything that makes sense should be able to go in there. In theory, a function expecting an int shouldn't choke on 2.0, for example.

    In theory. It rarely works out that way.

    The problem is when you don't have 2, you have 2.00001. Is it still valid? Maybe!

    The worst examples I have of working with dynamically typed languages in recent memory are working with various parser generators in Javascript and Python. If I parse a list of things, what do I get back? A list of parsed objects? A record that contains a list of parsed objects? If the list is empty, what do I get back? An empty list or record? A null reference?

    I've spent an unnecessary amount of time trying to understand what the generator APIs were giving back to me, something that is (nearly) completely obviated in a statically-typed language. More generally, working with reasonably complicated libraries in dynamically-typed languages that don't thoroughly document their interfaces (to the point of giving quasi-type signatures of some form or another) have always caused me more grief than they should.

    I find APIs need to be documented much like a type signature, at which point why use a comment that can become out of date when you can have a static type that will be enforced by the compiler?

    Besides which, how often is dynamic typing really useful? I mean, in some cases it's definitely useful, but usually I find methods return a dictionary, or require a Foo object as an argument, and there's no value to dynamic typing when you require a static type like that.

    I've been looking at Groovy lately, and the way it combines dynamic and static typing is interesting, although to be honest I'd rather just stick with static typing and Interfaces.

This discussion has been closed.