Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

01-10-2014 , 09:34 PM
I worked on code today that had:

Code:
{
...
    throw new BlahException(particular error message);
...
} catch(Exception E) {
    throw new BlahException(different error message not relating to what happened);
}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 10:03 PM
Quote:
Originally Posted by PJo336
I worked on code today that had:

Code:
{
...
    throw new BlahException(particular error message);
...
} catch(Exception E) {
    throw new BlahException(different error message not relating to what happened);
}
A lot of windows driver code has the following general structure:

Statement 1
Statement 2
.
.
.
If condition is false
goto exit
.
.
.
exit:
Cleanup stuff
return
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 10:41 PM
Quote:
Originally Posted by Baltimore Jones
Become a developer is what appeals to me
Out of curiosity what makes you say that? If you've built things and like and all that, be a developer, don't bother with QA or any other low level things. You know how I got my first development job? I called myself a developer.

And IDK about bootcamps but if you're selfmotivated enough to do well in a bootcamp I'd suspect you're selfmotivated enough to learn on your own at the same pace and wind up with the same results.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 10:53 PM
Quote:
Originally Posted by adios
What made it spaghetti code? Goto's?
Horrendous, nondescriptive variable naming.

Inconsistent style (sometimes spaces around assignment operators, sometimes not).

I work in C# and var was used for every single variable. I'm not even kidding.

The overall structure/control flow made no logical sense... If statements within if statements within if statements.

And worst was just too many reads and writes to the db. Lots of things that could be done in a single query would be done in multiple. Lo and behold the reason I was looking at the code was to improve performance. Who would've guessed.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 11:18 PM
while all of those thing you listed are bad, none of them is spaghetti code. spaghetti code is fundamentally about too much coupling. this creates this "feeling" of the code being hard to read, the logic being hard to follow, and in general the complexity being high. other problems can create the same feeling, but they aren't necessarily spaghetti code.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 11:26 PM
Quote:
Originally Posted by derada4
Also, I'm not 100% sure who originally wrote it, but as the day went on and after talking to a senior developer some more about it, I think I have a good idea who it was. He sits in earshot of me and most likely heard me say something negative or two. Should I feel bad?
Yes. Everyone writes bad code. Even the best programmer in the world is going to write code that he/she finds bad two years down the road. Complaining about coworkers code, especially when you don't know any context about how it was written, is annoying.

Edit: that's not to say you can't make fun of bad code, especially on here. Just that there's a time and place and my impression of what you did was that it was annoying.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 11:29 PM
Quote:
Originally Posted by clowntable
Get Xubuntu (with an X). The new Ubuntu is "Windows 8 like" whereas Xubuntu is more "classic desktop".

If it's your first one something Ubuntu-ish like Xubuntu is probably a good idea because you'll find the most support etc.

You can always spend a couple of hours browsing
http://distrowatch.com

[Mint is also a good choice, have heard about some issues with upgrading between releases but that was a while back no idea what their current status is]
And this is advice from a real expert, therefore, you should listen to him.

There's good and bad to Canonical's flavor of Ubuntu. The spyware and bloatware is a real turn off to me, but there is something nice about having everything set up, running, and ready to go. Of course, if you ever decide to run your own server (god bless your heart), it's a pretty good idea to program in a distro that is often used for this stuff. Seems to common ones are Ubuntu, Debian, Fedora, CentOS, and Arch.

Quote:
Originally Posted by clowntable
I used to do it all the time in the pentium pro to about 2Ghz single core ones. These days I have to research a bit to even know what's inside. All those crazy buses and whatnot...where's ISA :P
Also fried a CPU due to improper isolation so probably -EV lifetime building PCs
Many of my coworkers are gamers. It seems to be a thing for them to do. I'm not sure why there is a preference for rolling your own over buying something pre-built, but I guess they don't want more than they need and only want the highest quality parts.

The closest analogy I can come up with is buying a bicycle of the rack or buying something custom made. The expensive bikes all feature a few cheap parts that greatly diminish the quality of the product, or they sell expensive stuff at the cost of other parts, like selling a $250 seat pole and $5 breaks, so it is better to build your own or custom make one, and it tends to be cheaper that way.

Quote:
Originally Posted by candybar
Did your work in finance involve Excel and maybe Macros/VBA? Access? Excel VBA I think is the easiest way for a non-programmer to get a programming job, because it's both valuable and undesirable to other programmers. Microsoft botching .NET/Office integration also ensures that VBA will survive for at least another decade.
*sight* VBA... I had to do split dollars and cents so that:

cellA = 10.99
cellB = 10
cellC = .99

Not too hard in Excel. This is simply:

cellB = Int(cellA)
cellC = Mod(cellC, 1)

I needed a bunch of if / else logic and didn't want to write a 3-mile equation, so I opened up VBA. The natural thought is that this should work:

Code:
Function woah (v as Double) as Double
         dollar = Int(v)
         cent = Mod(v, 1)
         If...
             '' do stuff to dollar and cent''
         End If
         

         woah = answer
End Function
dollar = Int(v) works as expected, but the cent doesn't work at all. So go to Google and get this:

Code:
cent = v MOD 1
no dice.

Then you find crap like this, with a zillion possible ideas (all wrong or just yuck, of course):

http://chandoo.org/wp/2010/11/22/splitting-a-number/

Finally, I end up with this eyesore:

Code:
cent = ((v * 10) Mod (1 * 10)) / 10
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 11:39 PM
Quote:
Originally Posted by daveT
Not too hard in Excel.
not too hard unless you count circular references

Quote:
This is simply:

cellB = Int(cellA)
cellC = Mod(cellC, 1)


oh and reminder: never use floating point for actual financial applications.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 11:45 PM
Quote:
Originally Posted by daveT
*sight* VBA... I had to do split dollars and cents so that:

cellA = 10.99
cellB = 10
cellC = .99

Not too hard in Excel. This is simply:

cellB = Int(cellA)
cellC = Mod(cellC, 1)

I needed a bunch of if / else logic and didn't want to write a 3-mile equation, so I opened up VBA. The natural thought is that this should work:

Code:
Function woah (v as Double) as Double
         dollar = Int(v)
         cent = Mod(v, 1)
         If...
             '' do stuff to dollar and cent''
         End If
         

         woah = answer
End Function
dollar = Int(v) works as expected, but the cent doesn't work at all. So go to Google and get this:

Code:
cent = v MOD 1
no dice.

Then you find crap like this, with a zillion possible ideas (all wrong or just yuck, of course):

http://chandoo.org/wp/2010/11/22/splitting-a-number/

Finally, I end up with this eyesore:

Code:
cent = ((v * 10) Mod (1 * 10)) / 10
What's wrong with cent = v - dollar? Haven't tested, but it seems like it should work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-10-2014 , 11:54 PM
Quote:
Originally Posted by tyler_cracker
not too hard unless you count circular references





oh and reminder: never use floating point for actual financial applications.
From what I understand, you really shouldn't be using Excel for financial applications. The name of the game was fast regardless of slop. Elegance and accuracy be damned. I won't get into details, but two weeks later there is still no horizon.

Quote:
Originally Posted by candybar
What's wrong with cent = v - dollar? Haven't tested, but it seems like it should work.
Probably, but since when do I do things the easy way?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 12:02 AM
Quote:
Originally Posted by jjshabado
Yes. Everyone writes bad code. Even the best programmer in the world is going to write code that he/she finds bad two years down the road. Complaining about coworkers code, especially when you don't know any context about how it was written, is annoying.

Edit: that's not to say you can't make fun of bad code, especially on here. Just that there's a time and place and my impression of what you did was that it was annoying.
I mean I wasn't really "complaining", just discussing with the senior dev what I had to do and what my game plan was, and mentioning that the code was a mess and slowing me down a bit.

Re Linux/Ubuntu discussion: Mint is a good 'works out of the box' Linux distro without all the negatives that come with Canonical's Ubuntu
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 12:18 AM
Quote:
Originally Posted by gaming_mouse
while all of those thing you listed are bad, none of them is spaghetti code. spaghetti code is fundamentally about too much coupling. this creates this "feeling" of the code being hard to read, the logic being hard to follow, and in general the complexity being high. other problems can create the same feeling, but they aren't necessarily spaghetti code.
Yeah I was pretty sure he was misusing the term.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 02:22 AM
Quote:
Originally Posted by derada4
I mean I wasn't really "complaining", just discussing with the senior dev what I had to do and what my game plan was, and mentioning that the code was a mess and slowing me down a bit.

Re Linux/Ubuntu discussion: Mint is a good 'works out of the box' Linux distro without all the negatives that come with Canonical's Ubuntu
I wouldn't be too harsh on the guy. If it is a smaller place and the guy is a fresh-face, it may well be his first crack at producing a large-ish code-base.

