Discussion in 'General Chatter' started by Morven, Feb 26, 2015.
C#, CC is cyclomatic complexity (context was I was dicking around with the code analysis tools).
fwiw, i can probably help at least some with ruby, c, and go. i picked up go recently.
Oh. Never analyzed CC so I can't help.
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".
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
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-
That sounds appropriate honestly.
i learned to appreciate console output during the debug phase. half a dozen console.log(); clustered to find the errors...
I actually like the ternary but it should be used to simplify, not obfuscate.
Go is a nice language. I like it.
Ternary is also a thing in Java.
Gots a link to a good starter tutorial?
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.
Stack Overflow Importer
I found an article about spaces and tabs in programming. I thought some of you might find it interesting.
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.
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?
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.
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
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
Who wants a language that reads like a badly-written BDSM porn script?
It has gendered variables and allows you to refer to them using pronouns, which is precisely what all slashfic writers wanted, right?
Nah, I want APL.
Kintsugi is based on the premise that nothing anyone can do or say makes it okay to treat them like trash. By logging in, you affirm that you understand this to be the foundational premise of the community. More on our community philosophy here.
Separate names with a comma.