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
lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Whereas Python will throw an exception just to say that an iterator is out of items to iterate over.

Adbot
ADBOT LOVES YOU

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Semi-related story.

My computer at work is locked down, as normal, and I can't install or upgrade software.

Today I found out that my billion-dollar employer has no facility for hitting the "free upgrade" button on VMWare. They can only purchase a new license.

So I now have two licenses for VMWare.

I'm tempted to see how many I can collect over the course of my employment.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

QuarkJets posted:

If the user isn't able to directly specify the inputs, is there anything significantly wrong with creating SQL queries with string concatenation?

I've done it when the entire shape of the query is constructed on the fly.

I refuse to do it for simple checking parameters. At some point in the future it'll get refactored, and then elsewhere in the code someone will change a small piece to be user imputable, and suddenly a security hole has appeared without any one person being responsible.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Hargrimm posted:

This happened with a poorly-programmed downloader I was using years ago. I have a zip file named Episode 12 - Foo_01_02_03_04... and so on. The filename is so long I have been completely unable to find any way of deleting, renaming, or moving it through windows or any application. It's been camping in my Downloads folder since 2010.

I'd offer to (try to) help, but that's too loving funny.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Munkeymon posted:

It's almost certainly not!

Branching doesn't help, either, because a branch is just a special folder in the same workspace you can merge with neighboring folders. As a consequence, one commit can span branches and, for the icing on the cake, the UI makes it trivially easy to do that accidentally.

Also note the workspace name is the computer/user login. If the computer name changes, the local copy stops working.

That's not even getting into 'version' conflicts and what happens to shelvesets when you delete their backing branch. It's real bad.

This is a real version control system?

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Ghost of Reagan Past posted:

I once, on a lark, wrote an application that'd create a REST API with Flask from a JSON spec.

I quit when I realized that anything more than simple SQL insert/select and schema updates were going to be nearly impossible to do without building out a DSL that embeds within the JSON.

This guy saw that and said "good idea."

Weird, I did the exact same thing with Flask+JSON, and quit for the same reasons.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
What the hell are y'all doing that you're hitting browser compatibility problems? Modern Javascript frameworks?

I can get near-pixel-perfect precision across browsers with just last year's HTML/CSS and a polyfill.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

uncurable mlady posted:

how many people involved in this inane debate regularly interview other people

i hope the answer is 'very few of you'

I think you can tell where in the interview process people come in based on their opinions on FizzBuzz. The people doing tons of screen shares with barely-vetted candidates need a coarse, initial filter.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Everyone's allowed one argument about FizzBuzz. Then you're done with it, and you have to shelve your opinions for life.

Much like opinions on indentation.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
My college taught us with C++. I loved it at the time, because I thought more == better, and C++ definitely had more. In retrospect I spent more time dealing with C++ specific debugging problems than reinforcing the material I learned in class.

I don't know what the best language is for learning. It might be C or Java, it might be Python or Scheme. But good lord I always assume that everyone would always agree that it's not loving JavaScript.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

The Laplace Demon posted:

It's fortunate that experience working on specific debugging problems is a highly marketable skill.

Not for me. I went into web dev and never touched C++ again.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Speaking of coding horrors in the medical industry, anyone who hasn't yet read about the Therac-25 should do so.

https://en.m.wikipedia.org/wiki/Therac-25

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I think good SE practices are hard to teach because they don't scale downward. Not well. The kinds of programs you can code in a single semester are pretty toy, and you don't really see the benefits of proper SE at a small level.

I found the same problems learning Gang of Four OO programming. Until you have problems with more than ~120 objects it just a seems like over-complicated architecture.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Snak posted:

There were people in my class who would push code to master without checking if it even compiled.

Should lose a letter grade every time they do that.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Ornithology posted:

This is so true. I've been coding for about 2 years, and my very first semester of college we had a course on requirements analysis

...

Similar thing happened in second semester, when they taught us design patterns and data structures combined into a single 1 semester course.

Oh my god. I've don't know which is more terrifying.

Ornithology posted:

A while ago a bunch of design patterns finally clicked for me, and I realized that they are mostly just taking advantage of OOP concepts, especially polymorphism. From a beginner's perspective, it seems like a ton of design patterns are just about using interfaces rather than implementations whenever possible, and keeping things as generic as possible.

That's it. It's using the features of objects, like polymorphism, to build systems of objects that adapt easily to changes.

Ornithology posted:

Didn't even touch Big O, complexity analysis or optimization in this program. Any tips on where to start on this topic?

A better school? Big O is an easy way to measure and compare complexity, and you shouldn't optimize an algorithm until you know its complexity. I don't know where to start learning it, but I'd guess Khan Academy.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I used to debug code in a production system whose terminal had a 78 character limit. Let me tell you, it's not always more readable to split lines cleanly at 78 characters and add proper indenting on every split line. When you do that, you take up a *lot* more vertical screen space. When have a hard 78 character limit you'll also have a 40 character height, and that vertical screen estate matters a lot. I found it easier, sometimes, to read wrapped lines, even if they mess up the indentation.

That's the problem with dogmatic 80-chars-or-die programmers. I've found that they've never actually worked in an environment where that limit matters, so they don't know what tradeoffs they're asking for.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

canis minor posted:

Another job, another code:

code:
return (true == $value->is_running || 1 == $value->is_running ) ? true : false;

