|
Most of the discussion here really stems from the fact that different people argue over rules which apply to different levels of the Dreyfus model. The rules that you'd set for a beginner or advanced beginner are different from these that apply for an expert. For a 2-year-old the rule is simply "DO NOT TOUCH THESE WALL THINGS, OUCHY OUCHY". For a 8-year old the rule might be, "Never touch or shove anything into the wall outlets except for proper plugs on things". For an adult the rule may be "Don't mess around with the outlets except when you're sure you switched the power off at the mains". The next level may be "Well you may touch one of the wires even when the power is on, as long as you're isolated from the ground and not touching any other wires" Same thing for anything code-related. It makes better sense to offer the beginners concrete and hard rules, which they may grow out of, rather than trying to explain the intrinsics of electricity to a 2-year-old.
|
# ? Nov 26, 2012 08:24 |
|
|
# ? May 16, 2024 18:54 |
|
Gism0 posted:http://www.daniweb.com/software-development/cpp/threads/440954/cant-fix-error-in-my-program Help, my program is broken? Like the whole thing, somewhere!!!?!?!?
|
# ? Nov 26, 2012 08:28 |
|
Gism0 posted:[url]http://www.daniweb Say no more.
|
# ? Nov 26, 2012 08:29 |
|
pigdog posted:Most of the discussion here really stems from the fact that different people argue over rules which apply to different levels of the Dreyfus model. The rules that you'd set for a beginner or advanced beginner are different from these that apply for an expert. Adding on to this, usually when something's not dangerous (IE personal coding for learning's sake), the best way to learn is to do things yourself and make mistakes. Asking "What's the best way to do X" isn't necessarily beneficial because you won't know why it's best to do X that way, it's best just to try and accomplish X, figure out what problems you have, and then try to fix those problems, or ask about how best to solve those specific problems if it's something complex.
|
# ? Nov 26, 2012 08:48 |
|
pigdog posted:Same thing for anything code-related. It makes better sense to offer the beginners concrete and hard rules, which they may grow out of, rather than trying to explain the intrinsics of electricity to a 2-year-old. There are a lot more 2-year-olds doing programming than electrical work, though.
|
# ? Nov 26, 2012 09:36 |
|
Volte posted:It is my belief that (possibly catalogued in some arcane Greek tome) there are some numbers between 10 and 3000. My experience of bad code-bases causes me to believe otherwise.
|
# ? Nov 26, 2012 12:37 |
|
Gism0 posted:http://www.daniweb.com/software-development/cpp/threads/440954/cant-fix-error-in-my-program
|
# ? Nov 26, 2012 12:47 |
|
Aleksei Vasiliev posted:His averaging system is pretty great code:
2. using float instead of double - shows deep understanding that normal usage doesn't require double precision and saves precious stack space. 3. intuitive naming scheme - easy to see that xxxxx comes before xxxxxxxx, no dependency on numerals (culture independent!) 4. no variables named tmp 5. has comments, but not too many 6. no costly memory allocations Probably better than anything I've ever written, A++ would hire to work on my banking system
|
# ? Nov 26, 2012 13:09 |
|
code:
|
# ? Nov 26, 2012 14:12 |
|
BliShem posted:4. no variables named tmp
|
# ? Nov 26, 2012 14:45 |
|
It also has several XXX variables, not very worksafe at all.
|
# ? Nov 26, 2012 14:46 |
|
From that same page:code:
|
# ? Nov 26, 2012 16:24 |
|
Gism0 posted:http://www.daniweb.com/software-development/cpp/threads/440954/cant-fix-error-in-my-program A part of me is tempted to fix this. The rest of me notes that it's over 5000 lines long, and is screaming in horror.
|
# ? Nov 27, 2012 01:51 |
|
nuvan: There's no way in hell I'm gonna take that plunge, but I am morbidly curious to know what it's supposed to do and just how simple it could be. Go for it, man! edit: Or we could golf it. What do you guys think? Internet Janitor fucked around with this message at 02:29 on Nov 27, 2012 |
# ? Nov 27, 2012 02:27 |
|
Speaking of poorly named variables...code:
Fuckers.
|
# ? Nov 27, 2012 03:09 |
|
Encountered some neato code today in the guts of an ancient VB6 app that hooks up to some MS Access databases (note plural):code:
It's not the worst horror ever but this code is like that everywhere. Everyone who's looked at it hates it about as much as I do. I'm working on replacing the whole app but holy hell, every time I fire up the VB6 IDE I feel like I've developed a new and exotic form of cancer.
|
# ? Nov 27, 2012 04:47 |
|
Well apart from the fact that it's testing against the same value twice, and that the second condition can never fail after the first one, it seems to me like whoever wrote this is just using strings as enumeration constants, which I wouldn't necessarily call a horror if the language doesn't offer them natively. I've never used VB, does the language have enumerations? EDIT: vvv If you had actually *read* my post, you would have noticed that no, I did not miss that the final else clause contains dead code, seeing how my post begins with "apart from that ..." vvv PrBacterio fucked around with this message at 15:10 on Nov 27, 2012 |
# ? Nov 27, 2012 10:24 |
|
PrBacterio posted:Well apart from the fact that it's testing against the same value twice, and that the second condition can never fail after the first one, it seems to me like whoever wrote this is just using strings as enumeration constants, which I wouldn't necessarily call a horror if the language doesn't offer them natively. I've never used VB, does the language have enumerations? Did you miss the part where there's 100 lines of code inside the body each if? Also, I'm pretty sure that the last 'else' clause is unreachable code.
|
# ? Nov 27, 2012 13:19 |
|
BliShem posted:Did you miss the part where there's 100 lines of code inside the body each if? http://stackoverflow.com/questions/649951/and-not-in-vb-net
|
# ? Nov 27, 2012 19:23 |
|
nuvan posted:A part of me is tempted to fix this. The rest of me notes that it's over 5000 lines long, and is screaming in horror. I'll buy you a forums upgrade if you turn the monstrosity into some 30 line paragon of elegance.
|
# ? Nov 27, 2012 19:30 |
|
WHOIS John Galt posted:I'll buy you a forums upgrade if you turn the monstrosity into some 30 line paragon of elegance. Hell, why not. So will I.
|
# ? Nov 27, 2012 19:35 |
|
Doctor w-rw-rw- posted:I haven't done VB in close to twenty years (like, in elementary school), but based on my reading, this is only true if you assume Nothing <> ??? == true for any ??? that is not Nothing. Both the link and MSDN only talk about having the right-side of the comparison be Nothing, but I haven't done VB ever so I dunno. http://msdn.microsoft.com/en-us/library/0x9tb07z.aspx MSDN posted:When checking whether a reference (or nullable value type) variable is null, do not use = Nothing or <> Nothing. Always use Is Nothing or IsNot Nothing. And the very next line: MSDN posted:For strings in Visual Basic, the empty string equals Nothing. Therefore, "" = Nothing is true. "Don't do it, but if you do, here's what will happen"
|
# ? Nov 27, 2012 19:57 |
|
bobthecheese posted:Speaking of poorly named variables... As for putting Tbl at the end of table names, sometimes it's nice to know when you're working directly with a table or with a view. It's not like you're going to run into the problem of Hungarian notation where the name is out of sync with the type.
|
# ? Nov 27, 2012 21:51 |
|
Hammerite posted:I think Zamujasa was calling it cargo-cult because the author begins by using a database escape function, when the data seems not to be destined for a database. Thereby displaying a lack of insight into what the purpose of the escape function is and why it might appear in other code the author had seen. This is correct. It's using MySQL escapes to stuff data into a pseudo-XML structure. The cargo cult comment was about it, too, since he's obviously just using it from other places, but next time I'll elaborate more. The thing that receives these (fake) XML strings is a real joke, too. It doesn't even conform to its own (asinine) spec, so if you followed the way they said to lay it out (with the two different newline escape codes as a container... yep, no whitespace allowed here), it'd fail. You had to use several for some reason. And of course the message you get if it fails to understand what you sent? code:
Zamujasa fucked around with this message at 22:47 on Nov 27, 2012 |
# ? Nov 27, 2012 22:29 |
|
In spite of my comment earlier, I have begun fiddling with that horrendous C++ program. I'm finding it oddly relaxing to delete swaths of code and replace them with simple loops and conditionals. It seems to be a CLI shell of sorts, containing a wide array of semi-useful utility functions, from (buggy) unit conversion to (buggy) random number generation. Amazingly, there are a few loops and arrays in the code, which indicate the author was at least dimly aware of these concepts. I feel like I'm exploring a grand cathedral of idiocy.
|
# ? Nov 27, 2012 22:47 |
|
It just feels like a big troll since I originally saw the link from some 4chan related site.
|
# ? Nov 27, 2012 23:10 |
|
Otto Skorzeny posted:Clay is more promising than Rust imo Clay doesn't have a GC. I get what it's for, but it's not the thing I'm missing. I basically just want C# to compile to native.
|
# ? Nov 28, 2012 00:01 |
|
Zamujasa posted:<Error>The XML was malformed<Error> Just count yourself lucky that this error doesn't trigger on itself.
|
# ? Nov 28, 2012 00:12 |
|
GrumpyDoctor posted:Clay doesn't have a GC. I get what it's for, but it's not the thing I'm missing. I basically just want C# to compile to native. what would you hope to gain from this?
|
# ? Nov 28, 2012 00:57 |
|
Amarkov posted:Just count yourself lucky that this error doesn't trigger on itself. Most of the problem stems from the fact they call it XML but don't actually use XML. Surprise. There's no <?xml header, there's not even a real root tag. It requires very specific formatting because derp.
|
# ? Nov 28, 2012 01:36 |
|
BliShem posted:Both the link and MSDN only talk about having the right-side of the comparison be Nothing, but I haven't done VB ever so I dunno. Those are two different cases. The first case is talking about comparing any nullable variable to Nothing to test if it's null. The second case is talking about comparing a string to Nothing to test if it's empty. It's still weird and unintuitive though.
|
# ? Nov 28, 2012 02:35 |
|
Otto Skorzeny posted:what would you hope to gain from this? Okay, my hyperbole may have obfuscated my point a little. I want a high-level language that allows me to (relatively) quickly build and deploy business applications to a variety of platforms (not just Windows). I don't need bleeding-edge performance or fully deterministic resource release or any of that stuff. I understand the roles of those features - I've needed and used them myself - but they don't solve problems that I, in my personal work, spend much time confronting. My remark about C# was just meant to highlight that while I like it quite a bit as a language it's tied to .NET. Clay seems fantastic for the times when I need all the cool stuff that C++ can do but don't want to actually use C++, because, well, C++. But those times are infrequent for me. When my requirements are a) manage my resources unless I ask you not to and b) don't require a framework or a VM or anything to run, there just doesn't feel like a lot of space to work in.
|
# ? Nov 28, 2012 02:36 |
|
Mono is actually pretty good these days, or so I hear.
|
# ? Nov 28, 2012 02:38 |
|
What's wrong with requiring a VM?
|
# ? Nov 28, 2012 02:54 |
|
Suspicious Dish posted:What's wrong with requiring a VM? Windows deployment of JVM-based stuff is a colossal pain in the rear end, in my experience. I haven't had much trouble with CLR/.NET/mono-based stuff, though.
|
# ? Nov 28, 2012 02:56 |
|
I'm a pretty big fan of Go. Compiles to native code, garbage collected, easy to make bindings to C libs. The way it treats interfaces is also pretty much the best thing ever. The name is annoying but I find that using 'golang' tends to work when googling for things.
|
# ? Nov 28, 2012 04:32 |
|
beoba posted:I'm a pretty big fan of Go. Compiles to native code, garbage collected, easy to make bindings to C libs. The way it treats interfaces is also pretty much the best thing ever. Yep, and then you can use https://github.com/lxn/walk for guis and such. Hard to beat a single statically linked executable with no external dependencies for simplicity of deployment.
|
# ? Nov 28, 2012 04:44 |
|
Yeah, I have some friends that are big Go fans. I should probably check it out.
|
# ? Nov 28, 2012 04:46 |
|
On the other hand, Go's garbage collector is considered one of the weaker parts of it currently (at least as of Go1, there has been work on it since though I haven't seen any "Eureka!" posts on their mailing list yet). I only mention it because the GC seems important to you, and for certain applications there are caveats you'd want to research/test thoroughly before making a commitment.
|
# ? Nov 28, 2012 05:02 |
|
|
# ? May 16, 2024 18:54 |
|
The Gripper posted:On the other hand, Go's garbage collector is considered one of the weaker parts of it currently (at least as of Go1, there has been work on it since though I haven't seen any "Eureka!" posts on their mailing list yet). Yeah I'd heard the same thing, but haven't really 'experienced' it, though I've been fairly careful to avoid mallocing things willy-nilly. Now that Go1's out, I'm hoping that's the sort of thing they'll be concentrating on. Given that Google also did V8 and Dalvik I'm hopeful they'll eventually be able to scrounge up a reasonable GC implementation for Go as well.
|
# ? Nov 28, 2012 05:22 |