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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Small pleasures of programming (2020)

78 点作者 jasim将近 3 年前

8 条评论

agentwiggles将近 3 年前
I have recently been working through last year&#x27;s Advent of Code puzzles in Elixir. I finished the puzzles in 2020 and picked my old repo back up.<p>I recently had the pleasure of reusing some old code I wrote for a previous puzzle. I pulled the code out into its own module, added some docs, rethought some decisions, and got it working better. I learned how implementing protocols works and made it work with all the built in Enumerable functions. This is one of the first times in my life I looked at year-old code and thought &quot;hey, this is actually useful!&quot;<p>The project has been an awesome learning experience and entirely self directed. I pulled in a cool graph library for one puzzle in 2020. I wrote custom mix task for generating puzzle skeletons. It even downloads the puzzle input automatically now! I learned to use a benchmarking tool to satisfy some curiosity about differences between two different implementations. I&#x27;ve gotten way better at using recursion to solve problems. Today, I cloned the Elixir source code to get a better understanding of a particular language feature.<p>None of this stuff was necessary, and indeed it&#x27;s not even technically useful - these puzzles are toy code, and I&#x27;m sure my implementations could be better. But I&#x27;ve just been enjoying the hell out of Elixir and going the extra mile doesn&#x27;t feel like work, just more fun to be had.
评论 #32293272 未加载
EvanAnderson将近 3 年前
Back in the 90s I wrote code for an x86 floppy bootsector to produce a little graphical display— a gradient background in VGA mode 13h with some text. Nothing too fancy.<p>I’d set the direction flag as part of programming the palette registers and forgot to clear it before the loop that displayed the text.<p>As a result of the “wrong” direction flag all my text appeared backwards.<p>I added a CLD instruction to clear the direction flag, “costing” one byte, reassembled and re-ran the code and found that it worked as-expected.<p>Then I got the idea to go remove the CLD (getting my byte back) and just reversed the text strings in the source. Then, when displayed with the “wrong” direction flag the text appeared “right”.<p>I still giggle about the simple pleasure that brought me, 26 years later.
评论 #32294375 未加载
jylam将近 3 年前
I&#x27;ve never been so &quot;in the zone&quot; than while coding on small CPUs in assembly for fun. I write 6502 (on Oric Atmos, an 1983 computer) and LR35902 (the GameBoy CPU, basically a mix between a z80 and a 8080).<p>Those CPU are very simple, you have like a dozen instructions, 4 or 5 addressing modes, that&#x27;s it. You can infer the cycles count from each instruction by the addressing mode, mostly.<p>The machines those CPU run are a bit more complex than just the CPU, but after some time you get to know them perfectly. You can think about an algorithm in your shower or on the way back from work, and code it like a robot, directly from your brain, you figured everything out to the last detail just in your head.<p>That&#x27;s very, very rewarding. I&#x27;ve never got this kind of feeling while playing those coding games, like Zachtronics&#x27;s, although I&#x27;ve enjoyed some of them. I played Factorio for hundred of hours, that&#x27;s very pleasant, but the UI gets in the way and you know the problem already has been solved.<p>I very much encourage you to try assembly on 8bits computers, coding graphical effects and demomaking stuff and all. That is, if you don&#x27;t have kids and all, that takes time :)
siddontang将近 3 年前
For me, programming not only brings me pleasure, it also brings me peace of mind. Programming can quickly put me in a state of mind flow.<p>My most recent experience was when I was learning Next.js. As a distributed database engineer, I nearly have no knowledge of web development, but I really want to show some database demos on the Web. So one night, I began to learn Next.js from scratch - I tried to connect to the database, query the result and then render the chart. After I deployed the application on Vercel, two hours had passed.<p>I felt tired but very excited. I believe this is the pleasure of programming :-)
bobsmooth将近 3 年前
I love problem solving but I hate programming. I was using PIL the other day to format images for a tiny LCD. The logic took me 20 minutes and was very enjoyable. Figuring out the idiosyncrasies of the library took double that and was maddening.
评论 #32293383 未加载
评论 #32294144 未加载
评论 #32293985 未加载
malkosta将近 3 年前
For me, it feels like a superpower: we control the electrons. We make them work for us.<p>In past, all we could do was fire. Later light. Now we can make them store, process and present information.<p>Not everybody can do it, just programmers.
liketochill将近 3 年前
I was in power plant automation and solved a number of new challenges in the renewables field. Now that i am managing the type of plants I used to work on I don’t find it nearly as satisfying. It is a continual stream of work to Try and prevent anything from going wrong with the equipment, but everything has a limit and with extreme heat, forest fires, floods, and rivers exceeding 1 in 1000 year flows things go wrong. There is no joy in finishing anything, the best outcome is no major unplanned outages, but I can’t prevent forest fires from burning down power lines.
aschearer将近 3 年前
The author does a great job sharing his joy for programming. Programming&#x27;s pretty great!