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
Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

tef posted:

similarly old editors like vi and emacs being popular show that we haven't really progressed in terms of interface either.

Not really. Newer software is easier to get up to speed on. Some may argue that nothing new is as fast to edit in as vi or emacs, but that's arguable and besides, it's a reasonable trade-off for many.

In other words, I don't think your case is as airtight as you presume. :)

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Ryouga Inverse posted:

It was said on a Starcraft forum but it holds true everywhere: People don't post on forums because they want to be helpful or to discuss things. They post on forums because they want to be right.

And what better way to be right than by making someone feel terrible for being wrong?

I like that. I will use that quote in the future.

I find that if you don't want to be a douche, try to interpret other people's comments/questions in the most charitable way possible. For example, with the code under question, you could assume the guy is an idiot, or you could assume he's just ignorant.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Hammerite posted:

Why shouldn't it? (In general, not in this specific situation.)

For the reason it's being talked about here. Bucking convention just confuses people. Confusing people is sometimes a painful step needed to implement change for the better, but change for changes sake isn't "for the better".

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

MononcQc posted:

If the behavior is well-documented, convention is only a preconception the programmer brings to the table to get himself confused. :smugdog:

Very true. You still end up with lots of confused programmers, though.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

tef posted:

there was nothing on the knife that said don't place in eye socket.


so, now can we get a special case for newlines, whitespace, ascii control codes, unicode space. if you want a language that does this sort of poo poo, use php.

(ie the coding horror is you)

I like you.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Dren posted:

As someone who has spent a lot of time sitting, thinking of a good name for something when I could've been coding instead I find this bit very encouraging.

Doesn't that mean you've wrote a lot of bad code? I would find that discouraging.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

MEAT TREAT posted:

Like you only poo poo out gold nuggets?

No. I wasn't being disparaging anyone.

I was saying that from what he said, I didn't get how it would be encouraging.

Person 1: "I spend lots of time trying to come up with names"

Person 2: "Spending lots of time on naming is a bad sign."

Person 1: "I find that encouraging!"

Me: "What?"

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

NotShadowStar posted:

Every time I read Python code or the bizarre things that Python does I wonder how the hell that language caught on. It's like someone's academic experiment that broke out of the lab.

Funnily enough, every time I read Python code I wonder how come it's not even more popular.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I have no idea why I don't like dealing with XML, but I'll often skip using or working on a project just because I'd have to work with XML. I'm a fickle bitch, I guess.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Aleksei Vasiliev posted:


it is vitally important that this be one line!!!!

I got a good laugh out of that.

Needlessly constructing one liners at the sake of readability is AWESOME.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

ninjeff posted:

If you're referring to the filter, that's not that bad; he was probably in the middle of refactoring it from when IsItemDraggable was a string or something, and got called to work on something else.

Other than that it's just not great code (why does having a positive draggableCount mean that the transaction has already been processed?), but not really a horror IMO.

Tell him he should use .Any(), by the way.

I'm glad I'm not the only one. It's not pretty, but to my amateur self it didn't seem like a horror.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Amtiskaw posted:

The horror was the parsing of a string literal to bool to compare to a bool,

Hah! I skimmed right over that.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

A A 2 3 5 8 K posted:

For some reason I've never been able to figure out, software developers can solve complex problems every day but most act like they have the capabilities of a drooling retard when it comes to reading code that isn't formatted the way they're used to. As if it isn't trivial, and a small inconvenience at most, to switch between reading code with braces or not-braces, different whitespace rules, or whatever.

To be fair, it seems like whatever code style you're used to is less of an intellectual thing that you can just reason yourself around and more of a preference issue. It's like...I can't stand the taste of fish. I know that most people like fish, and that there is nothing wrong with fish, but that doesn't mean I can just logic myself into enjoying the taste.

I cut my teeth on Python, but have been doing most of my recent work in Java. I just feel...uncomfortable...reading and writing it.

Of course, I don't go around trying to tell people that the "look" of Java is wrong, either.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Jabor posted:

Whoah, this language does DWIM on English as well?

Haha!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

BigRedDot posted:

So of course our software was fragile, barely functioning garbage. But lots of people at the lab had no basis for comparing it to robust, documented, or maintainable software, so they all thought our stuff was hot poo poo, as opposed to steaming poo poo.

It seems like that's often the case when a company doesn't view software as their product but as something they have to do to make their awesome widget work.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I can't stop lauging about the Code Composer Studio Monitor. That's fantastic engineering!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

quote:

