Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
floWenoL
Oct 23, 2002

Parantumaton posted:

I'd say it has happened only like twice or thrice during my time at the company (15 months and counting) when we had to temporarily roll back a feature, replace it with a production-specific fix, commit that, retag the fix, rebuild the software, deploy and then re-add the new/improved feature.

When you say "roll back a feature" do you mean "roll back the current feature in progress" or "roll back all features since the release with the production bug"?

Adbot
ADBOT LOVES YOU

floWenoL
Oct 23, 2002

Parantumaton posted:

Current feature in progress, our unit tests and modularity of systems allow us to rollback only the relevant parts.

What I'm asking is that if you push out a production fix, do you also push out all completed features since the last release?

floWenoL
Oct 23, 2002

Bhaal posted:

I coulda swore "offset[index]" was simply treated as referencing the address at "offset + index*element_size". So the trick only worked for data types the compiler was rounding off to whatever the platform was using for a byte.

After messing around on codepad it seems to handle any data type just fine.

What C data type (other than bitfields) are addressed in units smaller than a byte?

floWenoL
Oct 23, 2002

Avenging Dentist posted:

I shudder to think of how you program C.

EDIT: Oh by the way, your understanding of classical logic w.r.t. proof is adorable.

Maybe Zombywuf studied classical logic at the same time he studied probability theory.

floWenoL
Oct 23, 2002

geetee posted:

It's not a flaw. It's a potential vulnerability if not used carefully.

Does gtbot shell out like this?

floWenoL
Oct 23, 2002

clockwork automaton posted:

Heard from an undergrad discussing the decompiling of a professors class files: "I don't wanna steal his code and turn it in. I just want to look at the comments to get a better idea how to code it."

Honestly if I were a professor and I found out my student went through the effort of decompiling my reference program and then rewriting it sensibly in the original language, I'd let it go because he probably did learn whatever he was supposed to, and then some.

floWenoL
Oct 23, 2002

Flobbster posted:

Eh, it depends. If a student manually inspected bytecode or assembly language code and rewrote it in the original language, then yes, I'd be impressed by that and would congratulate the student instead of punishing them. But if he's just running Jad or Reflector.NET, those generate reasonable enough code automatically that it's not worthy of any kind of praise.

Good point. I'm actually not familiar with the state of decompilers for languages like Java/C#. How readable does "reasonable" look? Are variable names preserved?

floWenoL
Oct 23, 2002

Trabisnikof posted:

As yes, Secondary Damage is caused by a Fandango on core. Duh.

Haha, yes. I wouldn't take terminology advice from ESR, personally.

floWenoL
Oct 23, 2002

HFX posted:

Just that many languages such as C / Java are utterly terrible about making you constantly declare a rather low level when it would be better off to give you something high level and then have a low level if you need it.

maybe you don't 'get' languages that are meant for performance.

floWenoL
Oct 23, 2002

chocojosh posted:

So this is such a bad varation of the for-switch that once it matches either "mail", "facsimiletelephonenumber", or "telephonenumber" it's going to exit the loop.

I love it when coding horrors spawn even more coding horrors, like this sentence.

floWenoL
Oct 23, 2002

chocojosh posted:

I had a brain fart about how break works. Other stuff was on my mind.

Sorry about your girlfriend, mang.

floWenoL
Oct 23, 2002

ErIog posted:

I understood it this way too. I'm chalking the ensuing clusterfuck up to people wanting to feel smart, and not reading what he actually wrote.

God forbid anyone point out coding horrors in the coding horror thread!

floWenoL
Oct 23, 2002

sund posted:


code:
double degreesToRadians(double degrees){
	return degrees/180*PI;
}

double radiansToDegrees(double radians){
	return 180/PI*radians;
}
poo poo yeah, abstract away this insane complexity.

Blue Footed Booby posted:

Even ignoring what's in the standard library (I don't know poo poo about C++ either) he managed to make the function name by itself more characters than doing it the "hard" way instead of just calling it "toRads" or something. :smithfrog:

I love it when people try to post coding "horrors" and it backfires.