In my defense, because this may as well be something I wrote, every Perl programmer goes through occasional phases where they get inspired by PBP, or by some particularly strong "best enterprise practices" article, and tries to wrangle legacy Perl software into something approaching maintainable. Writing wrapper classes to guarantee a small set of defined return values is often the first step.

The second step is getting loving drunk, because Perl.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

leper khan posted:

Employers don't care about your pet projects though.

They don't care what you did, but they care that you did it, and got a keyword on your resume out of it.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Ranzear posted:

I remember something about pivot selection from first year CS. Wasn't it like... pick three at random and take the median value?

Yep. But I don't think it needs to be random, you can just take the median of the first, last, and middle items and it should be good.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Spatial posted:

I wish language lawyers wouldn't pop out of the woodwork trying to one-up each other every time C is mentioned. Keep it in your pants please.

C is the only language with which I can tolerate these talks. It's such a slow moving language with so many weird corners that will *never* be fixed.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

ChaosArgate posted:

Today I started cleaning up a page that queries our db a few times and generates an HTML table with the results of that. This page queries the db per table cell. :cripes:

Is there an ORM behind this hilarity?

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
If it helps, and it won't, remember that Perl was designed by a linguist to be as expressive as a natural human language. It was Perl's first mistake.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

necrotic posted:

I go on a rampage whenever I see poo poo like this. How broke does your brain have to be to think this is okay?

I can tell you exactly how it happens, because I've seen it happen. It's a series of well meaning steps. First it's a simple "unless", then a bug fix changes it to an "unless not equals", then a new feature changes it to "unless not equals or else".

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Then there's Google's Leap Smear, where they slowly sneak in the extra second over a 24 hour period. I've never had to deal with that, but it sounds like the fun.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

CPColin posted:

Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell!

Best part is when you discover that one code path is just impossible to reach. Second best part is when you tell your boss about it, and he says, "That's a pretty important piece of functionality. Weird!"

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
"Be the change you wish to see in the world."

-Gandhi

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Coffee Mugshot posted:

On the other hand I've done quite a few interviews where the code devolved into some python-esque C pseudo code for reasons and although I've noted it in my assessment, it has never been any kind of significant input to my evaluation. You can still demonstrate good algorithmic and higher level design skills even if you make up the syntax. Naming matters in pseudo code too.

Yeah I always end up doing whiteboard pseudocode in something that's close enough to Python to be easily understandable.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
My last act at one job was to set the dev user login to randomly (1/100) echo "You've been eaten by a Grue" and log out.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Asymmetrikon posted:

Disliking a language because one of its loudest designers is a shithead is actually entirely reasonable.

It's not reasonable, but it is very satisfying. For me, Rails.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Ranzear posted:

Let's have some fun. Press Ctrl+L. That puts you on your browser's address bar, right?

Go here: http://www.startrek.com/

Now press Ctrl+L. Why the gently caress would anyone intercept that?

Wanna have more fun? If you're in Chrome, press Ctrl+A and then Ctrl+C once or twice.

:allears:

Oh god, there's some ticket site that does that, except it intercepts CTRL-F for their own find command.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

Vanadium posted:

What loops do the pros use as game loops?

A for loop.

code:

for 1 .. MAX_INTEGER_SIZE:
    game_logic()

print "you won."

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Company: No code on laptops.

Coder: Sure. Unrelated, can I configure my ssh keys so I don't have to type my password when I login to the dev server?

Company: Yes. Directions are in the new hire guide on the wiki.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

iospace posted:

I've seen a function of that length. It had 0 useful comments, combined tabs and spaces, and determined if someone's health insurance paid out.

Optum?

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I still use jQuery. Only because it was big the last I wanted to learn anything about JavaScript. I have no idea how much of a horror this is.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

I was hoping this would be “scary” like “it’s a high level language but doesn’t do boundary checking,” “our operator precedence table is fifty lines long,” and, “our random number generator was written by a CS 101 student trying his best.”

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Here’s a guy who created his own rear end in a top hat language, but strictly by taking the worst parts of real languages. It’s starts with PHP, adds significant white space, C macros, unless, and keeps going.

https://www.infoq.com/presentations/worst-programming-language

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Once again, the answer is a company wide policy to set tab equal to one space.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

a hot gujju bhabhi posted:

Uh, just learn SQL guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write SQL is surprising to me, I thought that was a pretty rudimentary part of being a developer.

Xarn posted:

Uh, just learn ASM guys. It's not that complicated for 99% of usages. Yeah occasionally you'll need to do something complicated, but the idea that so many of you don't understand how to read/write ASM is surprising to me, I thought that was a pretty rudimentary part of being a developer.
:v:

Both true. Both useful.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I once heard someone say that the entire history of C++ is the history of an attempt to get a string type to work.

Adbot
ADBOT LOVES YOU

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

steckles posted:

There is a series of inventory control machines that are used by some of our clients. I've been tasked with evaluating how difficult it would be to add support for them to our software. I spent a few hours reading docs, chatting with the company's implementation people, and playing with a simulator they provided. When I present my findings at the next dev meeting, I had this exchange with one of the other programmers:

Me: ...and you talk to the devices via ODBC.
Him: Isn't ODBC on its way out?
Me: I... that's debatable and not relevant.
Him: Shouldn't we use an API instead?
Me: Um... you don't... this isn't... I...
Him: I just think we should use something modern, like an API.
Me: ...

Sometime our sales guys say weird cargo cult stuff like this, but this guy has been programming for almost 20 years.

Your living in my favorite Dilbert strip!

http://dilbert.com/strip/1995-11-17

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