One security expert familiar with the investigation wondered how the hackers could have known to breach security by focusing on the vulnerability in the browser. “It would have been hard to prepare for this type of vulnerability,” he said. The security expert insisted on anonymity because the inquiry was at an early stage.

What?

I suspect he insisted on anonymity because he's just smart enough to realize he's dumb.

I'm not a security expert at all, but have heard of these type of attacks for a decade.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Lysidas posted:

The pressures that we're under in academia ("publish or perish") are guaranteed to produce horrible code that works just well enough to get results out of.

Good luck to others who want to reproduce your work!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

GrumpyDoctor posted:

I get the impression that there are an awful lot of scientists out there who could really use a software engineer just attached to their groups to, well, actually engineer their software. I basically have that job, and I think it's the best thing ever.

This does sound like a great job. I love science and software and helping people.

I think I'll take your job, ok?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Lysandus posted:

So he took a date, made it a string, parsed a date from that string and turned that date into a string...

:psypop:

That's some inception horror there.

I do that sort of thing semi-often when I'm coding late at night, tired, and haven't planned out what I'm doing ahead of time.

I like it because I always get a laugh out of it when I come back the next day to see why my code is weirding out on me.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Zamujasa posted:

We don't use any version control system.

In fact, the entire development process is as follows:

1. Install the in-house MegaCMS™. It's Zend-Guard encrypted, ofc.
2. Copy over the files for the portion we're changing to our private sites, from the private "developer server" (that is, a webserver with a lot of development files and a copy of the source code).
3. Make changes on our personal site.
4. Ship the changes over to the lead developer/CTO who will implement it the next time he does a release (currently about every 1 1/2 months), assuming it gets into that release.


That's not even getting into the code, which is abysmal. There's no documentation — even to the point the programmers are tasked with "mak[ing] a cheat sheet" on how to use one of the few classes we have, a formbuilder/validation system — almost no comments, and the various files are (ofc) Zend Guarded.

I tried asking for a copy of the source to go through and got reminded that we're supposed to develop on our encrypted copies.

:suicide:

I'd go on a rampage.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Ogive posted:

Nobody is going to live or die if an opening brace is on the same line or the next line as an if statement.

I don't think you've met many of the programmers I know.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Lurchington posted:

pep8 supremacy :smug: 79 characters
I'm not sure if you're saying that's too few or too many characters to wrap at

I'm a more advanced Python programmer than I am a Java programmer, but it seems like it's a lot easier to keep your lines short and readable in Python than it is in Java.

Also, PEP8 supremacy!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

code:
struct flubber *a_dumb_person_did_this(int a, int b,
                                       long g, shlong s,
                                       derpaderpadoo z);
is much more readable to my eye then this:


code:
struct flubber *a_dumb_person_did_this(
    int a, int b,
    long g, shlong s,
    derpaderpadoo z);

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

code:
struct flubber *a_dumb_person_did_this ( int a,
                                         int b,
                                         long g,
                                         shlong s,
                                         derpaderpadoo z
                                         );
Actually, that's the way I prefer it.

Mustach posted:

How do you quantify the difference?

How do you quantify that red is your favorite color instead of green? It just looks better and easier to read to me.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

tef posted:

can anyone spot the bug in the binary search?


answer

The worst part about being self-taught/un-educated in programming is that I've noticed this bug several times, but thought I just didn't understand what was really going on.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

AlsoD posted:

These last few pages have convinced me that my current plan of avoiding C++ in favour of Haskell or, if I'm desperate and tired, Java is probably not the greatest career move. Is there a handy guide to C++ templates? Are they comparable to Haskell's type system?

Someone can correct me if I'm wrong, as I'm not a professional programmer, but...

It's my understanding that Java, despite it's shortcomings, is a very widespread "pro" language in use by lots of places that pay people to write software. So, if that's what you mean by "not the greatest career move", you may be wrong.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Get this guys: sometimes I use an ORM and sometimes I use SQL.

I'm loving crazy.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Tw1tchy posted:

Hahah, dang, it's spread all over twitter now. Even Garry Newman, the maker of GMod is laughing at it a bit. I mean, yes, I feel sorry for them, but come on, if you coded it this way, okay, that's a problem you can fix, but being arrogant about it? That's where the real problem was.

Yeah, I agree. Maybe it's just the fact that I've done my own share of stuff like this merely because I didn't know better. The response of the dev is the real horror.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

The Gripper posted:

How about a language where whitespace is significant, and tabs and spaces are treated differently?

Impossible. No one would ever be productive in such a language, and even if they could they certainly could not enjoy such a language.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

The Gripper posted:

The worst is with concurrency frameworks and the like, where the most promising looking example is almost always some complex mathematical computation which probably looks clean and makes a lot of sense to someone that knows that particular math, but to anyone else it's difficult to separate "here's the code I need to use to implement this for my own use" from the "holy god m=p*x ^ 7; _,x=sub1(-y^(x)^add1(m));" part.

I know it's good to have examples that actually do something real and the developers probably have a strong math background, but giving me something like that when I don't even know which parts are the framework and which parts are the payload isn't all that productive.

I find this general thing to happen with the documentation on an un-trivial number of libraries. That is, illustrating usage of the library with examples that seem too domain-specific or outside of the knowledge base of a significant portion of their users. I can understand why this happens, and that sometimes it's the best illustration, but I don't like it!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I like how almost every time someone posts a horror someone else knows why it's not a horror or not as horrible as it first seems.

I think it means there are no horrible programmers.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

This is probably a coding horror in and of itself, but I can't stand XML and I can't really articulate any reason that an XML-defender couldn't give an answer of some sort to.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Suspicious Dish posted:

No, I'm talking about the format that ClientRegistry.blob is in. It's a custom binary format, magics 0x5001 (uncompressed) and 0x4301 (zlib compressed). I don't think the format has been written up before. I, along with a few other people, reverse engineered it, so let me write a bit about it.

Basically, there's two formats in play here. There's the blob format, which is a nested binary format - a blob has a bunch of key/value pairs, and the value may itself be a blob, with magic and everything (yes, this means that you can nest zlib compressed blobs).

On top of that is the registry format, which uses blobs as storage. In the top-level blob there is a key calle, TopKey, which points to a RegistryKey.

A RegistryKey has children blobs 1 and 2 (keys are longs, \x01\x00\x00\x00, \x02\x00\x00\x00). Blob 1 contains the subkeys. Blob 2 contains RegistryValues.

A RegistryValue has children blobs 1 and 2. Blob 1 has the value's type as a long. 0 is STRING, 1 is DWORD, 2 is BINARY. Blob 2 contains the value.

Here's some Python code I wrote a while ago:


It's quite messy and most of it was written before I was proficient with Python.

I would love to hear the story from Valve about why the hell they did this.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

As a hobbyist who has maybe 5 years of hobbyist experience... I find answers on SO via Google all the time, but if I ask a question on there its not uncommon to not get a good answer.

I think this is because all the easy to answer questions have already been asked.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

SlightlyMadman posted:

At my last job, the CTO had the most horribly formatted code I'd ever seen in my life. I ended up using python for as much of my new development as I possibly could, just to avoid him going in and mangling my code. He tried to mess with it a few times but he could never get anything to compile so we just reverted his changes. He was also a terrible programmer, so this was quite a blessing.

What about an svn hook that runs a whitespace formatter, and if it passed some threshold of changes, rejected the commit. In my experience, anyone who can't think straight enough to format their whitespace has other problems too.

I've never worked anywhere with a CTO, but it seems odd that one would be writing code.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Every single time I release something into the wild I'm biting my nails wondering if I made some horrific fuckup like this.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Ithaqua posted:

I think code reviews should be done on any team with more than one developer, personally.

A thread for single developers to review each others code. Good idea or bad?

Since I'm entirely self taught and haven't worked with any other developers before (besides minor-ish contributions to open source projects where I didn't really work with anyone else, I just fixed stuff and submitted it), I think I'd benefit a lot from code reviews.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Zombywuf posted:

When I'm a particularly low ebb I think about all the office productivity software that is effectively written as an emulation layer for the business practices of the 1950s and just how much this is holding us back as a civilisation.

+1

Not that I know there's better ways of handling business or whatever, but it always saddens me that so much software is like...well...here's a typewriter on your screen, here's a ledger on your screen, here's a Rolodex on your screen, etc.

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

npe posted:

I can vouch for how at least how one major US bank works... transfers were done via what amounted to timed FTP jobs of text files which listed each transaction. These transfers frequently failed and had to be restarted, involving manual effort to rerun the transactions that hadn't processed yet. Naturally, this was a 24x7 department of people to monitor these jobs (which ran 5 times daily, as I remember) and repair them when they failed.

As you can imagine, double transactions or missed transactions were not uncommon...

gently caress banks.

Just clear transactions as soon as I do them! This is the god drat 21st century, yet you insist on these stupid pending transactions and all sorts of poo poo that doesn't make any sense except to irritate me.

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