IME of programs going past an N threshold:

Fist attempt looks like something built during a hard night of drinking.

Second attempt looks like something built during a massive hangover and just so happens to be the day your landlord forgot to pay the water bill and you just aren't up to going to the store to buy water and ibuprofen.

Third attempt looks like something you built two days after drinking.

Fourth attempt looks like you finally learned your lesson about mixing code and alcohol, but still haven't figured out that sleep-deprivation isn't a better condition.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 02:59 AM
Quote:
Originally Posted by derada4
I'm a bit new to the software field, but from what I've seen so far I don't think you need something like this to get your foot in the door doing QA, esp. at somewhere small which is where you probably have the best shot.
You may be right, but I can't imagine emailing resumes with no tech experience, no tech schooling and a long gap and getting called up for a QA job. Using personal contacts and perhaps joining meetups or whatever could be enough if I'm lucky.

Quote:
Originally Posted by Grue
Out of curiosity what makes you say that? If you've built things and like and all that, be a developer, don't bother with QA or any other low level things. You know how I got my first development job? I called myself a developer.

And IDK about bootcamps but if you're selfmotivated enough to do well in a bootcamp I'd suspect you're selfmotivated enough to learn on your own at the same pace and wind up with the same results.
Development appeals to me because I see them as the top dogs, because I have some aptitude for it and because of the money. I have a friend who thinks programming is incredibly boring and loves his QA job, and it's possible I'll feel the same way when all is said and done.

I don't think the self motivation will work for me very well. People said the same thing about poker (you could learn on your own), and it was absolutely true, but the fact is that I was never all that good until I started paying a big chunk of my winnings to live with and learn from other poker players. I need some semblance of structure.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 07:58 AM
From the land of WTFjustHAPPENED I present:
- Maybe some of you remember that I set up a Xubuntu PC for my dad
- Got the following error report: "Internet doesn't work"
- Investigate: Firefox crashes and always recrashes (restart button leads to the same crash menu)...safemode restart doesn't work...sucky to debug with no browser so I installed chromium...works...mmmmmkay
...think, thonk, think, thonk (didn't occur to me to check dmesg)
...Google-MANIA (think mouse-mania voice if you played chu-chu rocked)
...nothing helpfull
...walk around house thinking...
Lighbulb?!
...reboot, FF works then crashes and we're back to it not even starting up again...no real error messages (started it from a term LDO)...mmmm...it couldn't possibly...uhoh
...reboot into memtest86 (Figuring FF is ****ing mem-hungry so it might crash because it's one of the few programs that might use almost all memory?!)
...TADA...bad memory (but only one error)...now what (apart from getting new ram for such an old AMDK6 PC)...wait can't GRUB...yep nifty old Linux you can tell it to ignore corrupt areas of RAM...oh the joy
...wait a second the format is utterly different than what memtest86 gave me...surely I can convert that (GOOOGLE-MANIA)...nope (I think I can but don't really want to gamble here)
...BUT ALAS...memtest86 can actually report the badmem argument directly if you switch the reporting mode (who knew you can config stuff)
...I FEEEEEEEL HAAAAAPPPPPY
...found the option...run memtet86...error detected so let's just read it, enter into grub, grub-update and sail into sunset...WTFBBQ it reports a blank red line
...GOOGLE-MANIA...well seems noone has encountered this before
...ALAS...WHO KNOWS...dowload the latest memtest86 as a bootable ISO (aha it's 5.01 and Xubuntu LTS came with 4.2)...boot...run
...YAAAY reports in the right format and the line is red but with text that can be read this time...great success?!
...I'll let it run for a bit then do the Grub-foo and see what happens
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 09:38 AM
Dave, a while back it was usually much cheaper to assemble your own and you walk out with not only a cheaper machine but higher quality parts too. Before C2Ds it was usually a good idea to overclock your machine too because it resulted in a real difference in day to day use and that usually required very specific parts.

Once you've done it a few times it only takes about 20 minutes to put together.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 10:08 AM
Hmm, I'm pretty surprised by the responses on here. I'm not disagreeing with anyone (like I said I'm very new to the software field), it just wasn't what I was expecting.

Maybe it's because of the way my company works. We bill our clients hourly, so all the developers get assigned task X with Y hours to work on. Everyday we have to log our hours (e.g., I worked on task X for 3 hours and task Z for 5 hours today). It's not as bad as it sounds, it's pretty laid back, but nonetheless is there and has to be done. About 3-4 weeks ago, the senior dev had told me that I was going to specialize in part Z of the system because part Z is "a total f***ing mess" (his words). This week I finally got assigned my first task within part Z, and as I dug into it I was explaining to the senior dev that I'm probably going to need more hours assigned to me for the given task because the code was so bad.

I guess I'm surprised because judging by his response, he acted like there was nothing wrong about it. At one point I mentioned "I don't even care who wrote it, it's just that yadda yadda yadda," to which he responded "no, you certainly should care because now it's causing you frustration and slowing you down yadda yadda yadda"

Anyway, enough of that.

Does anyone know a good book or resource to learn about software architecture? As I'm getting exposed to it at my job (N-Tier and SOA so far), I'm finding it really interesting and also am a total newbie to it. I was thinking of buying this: http://www.amazon.com/Patterns-Enter...e+architecture
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 01:49 PM
Quote:
Originally Posted by derada4

Does anyone know a good book or resource to learn about software architecture? As I'm getting exposed to it at my job (N-Tier and SOA so far), I'm finding it really interesting and also am a total newbie to it. I was thinking of buying this: http://www.amazon.com/Patterns-Enter...e+architecture
the linked to book is very good, but it's pretty dry and kind of a slog.

while it's not architecture per se, you'd be much better off starting with this:

http://www.amazon.com/Refactoring-Im...ref=pd_sim_b_4

it's a classic, it's readable, and it will be immediately practically useful to you, especially since you are working on refactoring projects now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 01:57 PM
i want to have martin fowler's babies.

also all professional software developers should have a copy of this available: http://www.amazon.com/Working-Effect.../dp/0131177052
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 02:56 PM
Can someone help me with an excel problem I'm having

I copied a table from the web into excel and I'm trying to use the vlookup function.

For example the table may say

Tiger Woods 3

On another sheet I have Tiger Woods in cell A1 for example and I want A2 to display the number 3.

So I do =vlookup(A1,copy pasted table, 2, false) and I get an #NA response.

However if I go to the copy and pasted data, delete "Tiger Woods", and retype "Tiger Woods" manually into the cell the equation works.

I have a lot of data and obviously don't want to have to manually type in corrections for every name, what is going on? I've tried the Trim/Clean functions with 0 success.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 03:00 PM
Quote:
Originally Posted by gaming_mouse
y'know, i saw this talk at FlowCon and wasn't that impressed but then i feel like i've been refactoring ****ty legacy code for my entire adult life

i kind of wish she had focused more on the "therapeutic" part -- the cognitive and psychological effects of cleaning up bad code and improved ability to reason about the new, less-bad code. instead that's like 2 minutes at the end with anecdata (n=1) and no science at all
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 03:11 PM
i dont think it's groundbreaking but i thought it was solid, and i think it would be really helpful for someone relatively new to refactoring
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 03:33 PM
Quote:
Originally Posted by Baltimore Jones
I don't think the self motivation will work for me very well. People said the same thing about poker (you could learn on your own), and it was absolutely true, but the fact is that I was never all that good until I started paying a big chunk of my winnings to live with and learn from other poker players. I need some semblance of structure.
Well there's online courses with structure you can get for free you can at least try out but if the opportunity to make a huge improvement to your life and career isn't motivation enough for you this might not be the right path.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-11-2014 , 03:57 PM
Quote:
Originally Posted by NxtWrldChamp
Can someone help me with an excel problem I'm having

I copied a table from the web into excel and I'm trying to use the vlookup function.

For example the table may say

Tiger Woods 3

On another sheet I have Tiger Woods in cell A1 for example and I want A2 to display the number 3.

So I do =vlookup(A1,copy pasted table, 2, false) and I get an #NA response.

However if I go to the copy and pasted data, delete "Tiger Woods", and retype "Tiger Woods" manually into the cell the equation works.

I have a lot of data and obviously don't want to have to manually type in corrections for every name, what is going on? I've tried the Trim/Clean functions with 0 success.
Sounds like you pasted the data directly, which means you are attempting to compute HTML values.

When you copy paste from the web, you should always Right Click > Paste Special > Text.

If you already have the data on your spreadsheet, then highlight all, copy Paste Special and choose Values.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m