jump to navigation

You might be an engineer if… April 30, 2015

Posted by mareserinitatis in computers, engineering, research, science.
Tags: , , , , ,
add a comment

I know engineers have quirky personalities.  There are these things that most people take for granted that drives other people nuts…and vice versa.  The engineer will spend hours fixing something so it works just perfectly while others don’t care as long as it’s functional.

I realized lately that one of my big pet peeves has been programming languages.  Okay…that’s not just lately.  But still.  It really amazes me how you can do something so simply in one language but it’ll take you days to figure it out in another language.  I’ve been beating my head against this a lot lately.  While I learned programming a long time ago, as I went through my education, I learned other languages that had been optimized for working with certain types of problems.

So what am I dealing with now?  Languages that were among some of the first that I learned, and their offspring.

I have decided that I will be switching to do some of my work in another language, maybe even learning a new one that supposedly has a low learning curve.  On the other hand, I have to admit that my frustration certainly helps me to recognize the brilliance of the people who did all of their work in these languages.  The engineer in me can’t help but think the languages are clunky and inefficient.  I can’t be completely wrong, though: if they weren’t no one would’ve bothered to come up with new ones.

Advertisements

The Christmas Aftermath December 26, 2014

Posted by mareserinitatis in computers, family, younger son.
Tags: , ,
add a comment

Christmas presents are better when they have an element of DIY. The younger son is learning how to replace a laptop screen…

20141226-135440.jpg

Wordless Wednesday: There’s no place like 127.0.0.1 December 3, 2014

Posted by mareserinitatis in computers, photography.
Tags: , ,
2 comments

20141203-150648.jpg

The internet makes me impatient November 17, 2014

Posted by mareserinitatis in computers, research.
Tags: , ,
add a comment

I really, really needed to get ahold of a book.  I looked at all three libraries I have access to.  One has a hard copy, but it’s a couple hours away so getting it would be tough (to say the least).  The second library said it was available online, but apparently the institutional subscription doesn’t cover that book.  The price of buying it is $15/chapter.  The other library had no idea what I was talking about.

I went onto Amazon to check if a digital copy was there.  It’s not.  It’s an older book and so there isn’t a kindle version.

I finally gave up and bought a copy of the book, but it won’t be here until Wednesday.

Part of me is very annoyed I have to wait that long for a book.  Another part of me remembers only 10 or 15 years ago when I would have to order journal articles through interlibrary loan and they sometimes took a couple weeks to show up.  I would be waiting for a day or two, but then I’d end up working on something else that I found distracting.  It kept me going for a while, but then I would realize I was stuck without the paper, at which point I’d start getting irritated again.

I think I’m getting more impatient as I get older, though.  As you can see from the graph below, it’s a straight shot upward.

waiting_for_publications

 

This scares me because my kids are already used to the situation where books are instantly available or they only have two wait a day or two to receive something.  What are they going to be like as adults?!

Or worse yet…what will I be like in another 15 years?

The powerful prevalence of parachesis January 15, 2014

Posted by mareserinitatis in computers, engineering, humor, meta, papers, science, work.
Tags:
add a comment

I was going through my to-do list for the week:

1 – Paper review

2 – Paper writing

3 – Patent application

4 – Proposal preparation

5 – Program simulation

How did I never notice before that just about everything I do starts with the letter P?

Oops…I forgot to add “Post to blog!”

And now I will publish…

I hate computers December 9, 2013

Posted by mareserinitatis in computers, grad school.
Tags: , , ,
add a comment

pulling-hair-out

I hate it when things don’t work the way they should….like when your software license that’s supposed to last for one year suddenly stops working after 8 months.

Sadly, that was pretty much the highlight of the day.

Wordless Wednesday: To find your P-value September 17, 2013

Posted by mareserinitatis in computers, math, photography.
Tags: , , ,
5 comments

use_r

Does this make me multilingual? July 16, 2013

Posted by mareserinitatis in computers, electromagnetics, engineering, grad school, math, physics, research.
Tags: , , , ,
3 comments

I began my programming education quite young and have maintained my skills over the years.  I have recently been thinking of documenting some of the various languages and software programs I’ve learned to use, so here is as good a place as any.

  • 4th grade – TI Basic
  • 8th grade – Logo
  • 10th grade – BasicA and Apple Basic (pretty close to the same thing)
  • 12th grade – Fortran and QBasic (these were at the college)

In college:

  • took a class on C and had to learn unix, too
  • learned Maple in a calc course
  • learned matlab for a research project and used it extensively in a numerical analysis course
  • learned mathcad for a physics lab course
  • learned mathematica for intro to differential equations and used that for many other classes

During my MS, I was exposed to half a dozen software packages for computational electromagnetics modeling (half of which are trademarked, so I’m not going to bother listing them).

In the past couple years at work, I’ve gotten pretty handy with Scilab.

After all of this, you would think that I have a pretty complete toolkit.  I should be able to do pretty much whatever I need with what I’ve already learned.  I find it ironic, therefore, that I am back to using Fortran (one of the first things I learned).  I also have been spending the past month trying to learn IDL (which, if you don’t mind me saying, seems like a less friendly version of matlab), so there is something new, again.  Also, I have people pestering me to learn python.

Looking at this list, I’m starting to think I’m learning things so that I can simply forget them again later.  I’m pretty sure I’ve forgotten more than I remember.

Doesn’t anyone ever comment any more? June 26, 2013

Posted by mareserinitatis in computers, research.
Tags: , , ,
3 comments

While the title above may seem like a complaint about the blog, I am fairly certain that the lack of commentary is probably due to the lack of posting.

Instead, however, I feel like complaining about another issue (one I’ve likely addressed before): lack of comments in code.  One thing that frustrates me about teaching students to program is that they are generally unaware of how important it is to comment your code, particularly when that code is for a research project and may need to be picked up by someone else.

I guess I’m getting old enough that I’ve had several instances of attempting to pick up an old piece of my own code and realizing what a horrible job I did in commenting.  I’m now incredibly thorough when commenting my code so that I’ll be able to go back to it later and understand.

The real issue is, however, that no one ever taught me how to comment code.  It’s something I had to figure out for myself.  The only thing I ever saw was one brief section in Darnell and Margolis’ book.  While I agree with the Do’s they listed, I strongly disagree with a couple of the Don’ts:

  • Do not describe how a piece of code achieves its purpose.  This should be obvious from the code itself.
  • Do not repeat the code.  Comments should contain additional information that cannot be construed from the code itself.
  • Try not to use comments to explain the purpose of variables.  Instead, use meaningful variable names.

While I agree with the second bullet, I’ve learned over time that the first and third are bunk.  Specifically, there is this notion that well-written code should make it obvious as to what is being done.  Maybe if you’re the only person looking at your code, but that’s usually not the case.  As much as we would like to think that meaningful variable names will substitute for explanation in the comments, I’ve found that one person’s meaningful variables may not be that to another person and will probably require significant elaboration.  Further, truly meaningful variable names often need to be rather long, and few people want to take the time to type out names that would be exceptionally clear.  (And then there’s the programmer I knew who used exotic dancer’s names for his variables.  His code was a nightmare to debug.)

The first bullet is the one that really irritates me, however.  I have pulled up code I wrote from a class to use in another class and been completely confused because it had been years since I looked at it.  During the second go-around, I realized there was a chance I may end up using it again, so I started adding things in.  Specifically, I put in the comments that it was algorithm to do linear interpolation.  I even put a reference to the book I got the algorithm from, including page numbers, and what the inputs would need to be (including format requirements) as well as the outputs.  I mentioned what needed to be changed to use the code for other programs.  Finally, I went through and explained what was happening in each step or loop and what the variables meant (e.g., k is a counter, c is the coefficient array).  Without *all* this information, it was impossible to take the code I’d written and modify it for another use without putting in some significant effort.

The reason I went into such elaborate detail (and continue to do so) is that a lot of code, particularly when dealing with algorithms, is almost never intuitive.  If that were intuitive, references like the numerical recipes books would be useless.  (Well, they kind of are, but you know what I mean.)  Therefore, contrary to the advice given above, comment everything, how it works, what your variables mean, etc.  You and anyone else who uses your code later will be very appreciative.

%d bloggers like this: