Monday, November 2, 2015

DevExpress...

DevExpress is beautiful and I love to code it, but ...

I swear, it is NOT possible to publish a DevExpress application without something going wrong.

I follow the same publish procedure, and something different happens every time.

Will Microsoft ever learn how to run updates correctly?

I'm sorry, but with Windows 8.1, Microsoft has finally delivered their WORST update system, ever.

I'm talking about the automatic, scheduled updates. Microsoft gives you something like:

   Updates must be completed to blah blah blah...
   Your computer will restart in 1h 23mins....
   If you choose Later, your PC will automatically restart in one day.

It's the third line that kills me. They were brutally honest about it too. Let's say you choose Later (because, ya know, you're a normal person that's got shit to do right now). Within 24 hours, Microsoft will automatically turn off your computer.

Ya know.. no warning or anything.

So there you are in an important meeting or writing up an important document online, and boom.... your computer turns off.

WHAT!?????????????????
You can't just do that! What the fuck? All that shit I had open? Sure, most of the programs have autosave, so you might not lose a whole ton of work, but it's the principle of the thing. If you want your customers to hate you, then you're doing a great job Microsoft. Bravo!

Actually now that I think of it, Windows 7 was kind of worse. In Windows 7, sometimes they would just restart your PC without even giving you ANY indication (for instance, if it's locked). And they would restart little to none of the apps you had open.

So overall, Windows 10 BETTER have a decent update system. It's sad to say that as a gamer and developer, I am stuck with a horrific update system. Thanks Microsoft.

Wednesday, May 27, 2015

F12 is downright dangerous.

So, F12.

In Visual Studio, it's the default keyboard shortcut for Go To Definition. Very useful keyboard shortcut. I've used it countless times. I observe other co-workers NOT using it (and simply right clicking and using the menu) and have laughed at the thought. But now I know why they were doing it.

It's right next to the F11 key... what's that? Starting the project, and potentially deploying something you do NOT want to deploy.

Consider this scenario...
You're tired (like I am today)... you press F12 to check a method definition, but you fat finger it. All of a sudden, VS is building.

Building..

You immediately hit Ctrl + Alt+ Break, but guess what? You're viewing the server from RDP, so that just minimizes RDP!

Deploying...

Without any idea of what environment it's targeting (you just came here to check a few methods to analyze a problem!) you freak out. At this point let's say you forgot the menu option to stop a build. There is nothing you can do....

Deployment failed

Thank GOODNESS! An error that the solution already existed. No changes were made. It was targeting DEV in my case so I was okay anyway. But seriously, not going to use F12 anymore. Way too dangerous. Why would they put an innocent "view method definition" command in a key that is right next to a "Build, deploy, and potentially fuck up EVERYTHING" command key? Ey yey yey.

Friday, April 3, 2015

#regions inside methods.

You know what I really, really hate.

#region declarations INSIDE of methods.

#regions OUTSIDE of methods is completely fine, makes code better organized (when used correctly), and overall helps us find things better.

But INSIDE METHODS?

I just saw one inside of a method, the region was called:

load the data

And it had about 5 lines of code. FIVE!

How does this help organization? Now I have to go click the + sign in VS just to see your 5 lines of code.

Now imagine this EVERYWHERE in a project, and you have an idea of what I am going through right now.

Hey, if you like regions inside methods, you know what you should REALLY be using?

SUBMETHODS.

Submethod the shit out of every embedded #region you have. Too many submethods? Make a new class. Reuse code. Keep it consistent. Keep it meaningful. Make it look like you actually give a fuck about what your code looks like. Don't worry, you have enough time. Hell, you'll probably save some.


Saturday, May 17, 2014

C# In Depth this weekend

My copy of Jon Skeet's book arrived on Friday, and I must say, I'm only 15 pages in and am finding tons of stuff I wish I was already using! Lambda's are awesome...

Thursday, May 15, 2014

What causes variables to change? A Software Newbie Story.

As a newbie software developer I was always tripped up about the concept of assigning a value or reference to a variable. I'd notice that sometimes the variable value changes automatically if some events happens, while other times, it never does. I knew the basic concept of value vs reference that I had learned in school, but had never really applied it (and knew that I had applied it!). Then, I ran into a few problems where my variable would change without reason (seemingly), and questioned the basic concepts of variables.

Little did I know that a variable that is a reference type (and assigned an actual reference to an object) will change if other related objects change. For example, the value of a DataGridViewCell variable will change if you re-fill the dataset. However, a row index assigned to a value type (i.e. integer) will never change without you directly re-assigning it. It's an interesting concept that honestly still trips me up sometimes.

Anyway - A random story for ya.

Wednesday, May 14, 2014

Calling a CLICK METHOD from another method!

You know what I hate? When a developer decides to call a btn_Click method from another method. I mean, seriously, what the fuck? I work with a lot of older applications and many of them weren't written well. I think putting a btn_click method in the Form_Load spells "code being on the verge of unmaintainability" because all kinds of crazy shit happens.

For example, I'd show FormA, which would run the Load method of FormA. That Load method would run a click event that starts FormB. So the next thing I see in the GUI is FormB, not FormA! I was like, "WTF! I did NOT show that form! Madness!!!"

Click events planted in other methods (or EVENTS) are like planting bombs. They will go off with a bang if you do not disarm them.