Programming

Discussion in 'General Chatter' started by Morven, Feb 26, 2015.

  1. BlackholeKG

    BlackholeKG I saw you making fire

    C#, CC is cyclomatic complexity (context was I was dicking around with the code analysis tools).
     
  2. seebs

    seebs Benevolent Dictator

    fwiw, i can probably help at least some with ruby, c, and go. i picked up go recently.
     
    • Like x 1
  3. Oh. Never analyzed CC so I can't help.
     
  4. Lissa Lysik'an

    Lissa Lysik'an Dragon-loving Faerie

    Code Complexity? There is an algorithm for determining the complexity of a piece of code - if the value is high then it means the complexity is too high for future maintenance to be cost effective. It has MANY failure modes - for example it considers a sequence of logical operators in a single "if" statement to be "highly complex" when in reality that is the preferred coding mechanism - if you know a set of conditions, put them together, don't make the reader have to trace through a sequence of "if" and "else if" statements.
    It is more a "readability guide for junior programmers" than a useful metric.
    In practice, the older guideline of "if you can't see the beginning of the routine while looking at the end of the routine, the routine might be too long and could be broken up. Unless it is a series of operations that have no reasonable subroutines within it, in which case, ignore the guideline".
     
    • Informative x 1
    • Useful x 1
  5. Lissa Lysik'an

    Lissa Lysik'an Dragon-loving Faerie

    Oh - but using a series of ?: operators is evil and the person who invented the ?: thing in C/C++ should be forced to code in APL for the rest of their life.

    EDIT: for those not familiar with the ?: thing http://www.dnawebagency.com/ternary-operator/
    It is really useful until you get idiots that do things like
    bool result = test1 ? (test2 ? (test3 ? maybe2 : maybe1) : (possibly4 ? guess1 : guess2)) : Mightbe5)
    and as you can see the : and ( ) things get REALLY mangled
    EDIT2: yes, I lost track and that's why I didn't write an actually useful series of that poop
     
    Last edited: Apr 29, 2017
    • Like x 1
    • Informative x 1
  6. winterykite

    winterykite Non-newtonian genderfluid

    i love the ternary but i forget its existence again after 10 minutes

    -lovingly looks at the huge nested switchcase my text-based adventure uses to interpret user input- -it's like literally half the code-
     
  7. That sounds appropriate honestly.
     
  8. winterykite

    winterykite Non-newtonian genderfluid

    i learned to appreciate console output during the debug phase. half a dozen console.log(); clustered to find the errors...
     
    • Like x 1
  9. Morven

    Morven In darkness be the sound and light

    I actually like the ternary but it should be used to simplify, not obfuscate.

    Go is a nice language. I like it.
     
    • Agree x 1
  10. Ternary is also a thing in Java.
     
  11. Lissa Lysik'an

    Lissa Lysik'an Dragon-loving Faerie

    Gots a link to a good starter tutorial?
     
  12. BlackholeKG

    BlackholeKG I saw you making fire

    God damn, my game project is giving me a real headache recently, aha.

    Ironically, it's not really the... actual game that is causing it? The sort of game engine deal I have running generally works as intended, now I have the groundwork down.

    The problem is another system entirely, which I added in really early on, before this was even a graphical game as opposed to a text-based one (with all of the implications for the code that that brings with it). It's what should be a fairly simple section of the code that involves printing text to the screen; depending on the user input, at various times the lines of text are required to be printed instantly, or else they print themselves out letter by letter with a delay between each to get sort of a typewriter effect.

    Sounds simple, right? It should be. But the problem is that the code I have to regulate the text-printing has now been bootstrapped with so many additions since I originally wrote it that it's become an ungodly mess that's almost impossible to untangle. It mostly works fine, but occasionally I get weird errors where the wrong sections of text are skipped, or else certain segments are unskipable for no discernible reason. It's also now basically duplicated twice because I had to put in place another very similar but subtly different system that operates on chat systems, but they both share the same method to regulate the text and that's causing no end of problems as well. It's got to the point where it takes about as much time to add a major new feature (these past two days I've added a new system for loading pre-designed levels that was implemented practically seamlessly) than it does to repair (mostly) the complex text-printing errors that crop up practically whenever I change anything that involves that system. It's so irritating because it should be really simple. I would rewrite it all from scratch, but at this point, because it's such a core piece of the code that's been there from the start, I am fairly sure that a lot of the other systems tie into it and replacing it might break them in unpredictable ways. So I either risk that or else I'm stuck with this buggy system. I mean it mostly works fine and I probably will fix it all up eventually but fuck is it inelegant. (Then again, a lot of my code is kinda inelegant. This project has involved me learning C# entirely from scratch, and the earlier you go in my code the more that becomes very clear).

    Still, the new stuff I'm implementing is working fairly well, though, and I'm happy for the progress overall! The text console/log isn't even strictly necessary for the gameplay... But I want to keep it because it retains the link to the original text adventure and the functions that that had, that I kind of want to keep.
     
    Last edited: May 17, 2017
    • Witnessed x 1
  13. Exohedron

    Exohedron Doesn't like words

    Stack Overflow Importer

     
    • Winner x 2
    • Like x 1
  14. NevermorePoe

    NevermorePoe Nevermore

  15. Socratease

    Socratease Well-Known Member

    We got any web development folks around? It's been almost a year since I got my computer science degree and finding a programming job has proved difficult. So I figure I'll try starting a side project to knock the rust off my skills and seem more hireable.

    I'm preparing to GM my first real tabletop campaign, so the best idea I've got right now is to develop a website dedicated to it. Our group's played with the idea of doing a podcast so it could be fun to do up a cool platform for that.

    Except it's been almost a year since I did a programming thing, so all I'm remembering re: web development is the rough basics of ASP .NET and Javascript.

    Anybody know what's popping in the web development world these days? Or can point me to resources that do? Is there like a "How to do websites if you already can code" guide out there?
     
  16. winterykite

    winterykite Non-newtonian genderfluid

    codecademy was my thing of choice. i think recent stuff -- and i'm a year out of date here as well -- is ruby on rails, angularJS, jquery, and reactJS. warning about reactJS: the documentation is atrocious and it works ass-backwards.
    w3schools is also a decent reference ive found.
     
  17. shmeed

    shmeed plant me

    question, what does a programming gig usually entail? what does a job look like, how long does it take, how difficult is it? i have no frame of reference
     
  18. Verily

    Verily a very ineffective hitman

    I just wanted someone to explain why on earth I'd want to use lambda again in case I got it this time. I wasn't expecting the video to be this good?



    I certainly didn't expect to discover #maximum aesthetic
     
    • Informative x 1
  19. Exohedron

    Exohedron Doesn't like words

    Who wants a language that reads like a badly-written BDSM porn script?

    Fetlang

    It has gendered variables and allows you to refer to them using pronouns, which is precisely what all slashfic writers wanted, right?
     
    • Winner x 2
  20. Verily

    Verily a very ineffective hitman

    Hmmmmm...

    Nah, I want APL.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice