archived
stringclasses
2 values
author
stringlengths
3
20
author_fullname
stringlengths
4
12
body
stringlengths
0
22.5k
comment_type
stringclasses
1 value
controversiality
stringclasses
2 values
created_utc
stringlengths
10
10
edited
stringlengths
4
12
gilded
stringclasses
7 values
id
stringlengths
1
7
link_id
stringlengths
7
10
locked
stringclasses
2 values
name
stringlengths
4
10
parent_id
stringlengths
5
10
permalink
stringlengths
41
91
retrieved_on
stringlengths
10
10
score
stringlengths
1
4
subreddit_id
stringclasses
1 value
subreddit_name_prefixed
stringclasses
1 value
subreddit_type
stringclasses
1 value
total_awards_received
stringclasses
19 values
True
[deleted]
null
Of course you cannot find bugs by inspecting the code if you don't have the source code to begin with. If there's a bug in a compiler you will only find it if the code you compile does not get the correct result. This does not mean that a correct formatting of the code will be useless for avoiding bugs. I have worked with lots of aerospace engineering code going back to programs written in the 1960s in FORTRAN, there are no modern software maintenance programs for most of those. When you have to deal with code that goes to a half-million lines for a single program that was first written for a computer you've barely heard of, then migrated to a PDP-11, later to a VAX then you'll understand how important code readability can be. The type of bug report that I have to deal with are like "we get more fuel flow than predicted". Then one has to dig into the software to find exactly how the fuel flow is predicted, only to find that somewhere the formula that inserted temperature variation isn't being appliet to the fuel lines. This isn't like a program crash that you can use a debugger to trace, there are many *if* statements that one must unravel, each one applying a slightly different formula. A program crash is obvious, a difference between 1.075 and 1.057 in a calculated result is not. The only way to find many sorts of bugs in engineering calculations is by tracing the program flow to make sure the correct formulas are being applied at each step. In the end, the total complexity of engineering software is dictated by the process itself. Reducing the program to the absolutely fewest lines is one of the best ways to avoid bugs in that kind of software. This does not mean that there aren't other kind os bugs, but there are many bugs that shorter code, as in less lines, will avoid.
null
0
1317048393
False
0
c2mogap
t3_krklz
null
t1_c2mogap
t1_c2mnw4a
null
1427648689
-1
t5_2fwo
null
null
null
True
naasking
null
Then again, there could be other effects at play which lead the second to being preferable. For instance, with the second version you can *see more surrounding context* when reading the code, so making changes might be less error-prone because you can view and understand more of the program's state. It might seem silly at first to use a metric which would appear to be easily gamed, but LOC has been empirically shown to be strongly correlated with defect rate. We just don't necessarily know *why* yet.
null
0
1317048433
False
0
c2mogh0
t3_krklz
null
t1_c2mogh0
t1_c2mngvy
null
1427648691
1
t5_2fwo
null
null
null
True
lazyFer
null
I've been a big fan of ORM (Object Role Modeling) for quite a while now as a means to capturing business rules through a fact based approach. This is **not to be confused with** Object Relational Mapping technologies used to act as a layer between the database and the application. In Object Role Modeling your goal is to model information based on a series of discreet "facts" rather than the typical relational modeler dumping attributes into buckets (tables). The facts taken together can be converted (using a simple formula) into a relational model (but ORM is itself solution agnostic being more concerned with the information itself and the rules associated with it (it is capable of capturing far more exacting rules than can be shown on an ER model)). [Wiki](http://en.wikipedia.org/wiki/Object-Role_Modeling) [Other](http://www.orm.net/overview.html) ps. A good model depends on the behaviors associated with how it's to be used.
null
0
1317048498
False
0
c2mogps
t3_kqucu
null
t1_c2mogps
t1_c2mnvyp
null
1427648694
1
t5_2fwo
null
null
null
True
naasking
null
Modular code gets more testing due to reuse though, which is why modularity is good.
null
0
1317048650
False
0
c2mohe5
t3_krklz
null
t1_c2mohe5
t1_c2mn4qq
null
1427648707
2
t5_2fwo
null
null
null
True
IRBMe
null
> Then again, there could be other effects at play which lead the second to being preferable. For instance, with the second version you can see more surrounding context when reading the code, so making changes might be less error-prone because you can view and understand more of the program's state. With any reasonable sized screen, that's a lot of surrounding context. If you really *need* that much surrounding context, especially context which for some reason can't be provided by your IDE or code editor, than that is a bad code smell: an indication that your method is possibly too complex and requires refactoring. Indeed, a common heuristic is that you should be able to fit your whole method on the screen. While that doesn't always apply (hence it being a heuristic and not a rule), it's often a good indication.
null
0
1317048658
False
0
c2mohfy
t3_krklz
null
t1_c2mohfy
t1_c2mogh0
null
1427648704
1
t5_2fwo
null
null
null
True
kromagnon
null
That's the thing about infinity though. That image is *just as far* from infinite resolution as your program is.
null
0
1317048691
False
0
c2mohkc
t3_krpem
null
t1_c2mohkc
t1_c2mo0jt
null
1427648706
16
t5_2fwo
null
null
null
True
malfy
null
i think it's because it does the if () { for you as well.
null
0
1317048729
False
0
c2mohq2
t3_kr2x5
null
t1_c2mohq2
t1_c2mnbkf
null
1427648708
1
t5_2fwo
null
null
null
True
lazyFer
null
I love the "I can do it in my head" excuse....I've worked with one guy...ONE....that could actually do that and create good models. Of course he used object role modeling and not standard ER modeling
null
0
1317048898
False
0
c2moien
t3_kqucu
null
t1_c2moien
t1_c2modoa
null
1427648717
1
t5_2fwo
null
null
null
True
usefulcat
null
Looks like LogMessage::getLevelName() is returning the wrong value for LL_INFO.
null
0
1317048908
False
0
c2moig5
t3_krd8f
null
t1_c2moig5
t3_krd8f
null
1427648717
2
t5_2fwo
null
null
null
True
LudoA
null
Slightly off-topic question: is it possible to run Java EE 6 on JDK 7? Java EE mostly consists of libraries that are provided by application servers implementing Java EE. If an application server runs on JDK 7, is it theoretically possible to run Java EE 6 on the JDK 7 underlying the app server? Or is there something which would make this technically impossible?
null
0
1317049052
1356862588
0
c2moj16
t3_krrz1
null
t1_c2moj16
t3_krrz1
null
1427648724
3
t5_2fwo
null
null
null
True
x86_64Ubuntu
null
OMG , I just got hit with the knowledge stick. The Object Role Modeling is what I have been doing this entire time, albeit poorly. I generally think of the business model, as in "a car can have many owners, some current some not" and then I structure my tables that way. I will say that it seems like a developer can hurt himself passing through the tiers as the best fact structure might not be the best data structure and the best in either one of those cases can end up being more work at the middle tier.
null
0
1317049091
False
0
c2moj6z
t3_kqucu
null
t1_c2moj6z
t1_c2mogps
null
1427648728
1
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1317049103
False
0
c2moj8s
t3_krpem
null
t1_c2moj8s
t3_krpem
null
1427648728
-8
t5_2fwo
null
null
null
True
Ploopie
null
See Kolmogorov Complexity. Quite similar.
null
0
1317049109
False
0
c2moj9u
t3_krklz
null
t1_c2moj9u
t3_krklz
null
1427648728
1
t5_2fwo
null
null
null
True
barebonescoder
null
+1 if only for the name. I want to be a ninjaneer when I grow up.
null
0
1317049160
False
0
c2mojie
t3_krv4y
null
t1_c2mojie
t3_krv4y
null
1427648731
1
t5_2fwo
null
null
null
True
kamishizuka
null
Bug #0: Program doesn't exist
null
0
1317049341
False
0
c2mokaw
t3_krklz
null
t1_c2mokaw
t1_c2mns3a
null
1427648742
5
t5_2fwo
null
null
null
True
IRBMe
null
> Of course you cannot find bugs by inspecting the code if you don't have the source code to begin with. Uh, in 99.99% of the cases I'm debugging I *do* have the source code. You seem to be incapable of *reading*, which would at least explain your over-simplistic understanding of the article. > This does not mean that a correct formatting of the code will be useless for avoiding bugs. There is no such thing as a single "*correct*" formatting of code; there are *preferred* formats, there are *preferred* styles, there are good reasons to sometimes use one style over another, there are arguments for and against different stylistic preferences, but there is no one *correct* way to format code, and even if there was, I severely doubt the "*correct*" way would be to smash all of the code together to make it as compact as possible so that you can fit it all on your screen, nor does the fact that more code can be fit on a screen in *any real way* aid with debugging. As a limited human being, you can't possibly hold all of the information that you're seeing on the screen at any one time in your head. Humans can juggle about 7 plus or minus two things at any one time. You can't possibly hope to make full use of all information that's available on the screen at one given moment, so it in fact is probably *more* beneficial to have *less* on the screen. That way, you can focus on the surrounding context that actually matters. When you need to take a further perspective, such as looking at the structure of code, there are plenty of tools for that, none of which involve cramming as much code into view as possible. > I have worked with lots of aerospace engineering code going back to programs written in the 1960s in FORTRAN Oh, a dick-waving contest now? You'll have maintained Ada code then? In Ada and similar languages, whitespace is significant, therefore lines of code *do* often correspond to program statements. Many languages are *not* like that. Lines do not correspond to individual program statements, and in fact whitespace is largely irrelevant to the compiler. Are you using equipment and tools from the 1960s too? Are you still using a 25 line teletype terminal? Are debuggers, modern code editors and development environments and modern software development tools still not invented yet where you work? > you'll understand how important code readability can be. Uh, what kind of ridiculous strawman is that? I never *once* mentioned code readability. Your silly argument was that being able to see more code on the screen at once helps both to avoid bugs and aids in debugging! That is utter nonsense. Cramming more code on to the screen, if anything, is going to *diminish* code readability. Whitespace, clear structure and separation of logical units is important to readability. As for aiding in debugging, if you think being able to see more code on the screen at any one time helps, you're debugging your code wrong! Learn to use a debugger! > This isn't like a program crash that you can use a debugger to trace, there are many if statements that one must unravel, each one applying a slightly different formula. If you think debuggers are only useful for solving crashes, you've obviously never used a debugger before and have no idea how to. A debugger is designed to aid in debugging the precise kind of problem you just described. Simply staring at the code until hopefully the problem jumps out at you is possibly one of the *worst* methods of trying to debug code that I've ever heard of. Only an idiot would debug by inspection and nothing else. And even if that is your preferred method of debugging, being able to see more code on the screen at any one time should in no way help you do that. If you need so much surrounding context that you can't fit it all on a modern monitor, then the code you are debugging likely needs to be refactored into something more maintainable. > A program crash is obvious, a difference between 1.075 and 1.057 in a calculated result is not. The only way to find many sorts of bugs in engineering calculations is by tracing the program flow to make sure the correct formulas are being applied at each step. Guess what a debugger does, genius? > In the end, the total complexity of engineering software is dictated by the process itself. Reducing the program to the absolutely fewest lines is one of the best ways to avoid bugs in that kind of software. [Really?](http://www.ioccc.org/years.html) So something like this random example is one of the most readable possible? int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\ o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);} Look, only two lines! It must be completely bug free, readable, perfectly maintainable. No, that's nonsense. Utter nonsense. So incredibly wrong that it's scary you're claiming to write engineering software. Making sure code is *simple*, making sure that it has *well defined interfaces*, making sure that it's *thoroughly tested*, making sure that it's *maintainable*, making sure that it's *thoroughly reviewed* are all good ways that, when combined, can help to improve the reliability of software. Trying to write it in as few lines as possible? No, that's just going to give you obfuscated code that's no less buggy or unmaintainable than well written code that makes proper use of formatting, whitespace, spacing, indentation without worrying about number of lines. > This does not mean that there aren't other kind os bugs, but there are many bugs that shorter code, as in less lines, will avoid. Lines are almost meaningless in many languages, where whitespace is mostly irrelevant to the compiler.
null
0
1317049362
True
0
c2mokf9
t3_krklz
null
t1_c2mokf9
t1_c2mogap
null
1427648742
0
t5_2fwo
null
null
null
True
Mr_Smartypants
null
What coloring scheme does this use?
null
0
1317049394
False
0
c2mokk0
t3_krpem
null
t1_c2mokk0
t3_krpem
null
1427648744
3
t5_2fwo
null
null
null
True
barebonescoder
null
Yeah, LOC is a pretty lame metric. Cyclomatic complexity would treat both of these snippets as equal, whereas something along the lines of "bytes per line" would quantify how hard it is for a human to quickly parse through the code from a pattern-matching perspective. Then again, pattern-matching perspectives on code only really shine when there is a standard in place.
null
0
1317049525
False
0
c2mol4z
t3_krklz
null
t1_c2mol4z
t1_c2mngvy
null
1427648753
2
t5_2fwo
null
null
null
True
Filmore
null
*view source* on www.google.com 's main page... then tell me small code file size decreases complexity.
null
0
1317049575
False
0
c2molde
t3_krklz
null
t1_c2molde
t1_c2mmtvy
null
1427648756
2
t5_2fwo
null
null
null
True
jevon
null
There are tools to identify similar-looking code and structures (e.g. copy & paste code).
null
0
1317049643
False
0
c2molp9
t3_krklz
null
t1_c2molp9
t1_c2mnlo1
null
1427648760
3
t5_2fwo
null
null
null
True
mwillsey
null
For me it's generating an M.bmp file, but it remains empty. What's going on? EDIT: I'm on OS X.
null
0
1317049814
True
0
c2momgt
t3_krpem
null
t1_c2momgt
t3_krpem
null
1427648770
4
t5_2fwo
null
null
null
True
ex_ample
null
Hmm, I'll have to look into that.
null
0
1317049966
False
0
c2mon6e
t3_kp1b5
null
t1_c2mon6e
t1_c2mnbpy
null
1427648779
1
t5_2fwo
null
null
null
True
semarj
null
it does run in that format
null
0
1317050045
False
0
c2monje
t3_krpem
null
t1_c2monje
t1_c2moj8s
null
1427648783
13
t5_2fwo
null
null
null
True
[deleted]
null
This post may have just made my life a little easier, thank you.
null
0
1317050092
False
0
c2monro
t3_krklz
null
t1_c2monro
t3_krklz
null
1427648786
1
t5_2fwo
null
null
null
True
imMute
null
Just rotate the monitor 90 degrees and tada, taller-than-wide display - perfect for viewing code.
null
0
1317050165
False
0
c2moo4n
t3_krklz
null
t1_c2moo4n
t1_c2mnooj
null
1427648792
4
t5_2fwo
null
null
null
True
mouseinahaze
null
Seriously, I've been seeing this a lot lately. I simply cannot force myself to read any content that uses it.
null
0
1317050173
False
0
c2moo6e
t3_krklz
null
t1_c2moo6e
t1_c2mn7w5
null
1427648792
2
t5_2fwo
null
null
null
True
mycall
null
I always look for features when considering a piece of code. Why not use that as a predictor? The complexity of features.
null
0
1317050180
False
0
c2moo7e
t3_krklz
null
t1_c2moo7e
t3_krklz
null
1427648792
1
t5_2fwo
null
null
null
True
jgohlke
null
Geez that's frustrating. EDIT: Downboaters ಠ\_ಠ
null
0
1317050333
True
0
c2mooyy
t3_krv1k
null
t1_c2mooyy
t3_krv1k
null
1427648801
-4
t5_2fwo
null
null
null
True
chengiz
null
He's using Cardo, but I wonder how he's getting that. I dont have that font, and a cursory glance didnt reveal any font-face setting. Ninja edit: ah nevermind, he's including a stylesheet that has the font-face setting. Edit: note to web designers - do not use font-face unless.
null
0
1317050369
False
0
c2mop50
t3_krklz
null
t1_c2mop50
t1_c2mn7w5
null
1427648805
2
t5_2fwo
null
null
null
True
philh
null
echo ';' > program.c Fixes bug #0.
null
0
1317050528
False
0
c2mopvn
t3_krklz
null
t1_c2mopvn
t1_c2mokaw
null
1427648814
6
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1317050591
False
0
c2moq6e
t3_krpem
null
t1_c2moq6e
t3_krpem
null
1427648818
-14
t5_2fwo
null
null
null
True
rick2g
null
The biggest problem with static software quality metrics is developers themselves. It's easy for a dev to write code that takes up twice as much space, and it's easy for a dev to produce scores of easy-to-fix bugs in order to boost numbers. It's easy for a dev to quickly write fast code by skipping error checks. If there's any software metrics immune from some type of gaming, I have yet to see it. Moreover, these are DEVELOPERS. They've got loads of training and experience manipulating systems - it's what they do for a living. Give them an incentive (directly monetary or job-security related) to game the system, and that's exactly what they'll do, and they'll almost certainly do it better than their managers can account for. Rule of thumb for the devs I've worked with: the best measurement of a developer's worth can be determined by his co-developer's opinions. Devs are the best measuring stick for other devs. They tend to over-inflate their own worth, but they also tend to be able to evaluate their co-workers pretty well. Once you've got a half-way decent sample size (say, about 10 opinions), you've got a pretty good idea of how good they are.
null
0
1317050972
False
0
c2moryv
t3_krklz
null
t1_c2moryv
t3_krklz
null
1427648842
2
t5_2fwo
null
null
null
True
Felicia_Svilling
null
As long as you can't see your whole program at the same time, a more compact coding style will let you see more code at a time. Which means that screen size is rather irrelevant to the question.
null
0
1317051044
False
0
c2mose2
t3_krklz
null
t1_c2mose2
t1_c2mnjfd
null
1427648847
2
t5_2fwo
null
null
null
True
camayisbest
null
This one is nice
null
0
1317051084
False
0
c2moskx
t3_kro3n
null
t1_c2moskx
t3_kro3n
null
1427648849
1
t5_2fwo
null
null
null
True
sztomi
null
The `\sif` does that.
null
0
1317051138
False
0
c2mostq
t3_kr2x5
null
t1_c2mostq
t1_c2mohq2
null
1427648853
1
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1317051216
False
0
c2mot7k
t3_krv1k
null
t1_c2mot7k
t3_krv1k
null
1427648858
1
t5_2fwo
null
null
null
True
yogthos
null
A missing closing bracket will be identified by any decent editor, while incorrect indentation may still be syntactically valid, but logically incorrect. This makes it impossible to detect automatically, and makes it more difficult to find for another person looking at your code.
null
0
1317051225
False
0
c2mot9a
t3_krpem
null
t1_c2mot9a
t1_c2mo0e2
null
1427648859
3
t5_2fwo
null
null
null
True
IRBMe
null
> As long as you can't see your whole program at the same time, a more compact coding style will let you see more code at a time. Why would I need to or want to see more code at a time than I currently can, even if I was looking at a 17" CRT monitor? I can't possibly comprehend that much code all at once (human short term memory is about 7 +/- 2 items), nor should I need to if my program is well written. What can fit on a screen is all the immediately surrounding context I should generally need, with a good code editor or IDE aiding in the few exceptional cases. > Which means that screen size is rather irrelevant to the question. A more compact coding style was important in the days when we had *very* limited terminals that could only display 24 or 25 lines at a time. Ever since we've had even basic 17" CRTs, coding style is no longer required to be so compact. With more screen real estate, we are free to break complex lines into several, we are free to add more whitespace, we are free to use whichever brace style we find best without having to worry too much about space. That's the point. Nobody should be worrying about how much code they can fit on their screens at any one time now because screens have long since progressed to the point where it should be a non-issue. If somebody thinks it *is* still an issue, that's an indicator that they're doing something pretty wrong.
null
0
1317051503
False
0
c2moum7
t3_krklz
null
t1_c2moum7
t1_c2mose2
null
1427648877
1
t5_2fwo
null
null
null
True
syranex
null
That last line... So amazing lol.
null
0
1317051533
False
0
c2mour9
t3_krv1k
null
t1_c2mour9
t3_krv1k
null
1427648878
-9
t5_2fwo
null
null
null
True
FrogsEye
null
That's great and shows you actually listen to the community. Just for clarity, with revenue do you mean yearly revenue? Personally, I'd prefer less restrictive license (e.g. GPL) over this method so I still won't be touching it. That and no price anywhere on the website = big *no no* for me! However, you may see more people being tempted now from this step alone.
null
0
1317051582
False
0
c2mouzz
t3_kn8ra
null
t1_c2mouzz
t1_c2mnh08
null
1427648887
1
t5_2fwo
null
null
null
True
i8beef
null
But in the first I can see BLOCKS of code instead of having to hunt down the opening braces in each case, thus leading to fewer scope bugs, and aiding in readability. But this is a taste thing. And actually I tend to use the former more often in C# / Java and the latter more often in PHP and Javascript and front end ASP.NET code blocks (to avoid <% if (x) { %> which seems to ugly when doing inline code blocks like ASP.NET embedded code). But I do a lot of the former more often nowadays because it really does help with readability... I'm STARTING to write all my code that way, but old habits die hard.
null
0
1317051738
False
0
c2movt1
t3_krklz
null
t1_c2movt1
t1_c2mniug
null
1427648892
2
t5_2fwo
null
null
null
True
inmatarian
null
They don't create copies of functions. Closures create copies of the lexical environments of the function. The function itself is compiled once, and then a closure is created for it which contains a pointer to the function code, and a pointer to the lexical environment. When a function is executed, it is given the lexical environment to close over. Closures do use a lot more memory, however. I had a back and forth once on /r/programming with someone where we tested how closures scale in Lua and the results were atrocious.
null
0
1317051839
False
0
c2mowag
t3_kroia
null
t1_c2mowag
t1_c2mnorb
null
1427648898
5
t5_2fwo
null
null
null
True
mipadi
null
Probably the fact that all the code is contained in a header.
null
0
1317051961
False
0
c2mowvh
t3_krd8f
null
t1_c2mowvh
t1_c2mmcqi
null
1427648907
3
t5_2fwo
null
null
null
True
Qinsd
null
Whitespace programming language... Yuck
null
0
1317051980
False
0
c2mowyz
t3_krpem
null
t1_c2mowyz
t3_krpem
null
1427648908
-15
t5_2fwo
null
null
null
True
jlt6666
null
It does. You must end a block with an end. It's like having braces except you don't need the opening one.
null
0
1317052487
False
0
c2mozfl
t3_kooiy
null
t1_c2mozfl
t1_c2mj30h
null
1427648940
0
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1317052543
False
0
c2mozpo
t3_krpem
null
t1_c2mozpo
t1_c2mohkc
null
1427648953
7
t5_2fwo
null
null
null
True
skilldrick
null
I think the point runedk was making is that the functions internal to the closure are copied for each new 'object'.
null
0
1317052813
False
0
c2mp13v
t3_kroia
null
t1_c2mp13v
t1_c2mowag
null
1427648961
2
t5_2fwo
null
null
null
True
[deleted]
null
Depends on your measure. If use the total area of a set of points that have a wrong colour, then you can meaningfully compare different finite resolutions, as being, say, "7% wrong" or "0.001% wrong". In fact, another even more natural thing is to compare pixel sizes. "Infinite" resolution means "0" sized pixels, with finite resolutions you can say that one with 0.01 by 0.01 pixels is four times closer to infinite resolution that one with 0.02 by 0.02 pixels.
null
0
1317052871
True
0
c2mp1eu
t3_krpem
null
t1_c2mp1eu
t1_c2mohkc
null
1427648966
1
t5_2fwo
null
null
null
True
diademoran
null
I'm new to the discussion. Quite a bit late as well.
null
0
1317052905
False
0
c2mp1k9
t3_kkp4z
null
t1_c2mp1k9
t1_c2mnr4n
null
1427648967
1
t5_2fwo
null
null
null
True
HaywoodMullendore
null
Trying to be funny, but .. no. And: http://www.uie.com/brainsparks/2011/09/14/do-users-change-their-settings/ "Less than 5% of the users we surveyed had changed any settings at all." So, yes, the default settings need to be pretty damn good.
null
0
1317052929
False
0
c2mp1p6
t3_krv1k
null
t1_c2mp1p6
t3_krv1k
null
1427648968
177
t5_2fwo
null
null
null
True
osirisx11
null
[[via r/ubuntu post](/comments/krwqb/)]
null
0
1317052964
False
0
c2mp1w3
t3_krx99
null
t1_c2mp1w3
t3_krx99
null
1427648971
1
t5_2fwo
null
null
null
True
grauenwolf
null
If you can test it with three lines of code you probably don't need to test it at all. Rather, you should be able to incorporate it into a larger test.
null
0
1317053115
False
0
c2mp2ps
t3_kq001
null
t1_c2mp2ps
t1_c2mlvb5
null
1427648983
1
t5_2fwo
null
null
null
True
kromagnon
null
I agree. I was just commenting on his statement of >This image , for instance, is far from infinite resolution.
null
0
1317053160
False
0
c2mp2ym
t3_krpem
null
t1_c2mp2ym
t1_c2mozpo
null
1427648987
8
t5_2fwo
null
null
null
True
Qw3rtyP0iuy
null
With feedback?
null
0
1317053235
False
0
c2mp3ch
t3_kqucu
null
t1_c2mp3ch
t1_c2mm06s
null
1427648992
1
t5_2fwo
null
null
null
True
gmiller123456
null
They likely only get people who are unemployed too. It's not very likely people just looking to explore options are willing to commit to quitting their current job if the new employer isn't willing to commit to hiring them.
null
0
1317053325
False
0
c2mp3v3
t3_kls47
null
t1_c2mp3v3
t1_c2lafle
null
1427648997
2
t5_2fwo
null
null
null
True
thesystemx
null
It seems to just work. I've run JBoss AS 6.0 on JDK 7 and everything worked. Basically everyone runs JBoss AS 5 (Java EE 5) on JDK 6. There have been some issues in the past, there was a version of JBoss AS that you couldn't run on JDK 6, but it's more implementation specific it seems than anything else.
null
0
1317053432
False
0
c2mp4fj
t3_krrz1
null
t1_c2mp4fj
t1_c2moj16
null
1427649009
5
t5_2fwo
null
null
null
True
nirolo
null
That question should be rephrased as "Do users change settings in an old version of MS Word" and considering what a confusing clusterfuck MS Word settings were (are?) I'm not surprised. http://marshallbrain.com/gif/word-options.gif That's not to say the defaults shouldn't be good, but removing them all isn't necessarily the way to go either. That said I agree with what they are saying about iCal and the Address Book in Lion. Those apps are incredibly annoying now and I want to get the Snow Leopard versions back.
null
0
1317053597
False
0
c2mp5bz
t3_krv1k
null
t1_c2mp5bz
t1_c2mp1p6
null
1427649016
98
t5_2fwo
null
null
null
True
noiserr
null
> while incorrect indentation may still be syntactically valid, but logically incorrect. How is this different from misplacing a bracket? And which one is easier to spot? A misplaced bracket, or a missindented piece of code. In Python you only worry about indentation, in other languages you worry about indentation and code block identifiers (more things to get wrong, less readability). Python also has one code block identifier (:) which helps editors determine the correct indentation in many cases.
null
0
1317053617
True
0
c2mp5fv
t3_krpem
null
t1_c2mp5fv
t1_c2mot9a
null
1427649018
4
t5_2fwo
null
null
null
True
StrangeWill
null
>If I write a 1000-line long Hello World program that's awful (impressively awful). Nope, that's just old C++ COM.
null
0
1317053689
False
0
c2mp5v4
t3_krklz
null
t1_c2mp5v4
t1_c2mmtvy
null
1427649023
4
t5_2fwo
null
null
null
True
inmatarian
null
I doubt that's the case. Here's what I figure a closure looks like (simplified): struct closure { struct function *func; struct environment *env; }; The func pointer would be the same for every instance (assuming the same function we're talkinging about) but the environment would have to be different for each one. When the function refers to variable X, it has to check the environment that goes with it to find X. If you look at the Lua 5.1 source code (http://www.lua.org/source/5.1/lobject.h.html ), this is exactly how they define closures. There is a separation between the Function byte code, and the Upvalues (the lexical environment).
null
0
1317053714
False
0
c2mp60n
t3_kroia
null
t1_c2mp60n
t1_c2mp13v
null
1427649025
6
t5_2fwo
null
null
null
True
Liquid_Fire
null
Python is less picky than you might think. It only cares about the indentation in the beginning of the line, and it doesn't even need to be consistent across a file, only across a "block" of indentation.
null
0
1317053905
False
0
c2mp73z
t3_krpem
null
t1_c2mp73z
t1_c2moj8s
null
1427649040
5
t5_2fwo
null
null
null
True
skilldrick
null
function outer(arg) { return function inner() { console.log(arg); }; } var x = outer('This is one function'); var y = outer('This is another function'); There are two closures created, and each has its own `inner`. The inner functions are *part* of the environment. **Edit:** `x` and `y` refer to the *same* function, but `x === y` returns `false`, because they're different objects with different memory locations.
null
0
1317053969
False
0
c2mp7f5
t3_kroia
null
t1_c2mp7f5
t1_c2mp60n
null
1427649045
1
t5_2fwo
null
null
null
True
lazyFer
null
Converting the fact model in the object role model to an entity relationship model will be optimally normalized if you've modeled your information properly. This works great for a lot of systems but selective denormalization is often required. Whenever you denormalize you need to keep in mind that the constraints **still** need to be enforced you just aren't doing it in the table structure any longer. Kind of like people using surrogate keys (which I'm a fan of) but then not bothering to define unique business keys as well.
null
0
1317054041
False
0
c2mp7q0
t3_kqucu
null
t1_c2mp7q0
t1_c2moj6z
null
1427649048
1
t5_2fwo
null
null
null
True
nascent
null
You do need an opening brace, that is what 'then' is. Lua's solution is exactly the same as always requiring braces.
null
0
1317054125
False
0
c2mp86o
t3_kooiy
null
t1_c2mp86o
t1_c2mozfl
null
1427649054
3
t5_2fwo
null
null
null
True
[deleted]
null
Closures are the poor man's objects.
null
0
1317054142
False
0
c2mp8aa
t3_kroia
null
t1_c2mp8aa
t1_c2mnu73
null
1427649056
18
t5_2fwo
null
null
null
True
mkawick
null
Hiding complexity is the point of OOP and function deconstruction. Otherwise... just put all the code into a single function otherwise. This is a good thing removing the amount that a person has to keep on his/her internal 'stack' while working on a problem.
null
0
1317054545
False
0
c2mpair
t3_krklz
null
t1_c2mpair
t1_c2mmtvy
null
1427649084
1
t5_2fwo
null
null
null
True
grauenwolf
null
> It’s pretty much only available on the one platform (yes, Mono, but really – are you going to pitch your project as running under Mono on Linux?) This kind of thing annoys me to no end. I know plenty of people who are running Mono on Linux servers for production work.
null
0
1317054583
False
0
c2mpaq4
t3_krodl
null
t1_c2mpaq4
t3_krodl
null
1427649086
1
t5_2fwo
null
null
null
True
codingcanary
null
What makes you say to start with something like scheme instead of Haskell? I'm not saying you're wrong, I have no idea - I was introduced to Haskell through my degree course, and just wondered if there was a specific reason for it.
null
0
1317054650
False
0
c2mpb2p
t3_kp6d6
null
t1_c2mpb2p
t1_c2m6d6h
null
1427649092
1
t5_2fwo
null
null
null
True
kromagnon
null
>Depends on your measure. If use the total area of a set of points that have a wrong colour, then you can meaningfully compare different finite resolutions, as being, say, "7% wrong" or "0.001% wrong" But, you can't do this. You would have to be able to resolve infinitely to get a correct "%wrong", and we aren't talking about which one is "better", one is clearly better. But they are still the same distance to infinity. >0.01 by 0.01 pixels is four times closer to infinite resolution that one with 0.02 by 0.02 pixels. I'm pretty sure it doesn't work like that. We can all agree that .01 is smaller than .02 , but they are both the same distance from infinity
null
0
1317054659
False
0
c2mpb44
t3_krpem
null
t1_c2mpb44
t1_c2mp1eu
null
1427649092
3
t5_2fwo
null
null
null
True
inmatarian
null
No, I get that. The 1st class function object is different. The languages define it as such. I'm saying that when the function is first compiled (either into an AST, or Byte-code, etc) that the parsing only occurs once. That section of the tree (or string of code) is only created once. But every time you run "Outer" in your example, a new environment is created for "inner" at the function keyword. The same byte code is used. I'm using the Lua VM as my reference. They must do it differently in the Javascript implementations. I can't imagine that they don't split the bytecode from the environment, as javascript is primarily about responding to events and that would be the first area for optimization. In Lua, the byte code for a function is called a "Chunk" and they don't duplicate chunks for functions. They're also very clear about the split between the chunk and the upvalue, as the C api can define closures as well, using a C function (which obviously can't be duplicated by the lua VM), but can create as many environments that it wants, and the every time the closure is called, the same C code is ran, but that C code has to check the environment first before doing what it does. If you want to learn more, read [A No Frills Introduction To Lua 5.1 VM Instructions](http://luaforge.net/docman/index.php?group_id=83&selected_doc_group_id=102&language_id=1).
null
0
1317054874
False
0
c2mpcdc
t3_kroia
null
t1_c2mpcdc
t1_c2mp7f5
null
1427649114
3
t5_2fwo
null
null
null
True
grauenwolf
null
Real conversation I had last week: Dev: If we were using AOP injection on this project we could use it to log how long these service calls are taking. Me: I added logging when you were on vacation. It took two lines of code. I have yet to see an example of aspect orientated programming in C# that was actually necessary. Using a combination of attributes and standard techniques always seems to do the job quite nicely.
null
0
1317054888
True
0
c2mpcfv
t3_krodl
null
t1_c2mpcfv
t1_c2mncxr
null
1427649114
0
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1317055084
True
0
c2mpdjv
t3_krv1k
null
t1_c2mpdjv
t3_krv1k
null
1427649125
152
t5_2fwo
null
null
null
True
ash_gti
null
You can have private variables inside an object that are only accessible from within the object. [Douglas Crockford](http://javascript.crockford.com/private.html) has talked about it on his blog before. If you use objects right they are just as secure as closures. I can't remember the original performance benchmark I saw, but [jsperf](http://jsperf.com/prototype-vs-object-literal) has some benchmarks for Chrome, and in most cases using the "new" operator faster than creating an object literal. Edit: my bad, misspelled his name... ugh need more coffee...
null
0
1317055087
True
0
c2mpdkd
t3_kroia
null
t1_c2mpdkd
t3_kroia
null
1427649125
1
t5_2fwo
null
null
null
True
frezik
null
Once logic becomes complicated, so do the tests. It's easier to extend an existing test into more complicated situations than it is to start writing a complicated test from scratch.
null
0
1317055325
False
0
c2mpew1
t3_kq001
null
t1_c2mpew1
t1_c2mboch
null
1427649141
2
t5_2fwo
null
null
null
True
skilldrick
null
Ok, I get what you're saying. We just have different definitions of 'function' and 'copy'. Tbh I have no idea if JavaScript will create a completely new object each time a function definition is encountered, or if it will cache the bytecode. I imagine it's implementation-dependent.
null
0
1317055332
False
0
c2mpexp
t3_kroia
null
t1_c2mpexp
t1_c2mpcdc
null
1427649142
2
t5_2fwo
null
null
null
True
jadero
null
Okay, fair enough. I can see that there might be enough bad work ethic out there to make people think that those with good work ethic are somehow passionate about their work. My own work ethic is much improved from what it was in my youth. That said, I still leave most days in time to have supper well on the way by the time my wife gets home and I try to leave the job at work. Programming is not my only interest and I have no desire to fill my day completely with other people's tasks.
null
0
1317055399
False
0
c2mpfc9
t3_korcu
null
t1_c2mpfc9
t1_c2mmp4e
null
1427649147
1
t5_2fwo
null
null
null
True
grauenwolf
null
Well the nastier things like IDispatch and apartments seem to be going away.
null
0
1317055410
False
0
c2mpfe8
t3_krouy
null
t1_c2mpfe8
t1_c2moeau
null
1427649148
2
t5_2fwo
null
null
null
True
ryeguy
null
How do you figure? A test for a simple getter/setter (ie, just directly setting/getting the variable) might as well be barebones.
null
0
1317055446
False
0
c2mpfll
t3_kq001
null
t1_c2mpfll
t1_c2mpew1
null
1427649151
0
t5_2fwo
null
null
null
True
munificent
null
> lots of identical functions being created. Except they *aren't* identical: each is closing over a different lexical scope.
null
0
1317055577
False
0
c2mpgdq
t3_kroia
null
t1_c2mpgdq
t1_c2mnqc6
null
1427649163
8
t5_2fwo
null
null
null
True
andrew-d
null
Fixed, thanks!
null
0
1317055650
False
0
c2mpgtb
t3_krd8f
null
t1_c2mpgtb
t1_c2moig5
null
1427649167
1
t5_2fwo
null
null
null
True
munificent
null
> Tbh I have no idea if JavaScript will create a completely new object each time a function definition is encountered, or if it will cache the bytecode. V8 has no bytecode at all. It's a pure JIT. When it wants to hang onto the uncompiled form of a function, it stores a pointer to the actual source text of it.
null
0
1317055678
False
0
c2mpgz0
t3_kroia
null
t1_c2mpgz0
t1_c2mpexp
null
1427649169
3
t5_2fwo
null
null
null
True
andrew-d
null
If you #define CPPLOG_NO_THREADING and CPPLOG_NO_SYSTEM_IDS, it doesn't depend on Boost any more - though you lose the ability to track process/thread IDs and the use of BackgroundLogger.
null
0
1317055729
False
0
c2mph9c
t3_krd8f
null
t1_c2mph9c
t1_c2mmvvw
null
1427649173
1
t5_2fwo
null
null
null
True
munificent
null
> If you use objects right they are just as secure as closures. In Crockford's post, you can see is in fact using closures for privacy.
null
0
1317055822
False
0
c2mpht9
t3_kroia
null
t1_c2mpht9
t1_c2mpdkd
null
1427649180
7
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1317056046
False
0
c2mpj3x
t3_kroia
null
t1_c2mpj3x
t1_c2mpdkd
null
1427649197
1
t5_2fwo
null
null
null
True
frezik
null
I'll put aside the argument of getter/setters being a good idea or not. Suffice it to say, they usually (but not always) indicate a design problem. You write the tests for those trivial examples, anyway, because things *might* be more complicated in the future, and properly regression testing those cases is important. Code external to the given class is not supposed to know if those methods are trivial or not, so your test code can't assume they are.
null
0
1317056094
False
0
c2mpjdv
t3_kq001
null
t1_c2mpjdv
t1_c2mpfll
null
1427649200
2
t5_2fwo
null
null
null
True
stun
null
So now everyone agrees that **Size DOES matter !!**
null
0
1317056117
False
0
c2mpjj0
t3_krklz
null
t1_c2mpjj0
t3_krklz
null
1427649202
2
t5_2fwo
null
null
null
True
pnpbios
null
> Just to be clear I’m doing this to learn how WinRT really works. I would NOT normally write a C++ WinRT application this way.
null
0
1317056119
False
0
c2mpjjk
t3_krouy
null
t1_c2mpjjk
t3_krouy
null
1427649202
2
t5_2fwo
null
null
null
True
skilldrick
null
You *can not* have privacy in JavaScript without closures. As Crockford said in that post: > This pattern of public, private, and privileged members is possible because JavaScript has *closures*.
null
0
1317056161
False
0
c2mpjrp
t3_kroia
null
t1_c2mpjrp
t1_c2mpdkd
null
1427649206
4
t5_2fwo
null
null
null
True
spirit_of_radio
null
> Spend time with users? Who has time for that? Developers certainly don't, because it's not (generally) their jobs. Who does have time for it? The UX folks, because that is (or should be) their job. Dick, in this story, is a Designer. Not a Usability Analyst. A designer's job is about visual appeal. A Usability Analyst's job is about understanding the users. This user understanding needs to be fed to the Designer and the Developers (and managers and Product Managers...) before they do their work. Sometimes these two roles manifest themselves in the same person - that's a truly talented UXer. But any designer who tries to design without first spending a lot of time understanding users, is just being a Dick.
null
0
1317056203
False
0
c2mpk0d
t3_krv1k
null
t1_c2mpk0d
t1_c2mpdjv
null
1427649209
115
t5_2fwo
null
null
null
True
jazzyjaffa
null
Have you actually used it? I had the same thoughts before I used python properly. It turns out that I have less cognitive load if I don't have to think about {}'s AND indentation. The amount of times an error is due to mistakes in indentation is very low, and if you have lots of indentation then your code is not well factored and should be flattened anyway.
null
0
1317056374
False
0
c2mpl15
t3_krpem
null
t1_c2mpl15
t1_c2mnysf
null
1427649222
2
t5_2fwo
null
null
null
True
ash_gti
null
Yes, exactly, objects and closures are not separate things in javascript. They compliment each other and each have different use cases. The real difference your post is highlighting is different object syntaxes. Object literals vs Prototype based objects.
null
0
1317056410
False
0
c2mpl8q
t3_kroia
null
t1_c2mpl8q
t1_c2mpjrp
null
1427649226
0
t5_2fwo
null
null
null
True
jazzyjaffa
null
Have you actually tried to use it for an actual project? I had the same thoughts as you before I did, but now prefer it.
null
0
1317056442
False
0
c2mplej
t3_krpem
null
t1_c2mplej
t1_c2mowyz
null
1427649227
3
t5_2fwo
null
null
null
True
rush22
null
Product design
null
0
1317056563
False
0
c2mpm0h
t3_kq001
null
t1_c2mpm0h
t1_c2ma7a5
null
1427649236
1
t5_2fwo
null
null
null
True
OMouse
null
>Since many of you probably agree, let's figure out how to fix those problems so this metric can be used intelligently. How about *don't use the metric at all*? That would work, I mean mathematicians, artists, scientists, engineers don't use some random metric in their lines of work.
null
0
1317056609
False
0
c2mpm8j
t3_krklz
null
t1_c2mpm8j
t1_c2mmtvy
null
1427649239
1
t5_2fwo
null
null
null
True
[deleted]
null
And no one gives a fuck about Racket.
null
0
1317056706
False
0
c2mpmps
t3_kri4f
null
t1_c2mpmps
t3_kri4f
null
1427649245
-3
t5_2fwo
null
null
null
True
super__mario
null
This would be funny if that weren't exactly what Apple had done with OS X calendar and address book applications in Lion:D.
null
0
1317056718
False
0
c2mpmsa
t3_krv1k
null
t1_c2mpmsa
t3_krv1k
null
1427649245
5
t5_2fwo
null
null
null
True
skilldrick
null
Ummm, no, it's not at all. I mention that there are different ways of creating objects, but most of the post is highlighting the difference between objects made with literals or prototypes and closures.
null
0
1317056783
False
0
c2mpn3k
t3_kroia
null
t1_c2mpn3k
t1_c2mpl8q
null
1427649250
4
t5_2fwo
null
null
null
True
OMouse
null
Fuck management. How about that? :D
null
0
1317056826
False
0
c2mpnbn
t3_krklz
null
t1_c2mpnbn
t1_c2moa7g
null
1427649252
2
t5_2fwo
null
null
null
True
iTroll
null
Any chance we can get a non-obfuscated version?
null
0
1317056827
False
0
c2mpnbz
t3_krpem
null
t1_c2mpnbz
t1_c2mobyr
null
1427649252
78
t5_2fwo
null
null
null
True
nascent
null
> But I didn't need a reference type in the beginning. That's exactly the problem. Let me try this again, the problem you had in your example, and the issue you have with D's struct vs classes is not resolved by the solution you describe. It stems from switching from value types to reference types, and if value type classes had a switch to turn them into reference types, the result would be the same. > What if I want to use ref-counting with classes? Why would you? And you can, custom allocators will be supported, which to my understanding can be implemented using ref-counting. > What if I want my structs to be garbage collected? It is auto ms = new MyStruct(); will be collected when all references to it no longer exist. > You see, there is no real difference between structs and classes. There is no real difference between a for loop and a while, foreach and until, a jmp and a if, an array and a linked list, an array and a struct. Or a table and a chair. You can bring everything down to a basic level then leaves differences to syntactic sugar. D has choose that struct and class are different, and so they are. To continue to argue this is an issue without present actual issues is of no benefit to your self or the design of the language.
null
0
1317056870
False
0
c2mpnkc
t3_kljc0
null
t1_c2mpnkc
t1_c2mnkqn
null
1427649256
1
t5_2fwo
null
null
null