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
Mikey-San
Nov 3, 2005

I'm Edith Head!

That thread is terrible.

Bhaal posted:

Being familiar with .NET could look extra appetizing on your resume if your PR/marketing duties are largely web-oriented.

Yes, someone who doesn't know any language and is asking about learning challenges should start with .NET because it'll look awesome to marketing dudes.

It looks like the OP is asking for the challenges people have dealt with, not recommendations for a first languages to learn. Why are people posting poo poo like this?

mrbass21 posted:

If you choose linux for your compiler

Adbot
ADBOT LOVES YOU

The Noble Nobbler
Jul 14, 2003

quadreb posted:

"Moved on"? Regular expressions are an integral part of modern business programming.

Business programming?

Tulenian
Sep 15, 2007

Getting my 'burg on.

The Noble Nobbler posted:

Business programming?

You know, CRUD applications.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Tulenian posted:

You know, CRUD applications.

The R stands for Regular Expression!

baquerd
Jul 2, 2007

by FactsAreUseless

The Noble Nobbler posted:

Business programming?

Move data from point A to point B while performing some operation(s) on it. Maybe put a ribbon in its hair with a GUI too.

Milotic
Mar 4, 2009

9CL apologist
Slippery Tilde

The Noble Nobbler posted:

Business programming?

"Can we have it in Excel?". Eh, keeps me in a job.

On the topic of regular expressions and 'knowledge requirements', sod the theory, it's just nice if the original developer documents what it's *supposed* to do, and what the expected form of the inputs are.

TSDK
Nov 24, 2003

I got a wooden uploading this one

quadreb posted:

Move data from point A to point B while performing some operation(s) on it. Maybe put a ribbon in its hair with a GUI too.
Can I get that in cornflower blue?

baquerd
Jul 2, 2007

by FactsAreUseless

TSDK posted:

Can I get that in cornflower blue?

*Auto-reply from quadreb since you're not on my whitelist*

All requests must be put in through the ticket system. If you do not have access to the ticket system, please email [the person who never reads or replies to his emails].

*receives ticket to change color scheme to cornflower blue*
*revokes that person's ticket system access*

Parantumaton
Jan 29, 2009


The OnLy ThInG
i LoVe MoRe
ThAn ChUgGiNg SeMeN
iS gEtTiNg PaId To Be A
sOcIaL MeDiA sHiLl
FoR mIcRoSoFt
AnD nOkIa

1337JiveTurkey posted:

http://java.sun.com/javase/6/docs/api/javax/xml/transform/TransformerFactory.html

Apparently just having an XSLT transformer isn't enough. It needs to be instantiated using a factory for extra flexibility. At first I thought it was for the ability to read input and write output as streams, SAX events, STAX events, and DOM trees with the same API. Now I've learned that it's also great for use cases such as the developer having one XSLT implementation which accepts blank namespaces and the server having another XSLT implementation which suffers a fatal error whenever it encounters a blank namespace. :suicide:

Take a glance at the #setFeature() method too.
- Uses Strings defined in who knows where which MUST actually be fully qualified URI:s as feature keys
- Throws Exception instead of RuntimeException...
- ...and doesn't require Transformer to support all but one feature. This means that you get all sorts of nasty cross-platform issues right at the beginning when setting features and unless you wrap the #setFeature() as its own method, it may break down your feature setting code if you have more than one feature to set and you're not careful. This is especially nice if you have multiple Transformers in your software since cross-feature support is apparently a good joke among the XML Transformer developers.

And all that for one method. When manipulating Document's contents programmatically I've managed to get insane amount of NPE:s in internal methods with quality comments akin to /* this hack needed to make [feature xyz] work */ sprinkled all over. Java's default XML is the worst thing ever, never dwell into its source to understand what it does, this is a plain warning.

As far as I know, javax.xml.* is entirely made by people at W3C. They can write great specifications but drat if they ever manage to create code that impresses in the positive way...

PnP Bios
Oct 24, 2005
optional; no images are allowed, only text

TSDK posted:

If they didn't fancy it, I suppose they could always go with John Martin's Introduction to Languages and the Theory of Computation instead.

But of course, I'm being less than serious by now :q:

Not only did I have to use that text, I had him as a professor.
http://www.cs.ndsu.nodak.edu/~jmartin/ - here's his web page.

Eltoshan
Sep 22, 2007

PnP Bios posted:

Not only did I have to use that text, I had him as a professor.
http://www.cs.ndsu.nodak.edu/~jmartin/ - here's his web page.

I also had him for my professor in Theoretical Comp. Science I/II and Algorithm Analysis. The guy is a genius but he has a knack for making most of his students fall asleep during lectures.



This is the biggest roadblock most Computer Science majors have at NDSU.

gold brick
Jun 19, 2001

