|
Illusive gently caress Man posted:Tbqh there is no 'prod' because this is kind of a proof of concept project. it's a 4 person team and when it works someone just tags the commit 'it works' but the plan is somehow that we will be able to demonstrate and let people use this in a few months? Jenkins is actually shockingly easy to set up. A year ago, the .deb set it up as a service automatically, so you just needed to point it to your repo and let it go. Anyway, unless people are checking in things that break the build, or you have a suite of tests, Jenkins won't help much. You need a code review service which you can post your patches to and have people on your team comment on them and demand stuff get fixed before submission. Even if you're all coding übermensch, it helps catch dumb typos and such.
|
# ? Nov 14, 2014 13:46 |
|
|
# ? Jun 8, 2024 05:45 |
|
Volmarias posted:Jenkins is actually shockingly easy to set up. A year ago, the .deb set it up as a service automatically, so you just needed to point it to your repo and let it go. We're currently trying to implement a code review process such as this. Can you suggest any software which allows us to do this, and preferably integrates with Subversion. We're currently evaulating ReviewBoard, but I was wondering if there are any other software solutions people can recommend?
|
# ? Nov 14, 2014 14:09 |
|
StorrowS posted:We're currently trying to implement a code review process such as this. Can you suggest any software which allows us to do this, and preferably integrates with Subversion. We're currently evaulating ReviewBoard, but I was wondering if there are any other software solutions people can recommend? We use http://phabricator.org/ at work, it's pretty great.
|
# ? Nov 14, 2014 14:33 |
|
Subjunctive posted:We use http://phabricator.org/ at work, it's pretty great. Phabricator includes applications for: reviewing and auditing code; hosting Git/Hg/SVN repositories; browsing repositories; tracking bugs or "features"; hiding stuff from coworkers; and also some other things, like meme generators.
|
# ? Nov 14, 2014 15:43 |
|
Animated GIFs in review comments are a nice touch.
|
# ? Nov 14, 2014 16:14 |
|
dwazegek posted:A colleague of mine does something similar. He'll first outline the different steps a method has to do in comments, then write the code. Which, in general is fine, except he leaves all the comments in, and never adds any actually useful comments. So all his code looks like this: And its always these guys who have code:
edit: actually my dude is a different type. Your dude just needs to keep his psude-code more abstract and start coding a little earlair. He might end up with code:
bpower fucked around with this message at 17:53 on Nov 14, 2014 |
# ? Nov 14, 2014 17:48 |
|
Subjunctive posted:Looks like an early-out optimization to avoid a function call to strcmp in the presumably-common case where first chars differ. Usually means "strcmp prolog/epilog showed up in a profile once" (possibly on a previous project, and is carried forward superstitiously). The real horror is using strcmp instead of strncmp.
|
# ? Nov 14, 2014 18:00 |
|
.
Xenoveritas fucked around with this message at 18:12 on Nov 14, 2014 |
# ? Nov 14, 2014 18:05 |
|
ratbert90 posted:The real horror is using strcmp instead of strncmp. There's nothing wrong with using strcmp and it's the right thing to use here because you've got two null-terminated strings you're comparing. (Just because strncpy is better than strcpy, that doesn't mean every C string function should use the "n" version.)
|
# ? Nov 14, 2014 18:23 |
|
sarehu posted:There's nothing wrong with using strcmp and it's the right thing to use here because you've got two null-terminated strings you're comparing. strncpy is definitely not better than strcpy, but you're right that slavishly strncmping is silly. Those are C strings, strcmp works on C strings, and strncmp would mean that a prefix would be considered equal. (strncpy is a horror, definitely.)
|
# ? Nov 14, 2014 18:34 |
|
Subjunctive posted:strncpy is definitely not better than strcpy, but you're right that slavishly strncmping is silly. Those are C strings, strcmp works on C strings, and strncmp would mean that a prefix would be considered equal. What? Strncmp compares up to n bytes of two strings. Usually used in conjunction with the size of the first or second string so that way if the null does get dropped for some reason you don't start trolling around memory you ought not to.
|
# ? Nov 14, 2014 18:48 |
|
ratbert90 posted:What? Strncmp compares up to n bytes of two strings. Usually used in conjunction with the size of the first or second string so that way if the null does get dropped for some reason you don't start trolling around memory you ought not to. if the null gets dropped for some reason, that's probably a really bad bug that should be fixed and it's probably gonna wreck something somewhere anyway. The only way strncmp makes sense is if A. you don't want to compare the entire string (a prefix or something). B. you know for certain that neither string will actually be longer than N AND that neither string will occupy an piece of memory allocated smaller than N. It's not really that common for B to be true unless all your strings are stored in fixed size arrays.
|
# ? Nov 14, 2014 19:14 |
|
Illusive gently caress Man posted:if the null gets dropped for some reason, that's probably a really bad bug that should be fixed and it's probably gonna wreck something somewhere anyway. Never underestimate people not zeroing out memory or conditioning their code. Unless it's your code and you know for certain it will be conditioned prior to getting to the compare.
|
# ? Nov 14, 2014 19:17 |
|
Zeroing out memory doesn't tend to eliminate NULs? In fact you *have* to zero out the target buffer for strncpy to be safe. (Otherwise it's a great way to end up with the non-terminated case, because it was designed for mucking with Unix directory structures, not as a general tool for C strings.) How do you determine n? It needs to be the length of the longest string to have the same semantics as strcmp. If you're using C strings one uses strlen, but...
|
# ? Nov 14, 2014 19:30 |
|
ratbert90 posted:Never underestimate people not zeroing out memory or conditioning their code. Unless it's your code and you know for certain it will be conditioned prior to getting to the compare. If you're comparing a string that isn't null terminated, how do you know what the N should be for strncmp? If it's always in an N size buffer and you're comparing to a constant shorter than N or something, sure, strncmp works. You're likely still going to have a serious bug if that string is used after the strncmp though. There isn't much you can safely do with a non-null terminated string without knowing the length of the string.
|
# ? Nov 14, 2014 19:31 |
|
This is why all of my strings are in arrays. Mallocs are for people with fancy things like "heaps".
|
# ? Nov 14, 2014 19:33 |
|
EDIT: Dead Horse
|
# ? Nov 14, 2014 19:34 |
|
I stand corrected. Thank you for that.
|
# ? Nov 14, 2014 19:35 |
|
Subjunctive posted:strncpy is definitely not better than strcpy, Oh right. Oh god no. Well, I wouldn't know because I don't use them!
|
# ? Nov 14, 2014 20:18 |
|
Imagine a Python library where the API is constructed like this:code:
|
# ? Nov 15, 2014 00:33 |
|
I wish I could only imagine a single library like that.
|
# ? Nov 15, 2014 02:05 |
|
I see a lot of that in Enterprise code, it takes ages to trace down what anything is actually doing.
|
# ? Nov 15, 2014 02:36 |
|
What's frustrating about this is that most of the real work gets done by passing stuff through the kwargs, but because it's not documented, you'd never know what you're supposed to send in.
|
# ? Nov 15, 2014 03:14 |
|
That's entry level code obfuscation in python. Oh, did I say entry I meant enterprise.
|
# ? Nov 16, 2014 22:57 |
|
ratbert90 posted:This is why all of my strings are in arrays. Mallocs are for people with fancy things like "heaps". Embedded programming for fun and profit. Sometimes I miss it, but then I remember all the headaches.
|
# ? Nov 17, 2014 20:40 |
|
HFX posted:Embedded programming for fun and profit. Embedded programming is fun until you're burning code onto one off ROMs. Then it's just stress.
|
# ? Nov 17, 2014 21:00 |
|
Karate Bastard posted:That's entry level code obfuscation in python. Oh, did I say entry I meant enterprise. Look man, it's not the enterprises' faults if they don't want to pay enough to attract more than entry-level talent. Oh wait.
|
# ? Nov 17, 2014 21:50 |
|
Che Delilas posted:Look man, it's not the enterprises' faults if they don't want to pay enough to attract more than entry-level talent. I don't think you get the enterprise. The whole "gotta pay big money or you'll get lovely people" principle only applies to executives. Regular employees don't care about the money, they just want secure jobs with good benefits so the executives can save even more money when they outsource them, and get an even fatter bonus
|
# ? Nov 18, 2014 01:54 |
|
Soricidus posted:I don't think you get the enterprise. The whole "gotta pay big money or you'll get lovely people" principle only applies to executives. Regular employees don't care about the money, they just want secure jobs with good benefits so the executives can save even more money when they outsource them, and get an even fatter bonus The people who don't care about being paid a fair market value for their skills are almost always lovely; the reason they don't care is because they're just grateful that they were able to convince someone to hire them.
|
# ? Nov 18, 2014 03:42 |
|
Subjunctive posted:Looks like an early-out optimization to avoid a function call to strcmp in the presumably-common case where first chars differ. Usually means "strcmp prolog/epilog showed up in a profile once" (possibly on a previous project, and is carried forward superstitiously). Then someone goes in and increments the pointers you feed to strcmp - because hey, we already KNOW the first characters are the same! Years down the line an empty string appears on a page boundary and boom...
|
# ? Nov 18, 2014 09:00 |
|
Ithaqua posted:The people who don't care about being paid a fair market value for their skills are almost always lovely You know that. I know that. The people who make hiring decisions for enterprise software development apparently don't.
|
# ? Nov 18, 2014 09:48 |
|
Heavy_D posted:Then someone goes in and increments the pointers you feed to strcmp - because hey, we already KNOW the first characters are the same! Years down the line an empty string appears on a page boundary and boom... Yes, you can introduce bugs into code.
|
# ? Nov 18, 2014 14:39 |
|
Heavy_D posted:Then someone goes in and increments the pointers you feed to strcmp - because hey, we already KNOW the first characters are the same! Years down the line an empty string appears on a page boundary and boom... That would be fine if the table of strings being searched will never contain an empty string. If not, then someone made an obviously invalid change. Hurrah.
|
# ? Nov 18, 2014 17:42 |
|
Don't worry, not arguing the original is wrong, just re-living past errors...
|
# ? Nov 18, 2014 19:33 |
|
535 ways to reload the page with JavaScript
|
# ? Nov 18, 2014 21:07 |
Hard to take that seriously when I only got to #7 and they're already reusing the same stuff just written differently. Hell #3 is the same as #1 if you consider scope.
|
|
# ? Nov 18, 2014 21:10 |
|
View Source on the page. It's generated with JavaScript, so yes, a lot of them are basically "there are a ton of different ways of accessing the same property in JavaScript." Although considering they're going that way, they might as well go all the way down the rabbit hole and start counting: JavaScript code:
|
# ? Nov 18, 2014 21:37 |
|
What is the reasoning behind:JavaScript code:
JavaScript code:
|
# ? Nov 18, 2014 21:56 |
|
Mogomra posted:What is the reasoning behind: someObject['name' + i] and someObject[anotherVariable].
|
# ? Nov 18, 2014 22:02 |
|
|
# ? Jun 8, 2024 05:45 |
|
KARMA! posted:someObject['name' + i] and someObject[anotherVariable]. Also someObject['!+#%'] works but someObject.!+#% will definitely not.
|
# ? Nov 18, 2014 22:52 |