TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Learning to code kept me sane when I was a diplomat

100 点作者 vikp超过 10 年前

13 条评论

elwin超过 10 年前
The article shows an interesting illustration of the disconnect between programmers and normal computer users. Like the author says at the beginning, any experienced developer knows that automating interaction with a GUI is a crazy idea. It&#x27;s a painful, fragile way to move data around. But to the author and anyone who&#x27;s done data entry, it&#x27;s an improvement to their workday that demonstrates the power of programming.<p>So much programming instruction seems designed to teach people who already understand programming how to solve problems that nonprogrammers wouldn&#x27;t even understand. A tutorial that started with automating tasks like this might be more effective than all the ones that start by demonstrating how to do basic arithmetic in $LANGUAGE and go on to a detailed explanation of $LANGUAGE&#x27;s object system.
评论 #8811813 未加载
评论 #8814075 未加载
评论 #8812835 未加载
评论 #8812260 未加载
评论 #8811615 未加载
评论 #8813026 未加载
Jezparov超过 10 年前
This is a really great post. For me, the recurring theme is knowing what&#x27;s possible.<p>From a class he took in high school, Vik knew that some sort of automation was possible. That spurred some reading and exploration, which led to some success.<p>Success led to thinking about other opportunities for automation and more exploration of what&#x27;s possible, which in turn led to more success.<p>To me, it absolutely doesn&#x27;t matter that things could have been done in other ways. Nothing to cringe about here. A developer can only use approaches that he&#x2F;she knows or suspects are possible.<p>In the day-to-day work of a developer, knowing what&#x27;s possible is perhaps the most important thing. Anything else can be googled.
评论 #8813041 未加载
SocksCanClose超过 10 年前
This is a fantastic article and illustrates a HUGE problem in government systems, where data gets aggregated, but not associated.
评论 #8811917 未加载
评论 #8812348 未加载
sinwave超过 10 年前
Oof. Had a hilariously similar experience doing data entry at my first internship, which was at a financial services firm.<p>I knew nothing about programming, but I had taken an intro stats class that had a few assignments in R. A super simple R script did half of my day&#x27;s work in seconds (plus some debugging because of course I did next to no error handling).<p>In retrospect, I&#x27;ve realized that if I knew a thing of two about regular expressions at the time, I would have been able to automate my whole summer internship.<p>So it goes.
techtalsky超过 10 年前
I haven&#x27;t seen much discussion of a more ideal way to solve this problem (to say: as a one-off like the author was doing, not reusable software), so I thought I&#x27;d just think about how I&#x27;d do something similar.<p>Luckily there are libraries that are great at interacting with a web page or multiple pages at the same time without needing to actually have a browser instance open. There&#x27;s selenium and its various scripting environments, which are meant for browser testing but work just fine for many automation tasks: <a href="http://www.seleniumhq.org/" rel="nofollow">http:&#x2F;&#x2F;www.seleniumhq.org&#x2F;</a><p>And, newer, are headless technologies like phantom.js: <a href="http://phantomjs.org/" rel="nofollow">http:&#x2F;&#x2F;phantomjs.org&#x2F;</a> and Dalek.js: <a href="http://dalekjs.com/" rel="nofollow">http:&#x2F;&#x2F;dalekjs.com&#x2F;</a><p>This is SO much easier than using Javascript to find purple links on a page, and so much more reliable.<p>He could have looked up each link on DB1, then used the data to look up the DB2 information.<p>In any case, what he did saved him hours and hours of time and started him on a lifelong interest in programming.<p>Also, obligatory relevant XKCD&#x27;s: <a href="http://xkcd.com/1319/" rel="nofollow">http:&#x2F;&#x2F;xkcd.com&#x2F;1319&#x2F;</a> &amp; <a href="http://xkcd.com/1205/" rel="nofollow">http:&#x2F;&#x2F;xkcd.com&#x2F;1205&#x2F;</a>
yason超过 10 年前
This is golden. I&#x27;ve wondered more often than once myself what would it be like to have a &quot;normal&quot; office job.<p>For instance, take some city department or some big firm where things generally flow at a slow pace and require a lot of time spent on work items, doing possibly repeated tasks each week. What would a programmer do? Exactly as described in the article:<p>- learn what kind of tasks the job consists of<p>- identify repeated actions and patterns in work<p>- think of a way to automate the easiest parts, still requiring human to finalise the task<p>- gradually learning more and automating the harder and harder parts and building tools bottom-up based on earlier blocks<p>- finally ending up with a software mechanisation puppet that I can instruct and program to do my work<p>- gradually spend first some of my time doing the automation and as it would slowly take over I could devote more and more of my time automating the rest, and when all is done, I would feel the job is &quot;completed&quot; and get bored.<p>This is something that feels so natural to a programmer: I have dozens of little tools to aid in doing my programming job at work. The goal of a programmer is to program anything that can be automated and only work himself on the hard tasks that can&#x27;t.<p>It&#x27;s intriguing to imagine how you could apply those skills outside programming jobs.
评论 #8817819 未加载
thebenedict超过 10 年前
Love it. I started my career in International Development and one of my team&#x27;s first projects was figuring out how many miles our organization&#x27;s 1000+ staff flew in a year (why is a separate story). The travel agent could only provide records in PDF. 1000&#x27;s of them.<p>The intern I shared an office with was assigned to go through each record, type the origin and destination airport codes into an online flight distance calculator, and enter the results in a spreadsheet. After two days of watching this I volunteered to take over and spent a few nights learning enough Java to read&#x2F;write CSV and make the HTTP request. Saved days of pain for the intern and was a satisfying accomplishment as a novice.
评论 #8817823 未加载
flashgordon超过 10 年前
Brings up old memories reading this. I remember my first job about 20 years ago at NEC as a data entry operator. It was 8 hours each day of taking a bunch of mal-formatted CSV files from some reports the previous day and importing it into excel and drawing graphs. I was just getting into learning C at the time and ended up writing an importer (parsing and formatting in C and ODBC to write back to excel along with excel macros to draw graphs). Very hacky and ugly but got the job done. It got the 8 hour job done in about 30 minutes - most of which was detecting patterns in the input and adding rules for those, which was fun in itself.
jdbernard超过 10 年前
Before you knock on &quot;writing code that clicks things&quot; remember that on Windows clicking things is the primary if not solitary interface to most of the system. Even the administrative interfaces are secondary to the visual interface. A lot of programs don&#x27;t offer an API available to outside processes.<p>The most important thing about any program is correctness: does it work and do what it is supposed to do. The only thing cringe-worthy about having to script GUI interactions is that fact that the operating system and environment requires it.
评论 #8812272 未加载
mjklin超过 10 年前
Why has no one mentioned Autohotkey? (<a href="http://www.autohotkey.com" rel="nofollow">http:&#x2F;&#x2F;www.autohotkey.com</a>)<p>It was practically made for this use case, and has an active community behind it. It even has its own script editor (SciTE4AutoHotkey) and was recommended as a Kevin Kelly-approved Cool Tool (<a href="http://kk.org/cooltools/archives/4147" rel="nofollow">http:&#x2F;&#x2F;kk.org&#x2F;cooltools&#x2F;archives&#x2F;4147</a>).<p>My go-to program for my desk job.
stefs超过 10 年前
this reminds me of when i started to code - find the first solution to the problem that comes to mind and hack it until it works, even if was something as abstruse as manipulating the UI. of course the outcomes were incredibly fragile and broke at the first possible moment, but in the end they still did the job they were supposed to do most of the time.<p>today i couldn&#x27;t do that anymore; i&#x27;ve grown too uptight to try any of those inefficient &quot;solutions&quot;. i guess i&#x27;d rather give up and admit defeat if there were no APIs or passable hacks (i&#x27;d say using phantom.js would be a passable hack) i could work with than solve the problems this way.<p>i&#x27;m usually unable to follow the advice given by the xkcd automatisation timetable described here: <a href="http://xkcd.com/1205/" rel="nofollow">http:&#x2F;&#x2F;xkcd.com&#x2F;1205&#x2F;</a> &quot;is it worth the time?&quot; - if a dirty hack is destined to run more often than once, i just <i>have</i> to make it passably elegant, readable and efficient. i&#x27;m sure nine out of ten times the effort is pretty much wasted.<p>i guess i&#x27;ve just grown old.
alexbecker超过 10 年前
&gt; I decided to write a program that clicked on things.<p>I cringed a little. I&#x27;m glad he&#x27;s learned enough to know now that this is not the right approach.
评论 #8811658 未加载
评论 #8811833 未加载
评论 #8812201 未加载
评论 #8811714 未加载
mschuster91超过 10 年前
The biggest problem is not the lack of code and automation.<p>The biggest problem is that apparently Guyana allows the US embassy to search their criminal records system:<p>&gt; Search a different database with a separate program (“DB2”) for criminal and other history<p>So either Guyana allows the US wholesale access to its criminal records system or the US systems gather this data more or less illegally from somewhere.<p>edit: downvotes? seriously?
评论 #8812047 未加载
评论 #8812158 未加载