I think embedding *180/PI or /180*PI (or /PI/180 or *PI/180) everywhere is more of a coding horror than the cited code, which isn't a horror at all.

floWenoL
Oct 23, 2002

Ryouga Inverse posted:

Depends. If he's talking about stuff like int i = 2 + MAX_FOO; and MAX_FOO is just defined as 4 or something, then yeah, the compiler does those

at least that's what I'd assume he was saying

all math boils down to constant propagation

floWenoL
Oct 23, 2002

BigRedDot posted:

from here, there are naught but coding horrors.

A gtk horror, from the Chromium valgrind suppressions file:

code:
{
   gtk developers don't like cleaning up one-time leaks.  See [url]http://mail.gnome.org/archives/gtk-devel-list/2004-April/msg00230.html[/url]
   Memcheck:Leak
   ...
   fun:gtk_init_check
}

floWenoL
Oct 23, 2002

Crazy RRRussian posted:

I believe specification for string says they must be null terminated. Thus they could not use COW unless const [] operator does checks, which would make it slow. Also in my experience the standard STL implementation (whatever comes with Ubumtu) could not be doing COW because substr seems to be a heavy operation in them even if retrieved substring is never modified. Same with STL implementation on windows. This is coming from optimizing cpp prograns on both linux and windows to avoid using substr operation and this always resulting in nice speed up.

This paragraph is the real coding horror.

floWenoL
Oct 23, 2002

Crazy RRRussian posted:

Why?

Because almost every sentence has an error?

floWenoL
Oct 23, 2002

tractor fanatic posted:

Also, I think by "space-time" he meant that the time complexity would have a factor at least a linear multiple of the space complexity, so that space complexity would create time complexity as well.

This thread never fails to deliver.

floWenoL
Oct 23, 2002

Otto Skorzeny posted:

I know you know better than to cast the return value of malloc in C!

It's necessary in this case because he's doing arithmetic with the return value.

floWenoL
Oct 23, 2002

TerminX posted:

In VS2010, you get a red squiggle under the = in the assignment if you don't do this.

It actually goes as far as to tell you things like "Error: a value of type 'void *' cannot be assigned to an entity of type 'intptr_t *'".

It's quite possibly the most pedantic thing I have ever seen.

That's probably because it's interpreting it at C++.

floWenoL
Oct 23, 2002

yaoi prophet posted:

Oh god, it's like some horrible hosed-up LISP.

The icing on the cake is the unreadable dark-on-black color scheme they use for their code snippets.

floWenoL
Oct 23, 2002

Extreme negative code documentation.

quote:

The idea of Extreme Negative Code Documentation (ENCD), is that for every line in your code, write a comment explaining what would be wrong with the code if that line was missing.

code:
    # initialise with un-initialised entries
    #N Without initialize, @entries required for getEntries won't be initialised
    def initialize
      #N If we don't pre-set @entries to nil, we won't know that we haven't yet initialised that value
      @entries = nil
    end

floWenoL
Oct 23, 2002

Dicky B posted:

Non c++ programmers talking about c++ :allears:

This level of ignorance about C++ is yet another coding horror.

floWenoL
Oct 23, 2002

Steampunk Hitler posted:

If you break up your methods into small logical pieces, it's normally not _that_ hard to test all the code paths for each small piece. I mean that's basically unit testing. If you have to have 100% code coverage on every code path that the app could possibly take then I don't know what the gently caress.

SQLite claims to have 100% branch coverage. :3:

floWenoL
Oct 23, 2002

PalmTreeFun posted:

At least in C++ you have to specify passes by reference. In Java it's totally arbitrary depending on whether the thing in question is a basic type or an object.

This statement is a coding horror. (Or a pretty good troll.)

floWenoL
Oct 23, 2002

Kelson posted:

CTZ is absolutely correct. Just to add a bit practically though, with x86 C/C++ dereferencing the NULL pointer is the same as dereferencing address 0x0. This is typically an invalid address, which causes JewKiller's seg fault. One can map memory to the NULL page in Windows however, which makes address 0 "valid."

Good exploitation vector.

Even if the page containing 0x0 is invalid, dereferencing an invalid pointer can still do other things besides crash. Consider:

