For my part, I program to avoid using exceptions most of the time, and prefer to pass error values instead. I do most of my programming in C++.
When I have to use something that forces me to catch exceptions, I catch them, and react accordingly.
I also try to do the whole RIIA thing (or whatever that acronym is) where you use constructors to create resources and destructors to remove them in a clean fashion, so an exception will automatically clean things up for you.
Still, Python will allow you to walk an exception stack, as I recall, so at least you can work out why your program stopped, and take action accordingly.
There's no doubt about it, Python is a nice language. If I had to choose between it, Perl and Ruby, Python usually comes out on top. Clean, crisp, readable syntax. The indenting thing is not the way I would have designed it, but I can live with it.
If your job requires you to occasionally wade through academic papers describing complex algorithms, you'll find that an increasing number of authors are expressing their pseudocode in a suspiciously Pythonesque syntax.
I am a fan of Python for quick what if proggies and have made some use of the ctypes module for extra added fun poking around in C libs:
You don't have to re-write C libraries, just use them from Python.
I do tend to use Python where I used to use BASIC back in the day. Haven't made the leap to using it as my shell, though. Maybe my kids will?
Tue Mar 27 2012 16:24:48 EDT from fleeb @ Uncensored
Well, that's true. In C++, the only stack you'll get is if you're in a debugger... otherwise, you'll need the luck of the gods to help you track down an exception.
at least in linux, its not like that.
does a simple backtrace...
Yeah, I'm not aware of anything like that in Windows.
Subject: EC2 FF11 and EC2.....
I have not used EC2 yet, so hopefully someone else can chime in. I have used Selenium, but not on an EC2 instance, so apart from adjusting for timeout issues, I have not had issues with Selenium and I have not had the FF instance die.
Thu Apr 26 2012 05:26:00 PM EDTfrom kc5tja @ Uncensored
(sorry -- for context, .rl or .ro in the Web Stuff> room to find my question concerning Firefox deaths on EC2, particularly when launched from Selenium 2.)
Well, long story short, Firefox 11 (launched by Selenium) is dying intermittently with a premature EOF, causing pain and suffering throughout the world. Or, at least, my office.
The same configuration as used in EC2 appears on my laptop, where I am so far unsuccessful in getting Firefox to die. I have to manually kill it to reproduce the symptoms as I'm seeing them in EC2.
I was hoping that someone here would be able to offer some advice on how to proceed with the debugging effort.
Subject: Re: EC2 FF11 and EC2.....
I know that at the bottom tier, they can choke off performance to the point where things really start to be baaaaaaaad...
How hard is it for you guys to jump from one kind of programming job to another within a given day?
Or, more interestingly, to jump from programming work to technical support, back to programming again within the day?
I do not tend to think of this as easy. It takes me a while to get back into my programming groove again whenever I have these interruptions. Yet everyone for whom I have worked tries to make me do several things within a given day, decreasing my efficiency ridiculously (to the point now where I can't even estimate how long it would take me to do anything, since I can't rely on uninterrupted time).
I don't believe I'm unique in requiring uninterrupted time, but I just wanted to confirm this with other programmers.
account when estimating. If you can deal
with theadministravia, you should also record
how you spend your time throughout the day.
tThose two numbers will allow for better
Theoretically, agile processes try to
decouple "points" from real time because it
accounts for interruptions better. Theory and
reality are only theoretically related
though. I find the extra layer of
abstraction annoying, and even misleading. I
find working with wall-clock time estimates
both more natural and more precise.
Right, but that didn't answer my question, really, and would be more appropriate in the Workplace room.
My question had to do with the degree to which interruptions disrupt programming work.
I guess I should point out why I'm asking.
It's mostly curiosity. Some places have as a requirement 'must multi-task well', which makes me wonder if businesses casually expect someone to be able to do things like work through complicated mathematical formulaes without error while simultaneously reciting the Gettysburg Address, or something equally amazing (by way of a mental feat).
If my own mental acuity is actually relatively weak compared to my peers, I should know this, and regard it as a limitation on my abilities... maybe even to the degree that I should consider work in another field.
May 8 2012 1:20pm from fleeb @uncnsrdYes, absolutely they do. :) It's just the nature of business. I haven't yet met a manager who _didn't_ understand that engineers offer best performance when serializing their tasks. However,
It's mostly curiosity. Some places have as a requirement 'must
multi-task well', which makes me wonder if businesses casually expect
someone to be able to do things like work through complicated
mathematical formulaes without error while simultaneously reciting the
Gettysburg Address, or something equally amazing (by way of a mental
company demands from higher up requires the need for multitasking. I've been trying to find a suitable way to find a happy medium myself.
Perhaps not relevant, but as a test engineer, I just realized that, over the last three scrum iterations, I've not written a single line of code. That changed during
last Thursday (where I
wrote a bunch of Z-notation for a MUST-HAVE-IT-DONE-YESTERDAY-OR-WE'RE-OUT-OF-BUSINESS priority crack-commando-coding project) and Friday (where I actually wrote the corresponding executable
code for it), but looking at my projects going forward, I don't see myself coding for many weeks to come. I find that my time is divided at least five different ways right now -- build
engineering tasks, test infrastructure management (devops stuff), perf-testing (overseeing 3rd parties who, in turn, write the code to perf-test), process engineering, and to a more limited
extent, writing blog articles to make our organization look appealing to new hires.
If my own mental acuity is actually relatively weak compared to myI think what you're experiencing is normal. What companies demand of their people is also normal. The problem, as I see it, no-one has yet found a transformer to match the two impedances
peers, I should know this, and regard it as a limitation on my
abilities... maybe even to the degree that I should consider work in
between engineers and management requirements. :( The first person who does can found a consulting company and get rich overnight from his/her services.
I suspected I wasn't particularly unusual, having remembered this kind of topic coming up on Slashdot many years ago, but I somewhat wondered if maybe something changed along the way.
Yeah, I understand about business demands, but it feels to me like it's cheating.
By getting the engineer to multitask ridiculously, you save money at the expense of the quality of the work.
At my current job, I'm multitasked to such an extent that I lack job satisfaction, and have threatened to leave if it continues. We need tech support and quality assurance engineers to keep me from going insane, and while we have people for that, I'm concerned that the status quo will continue. But, again, that isn't the topic I intended for this room, and it's something I'm working on separately.
I really just wanted to make sure I wasn't really that unusual in requiring focus to do my job properly.