no he isn't
if you find yourself checking in a method that ends like this:
code:
                        }
                        else
                        {
                        }
                    }
                }
                catch
                {
                }
            }

            Foo blankfoo = new Foo();
            return blankfoo;

        }
...please reconsider your career choice.

cerror
Feb 11, 2008

I have a bad feeling about this...
Found this in one of the perl modules of our ticket system. The code's not that bad, I just thought the comment was priceless.
code:
# Somebody gently caress me in the rear end!  All the info processed by this
# shortass script?  Holy god damned hell!  I bet I don't want
# to even look at the update_userinfo() subroutine...
sub post_user_info {
        my $state = shift;
        $state->{template} = 'redirect.tmpl';
        $state->{title} = 'Ticket Lookup';

        my %Prefixes = list_prefixes;

        $state->{q}{hphone} =~ m/^(\d{3})/;
#       $state->{q}{isp} = $Prefixes{$1} if defined($Prefixes{$1});

        $HTML_Fixer ||= ARS_FixHTML->new();
        $state->{q}{notes} = $HTML_Fixer->defang($state->{q}{notes});

        eval { $state->{q}{id} = update_userinfo($state->{q}); };
        if ($@) {
                $state->{template} = 'error.tmpl';
                $state->{error} = $@;
                return output_html($state);
        }
        if ($state->{q}{new}) {
                $state->{uri} = "$Doc_URI/general/mainuser.html?user=" . $state->{q}{id};
        }
        else {
                $state->{uri} = "$Doc_URI/general/user.html?user=" . $state->{q}{id};
        }
        return output_html($state);
}

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



BigRedDot posted:

I work on sonar systems for submarines, I can say confidently that regular expressions are not at all an integral part of the programming we do.

But what if you have to find an enemy submarine that resembles a well-formed propper name? What then Mr. Smarty-Pants?

Mikey-San
Nov 3, 2005

I'm Edith Head!

BigRedDot posted:

I work on sonar systems for submarines, I can say confidently that regular expressions are not at all an integral part of the programming we do.

I find it hard to believe that you could extract those little blips accurately from the ocean without some kind of regular expression. :colbert:

CanSpice
Jan 12, 2002

GO CANUCKS GO
PerlMonks got hacked recently. What does this have to do with coding horrors, other than it's Perl?

quote:

There is a really simple reason we owned PerlMonks: we couldn't resist more
than 50,000 unencrypted programmer passwords.
:ughh:

Mikey-San
Nov 3, 2005

I'm Edith Head!

quote:

There is a really simple reason we owned PerlMonks: we couldn't resist more
than 50,000 unencrypted programmer passwords.

quote:

the administrators notified the owners of the exposed accounts and forced a reset of all their passwords.

problem solved guys go home nothing to see here

Scaevolus
Apr 16, 2007

quote:

There's a bit of controversy going on as to why the passwords were stored in plain text in the first place, with some arguing that it was because of the very large user base. Password hashing was apparently on the TODO list for the future, but that has become a priority now.
They must have been playing perl golf with their codebase or something, even just SHA1 with constant salt only takes a few more characters.

biznatchio
Mar 31, 2001


Buglord

Scaevolus posted:

There's a bit of controversy going on as to why the passwords were stored in plain text in the first place, with some arguing that it was because of the very large user base

You heard it here first, folks. Perl can't handle hashing 50,000 passwords.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

quote:

There's a bit of controversy going on as to why the passwords were stored in plain text in the first place, with some arguing that it was because of the very large user base. Password hashing was apparently on the TODO list for the future, but that has become a priority now.

Now that's premature optimization.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
The gently caress is with people using the eclipse auto format bullshit on code they don't even need to change, and then they check it in anyways to make my next diff/merge a living hell?

plushpuffin
Jan 10, 2003

Fratercula arctica

Nap Ghost

fletcher posted:

The gently caress is with people using the eclipse auto format bullshit on code they don't even need to change, and then they check it in anyways to make my next diff/merge a living hell?

Use a diff utility that can ignore whitespace changes.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

plushpuffin posted:

Use a diff utility that can ignore whitespace changes.

It's not just whitespace. static functions get moved to the top, variable/function names get sorted alphabetically, and the curly braces go from 1TBS to K&R

dancavallaro
Sep 10, 2006
My title sucks
If only that were configurable...

plushpuffin
Jan 10, 2003

Fratercula arctica

Nap Ghost

fletcher posted:

It's not just whitespace. static functions get moved to the top, variable/function names get sorted alphabetically, and the curly braces go from 1TBS to K&R

Ah, okay. My apologies.

jayhat
Feb 27, 2008
I saw this lovely piece of pre-STL legacy code in the other day.

code:
class Foo{
...
}

ListDeclare(Foo, Foos);
What is this magic ListDeclare thing?

It's actually a macro:
code:
#define ListDeclare(Q, QS)\
    class QS{\
        Q[] contents;\
        int iterator;\
        ...
        void iterator_at(int i){ iterator = i };\
        Q iterator_contents(){return Q[iterator];\
        ...
    }
Foos is then used as a quasi-vector that only allows 1 iterator over it at any point in time.
Fun stuff.

jayhat fucked around with this message at 01:33 on Aug 7, 2009

oldkike
Jan 10, 2003

hey

www.pleasegimmeadollar.com
In shipped, production code (6 happens to be the highest log level)

code:
#define SIX 6
...
setLogLevel(6);
So... many.. things wrong here..

jimbroof
Sep 4, 2003

my wife drew this for me :]
code:
if ($variable =~ (/expression1/ || /expression2/ || /expression3/))
{
	doThing();
}
also:

code:
if($variable =~ !/expression/)

jimbroof fucked around with this message at 07:10 on Aug 7, 2009

Filburt Shellbach
Nov 6, 2007

Apni tackat say tujay aaj mitta juu gaa!
I bet something like

code:
if ($variable =~ (/expression1/ | /expression2/ | /expression3/))
{
	doThing();
}
actually works in Perl 6. (Junctions)

manero
Jan 30, 2006

Seen in some Rails code where the developer was trying to get the start of the day:

code:
now = Time.now
day = now.to_date.to_time
Yeah, it works, but it took me a while to figure out that's what they were trying to go for.

code:
day = now.at_beginning_of_day
would have probably sufficed and saved me a bunch of time.

I also tend to see a lot of stuff like:

code:
some_str = "bla bla #{var1.to_s} fsdfdsf #{var2.to_s}"
Better convert it just to make sure!

HFX
Nov 29, 2004
Nevermind, thought this thread was shorter then it is.

HFX
Nov 29, 2004

fletcher posted:

The gently caress is with people using the eclipse auto format bullshit on code they don't even need to change, and then they check it in anyways to make my next diff/merge a living hell?

The real problem when working with code is that you need a diff utility that parses the code given (lex) and then runs a diff on the resulting tokens to find the difference.

Zombywuf
Mar 29, 2008

fletcher posted:

It's not just whitespace. static functions get moved to the top, variable/function names get sorted alphabetically, and the curly braces go from 1TBS to K&R

Seriously?

Java has so much to answer for.

Cue coding standard that require prefixing similar functions in order for Eclipse to group them correctly.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Zombywuf posted:

Cue coding standard that require prefixing creatively naming similar functions in order for Eclipse to group them correctly.

Much more fun.

1337JiveTurkey
Feb 17, 2005

Zombywuf posted:

Seriously?

Java has so much to answer for.

Cue coding standard that require prefixing similar functions in order for Eclipse to group them correctly.

That's an Eclipse quirk. IntelliJ is perfectly happy to list the class structure in the sidebar in alphabetical order while leaving the code well enough alone. In any case if it's impossible to find anything in a class without putting every member in alphabetical order, the class is probably too drat big to begin with.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Zombywuf posted:

Seriously?

Java has so much to answer for.

It is a little known quirk of the Java specification that all member functions must be lexicographically sorted or the program is ill-formed.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
By the way, does Java make any guarantees as to the layout of the class based on the order of declaration of members?

deedee megadoodoo
Sep 28, 2000
Two roads diverged in a wood, and I, I took the one to Flavortown, and that has made all the difference.


enki42 posted:

Jesus, you guys with your requirements for programmers should spend a couple weeks working for an internal IT department. I'm fricking thrilled if one of my devs knows what a pointer is.

Stuff like language theory is probably important for an architect, but if a dev is told they are going to be using a regular expression, it's nowhere near a necessity. Twos complement as it relates to business programming today is pretty much the least leaky abstraction ever - it's interesting as a sign of intellectual curiosity if someone knows it, but not knowing it would have exactly zero effect on the quality of code they output.

I've been involved with a few projects from initial concept all the way through to deployment. This process usually changes hands a few times so one team is never really involved from start to finish but somehow I managed to do just that. I got to see everything from initial concept to working with the architects to draw up the requirements then the developer hand off, testing and eventual installation. It's fun to see how a perfectly reasonable design document ends up producing a lump of poo poo.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

1337JiveTurkey posted:

That's an Eclipse quirk. IntelliJ is perfectly happy to list the class structure in the sidebar in alphabetical order while leaving the code well enough alone. In any case if it's impossible to find anything in a class without putting every member in alphabetical order, the class is probably too drat big to begin with.

Eclipse lists it in alphabetical order in the sidebar while leaving the code alone as well, but if you do Source->Format or Source->Cleanup or whatever the hell it is it will rearrange everything.

I can't imagine why they even put something like that in. Are people really that lazy that they can't keep their code formatted properly as they write it?

Adbot
ADBOT LOVES YOU

czg
Dec 17, 2005
hi
Eclipse's Format feature will mess with all your whitespace, but leaves the order and everything else alone.
There's a Sort Members feature that does precisely that, though.

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