code:
// non-static
void MyClass::Foo() {
  std::cout << "blah";
}
((MyClass *)0)->Foo() will (probably) still work. On a more practical note, the function may end up calling other functions on member variables, so if that member variable offset is large enough, you could end up dereferencing a valid address.

So, yeah, undefined behavior is undefined.

floWenoL
Oct 23, 2002

From Die EmacsWiki, Die!:

quote:

Some of the features of the wiki are simply abhorring - like the lack of user access control; anyone can enter any user name and edit the wiki… Yep, this is not a joke…

...

As crazy as it seems a lot of people are using the wiki as a software distribution mechanism. Instead of hosting their projects in version control (say GitHub) they develop stuff locally, upload them to the wiki and say that this is the canonical way to obtain their software. Needless to say - this is a horrible, horrible practice. I’ve often encountered on the wiki source files authored by someone, then edited by 10 different guys, that have a tendency to add their names to the copyrights sections instead of thinking how their poor users will understand what exactly was changed in these files. Sometimes the authors themselves are to blame (for being loving lazy), but often someone just copies a snapshot of a project from version control and uploads it to the wiki, creating problems of epic proportions for the maintainers, who start receiving bugs about stuff they never developed in the first place.

...

Tools like audo-install (an extension that supports installing software from EmacsWiki) should never have existed. el-get should not have added support for the installation of stuff from the wiki. As long as such practices are tolerated they will not stop.

Today I learned I can backdoor Emacs users just by editing an unauthenticated Wiki!

floWenoL
Oct 23, 2002

In today's edition on how not to launch a product:

http://nikcub.appspot.com/posts/yahoo-axis-chrome-extension-leaks-private-certificate-file

floWenoL
Oct 23, 2002

Why not just spawn n instances of 'yes > /dev/null'?

floWenoL
Oct 23, 2002

Edit: Ugh, never mind, the coding horror is me.

floWenoL fucked around with this message at 18:40 on Apr 27, 2013

floWenoL
Oct 23, 2002

hobbesmaster posted:

You can do something graceful with most (almost?) all failed malloc calls.

Another coding horror found.

floWenoL
Oct 23, 2002

hobbesmaster posted:

How in the world do you think those custom "Oh no the program crashed!" handlers show up?

I'm not sure what you're referring to, but code paths to handle failed malloc calls are rarely exercised and frequently lead to your program being in a weird state. Since failed malloc calls are rarely actually related to low-memory conditions (in desktop applications) it seems preferable to crash so that the problem can be found and fixed.

floWenoL
Oct 23, 2002

DAT NIGGA HOW posted:

If this guy knows so much about cryptography why doesn't he put his talents towards something positive, like, say, creating his own cyptocat that does cryptography correctly? Why waste so much time doing something so non constructive?

Exposing the flaws of a well-publicized "cryptosystem" so that people know to avoid relying on it seems constructive to me.

floWenoL
Oct 23, 2002

DAT NIGGA HOW posted:

If this guy is as smart about crypography as he makes himself out to be with his tone in the article, they why is he spending his time writing blog posts? Why should I trust this guy's assessment at all? Maybe if he had an alternative that other experts can either agree is done right, then I'll listen to him. Otherwise its just blogspam.

Crypography is the kind of thing where if you understand the concepts, building a cryptocat site is trivial. If you don't understand the concepts, then cryptography is hard.

Just writing a blogpost saying "the devs of cryptocat are idiots that don't understand anything about crypography dont use it". OK... gee thanks for the tip random internet stranger. It just kinda reeks of monday morning quarterbacking to me...

It's you. You're the coding horror.

floWenoL
Oct 23, 2002

csammis posted:

shruges posts don't have enough commas to be teapot posts

btw guys, I'm yegge.

Edit:
Man, I completely forgot the whole nbv4/how!! thing. I'm getting old.

floWenoL fucked around with this message at 20:53 on Jul 7, 2013

Adbot
ADBOT LOVES YOU

floWenoL
Oct 23, 2002

PrBacterio posted:

All configuration files should come in the form of SQLite databases instead of some type of plain-text format :colbert:

Coding horror detected.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply