您编写过的最难的程序是什么?

发布于 2024-07-17 11:51:20 字数 1459 浏览 8 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(20

笑着哭最痛 2024-07-24 11:51:21

几周前,我在一次面试中被问到了这个问题(仍然没有听说我是否得到了这份工作)。

对我来说,这是我在基本入门课程之后的第一堂编程课上的几项作业。 这是我的大学第一次开设网页设计课程。 由于是新项目,几位即将毕业的高年级学生报名参加,占班级人数的一半左右。 老师教过高级班,对班里的很多人都认识。 基本上,他是按照他们的水平来教授的,而不是针对班上另一半缺乏经验的人。

最困难的任务可能是编写纯文本浏览器。 我在解析各种标签时遇到问题并寻求帮助。 讲师说,好吧,如果你学过编译器课程,你就可以写一个简单的课程。 那时,“编译器”是一个黑匣子,它在程序运行之前做了神奇的事情。 我真的不知道那是什么,更不用说写了。

造成困难的是没有完成工作所需的工具,包括理解我在谷歌搜索时得到的结果。 (如果你已经了解你要找的东西,手册页和 API 就很棒,但不适合教菜鸟。)在我的合作经验中,当我有一位导师说:“如果你陷入困境时”,我学到了最多的东西。超过几个小时,请告诉我,以便我可以帮助您摆脱困境并继续前进。 比那些除了每周左右之外不想收到我的消息的人要好得多。

I was asked this very question in an interview a couple weeks ago (still haven't heard whether I got the job).

For me it was several assignments in my first programming class after the basic intro classes. It was the first time a course in Web Design was offered at my university. Since it was new, several graduating seniors signed up and comprised about half the class. The instructor was used to teaching senior-level classes, and already knew many of those in the class. Basically he taught it at their level, rather than for the other half of the class who were pretty inexperienced.

Probably the most difficult assignment was writing a text-only browser. I had problems with parsing for the various tags and asked for help. The instructor said, Well, if you'd had the Compilers course you could just write a simple one. At that point 'Compiler' was a black box that did magic things before the program ran. I didn't really know what it was, much less was I able to write one.

The thing that made it difficult was not having the tools necessary to do the work, to include understanding the results I got when I Googled. (Man pages and APIs are great if you already understand what you are looking for, but not for teaching a noob.) In my co-op experiences I've learned the most when I had a mentor who said, If you're stuck more than a couple hours, let me know so I can get you unstuck and moving along. Much better than those who don't want to hear from me except every week or so.

我乃一代侩神 2024-07-24 11:51:21

我正在开发 Yet Another PHP Framework,到目前为止这是一次有趣的旅程。

I'm working on Yet Another PHP Framework, which has been a fun journey thus far.

江南烟雨〆相思醉 2024-07-24 11:51:21

我目前正在编写 iPhone 应用程序。 这绝对是我写过的最难的程序。 不是因为语言困难、代码困难或任何其他原因,而是因为设备上的所有内容都必须如此流畅。

一切都必须看起来和感觉自然。 因为我是一个真正的程序员(对流畅性、流畅性或设计毫无了解……所以看来)这对我来说真的很困难。 该程序可以在代码方面工作,但在用户界面方面我很难完成工作。

线程也很糟糕;-)

I am currently writing an iPhone application. It is most definitely the hardest program I've ever written. Not because the language is difficult, the code is difficult or any other reason, but because everything on the device has to be so fluent.

Everything has to look and feel natural. Since I'm a real programmer (with nil understanding of fluency, smoothness or design .. so it appears) this makes it really difficult for me. The program works, code wise, but user interface wise I have a much harder time getting things done.

Also threads suck ;-)

雪化雨蝶 2024-07-24 11:51:21

没什么特别的,但是一个函数可以用三角形绘制一个“球体”,有 nxn 个点,并在两种颜色之间插入三角形(因此输入是半径、细分数、颜色 1、颜色 2)。 这很困难,但当它起作用时非常有趣:)

Nothing special, but a function that could draw a "sphere" with triangles, with n x n points and interpolated the triangles betweeen two colors (so the input was the radius, number of subdivisons, color1, color2). It was hard but very fun when it worked :)

╰ゝ天使的微笑 2024-07-24 11:51:20

我在 2005 年 6 月创建的应用程序可以让人们创建他们的房屋/汽车等涂成不同颜色的可视化效果。 现在这当然可以在 Photoshop 中完成,但还有很多很多的事情要做。

Viresol 输出预览

The application I created in 2005/6 lets people create visualisations of their houses/cars etc painted in different colors. Now that can certainly be done in Photoshop, but there was much, much more to it.

Viresol output preview

别想她 2024-07-24 11:51:20

编译器

a compiler

戴着白色围巾的女孩 2024-07-24 11:51:20

我不想写作,也不想享受写作的乐趣。

The one I didn't want to, or have fun, writing.

您的好友蓝忘机已上羡 2024-07-24 11:51:20

我曾经不得不编写一个使用 BWT(Burrows Wheeler Transform)的压缩算法,并且该算法中有一个步骤,您必须创建一个巨大的矩阵。 由于矩阵太大,我遇到了内存问题和速度问题。 事实证明,有一个非常简单的算法,我可以使用它并完全避免使用矩阵。

我还必须用 ASM 编写一个简单的操作系统,这非常棘手。

I once had to write a compression algorithm that used BWT (Burrows Wheeler Transform) and there is a step in the algorithm where you have to create an HUGE matrix. I had issues with memory problems and speed because the matrix was so huge. Come to find out, there is a really simple algorithm that I could've used and avoided the matrix entirely.

I also had to write a simple operating system in ASM and that was pretty tricky.

紫南 2024-07-24 11:51:20

我曾经制作过一个实时多摄像头视频处理软件,可以进行运动检测和累积直方图魔术,所有这些都在 33MHz 处理器和 640Mb RAM 上进行。 困难的部分是让这件事进展得快; 大约四年来,大量的哈希、位移、欺骗、咒骂以及吃披萨和顿悟的深夜。 哦,我还做了一个处理颜色的版本。 哦,还有一个可以在大房间(如核反应堆)中看到蒸汽和白烟之间差异的模块。 哈哈,你就试试吧! 在任何教科书中你都找不到这样的例子。 :)

I once made a real-time multi-camera video processing software, doing motion detection and cumulative histographic magic, all on 33MHz processors and 640Mb of RAM. The hard part was making this go fast; copious amounts of hashing, bits-shifting, cheating, swearing and late nights with pizza and ephiphanies for about 4 years. Oh, and I did a version dealing with color as well. Oh, and a module that could see the difference between steam and white smoke in large rooms (like nuclear reactors, as it were). Hah, you just try it! You wouldn't find examples of such in any text-book. :)

往日 2024-07-24 11:51:20

用于求解非线性偏微分方程的库。 我们在理论物理小组中使用它来解决在非常特殊的低温环境中发生的薛定谔方程的非线性适应问题。

让一个简单的求解器工作相对容易,但对其进行泛化并使其快速运行是一个挑战。

它目前在 Google 代码上开源:fdtl

A library for solving Non-linear Partial Differenential Equations. We used it in a theoretical physics group to solve a non-linear adaptation of the Schrodinger equation that occurs in very special low temperature environments.

It was relatively easy to get a simple solver working but generalizing it and making it fast was a challenge.

It's currently open source on google code: fdtl

中性美 2024-07-24 11:51:20

一款使用同一个代码库在 Windows 和 Mac 上编译和运行的应用程序。

An application that compiled and ran on both - windows and mac with one codebase.

樱桃奶球 2024-07-24 11:51:20

任何与加密和安全相关的事情总是比看上去困难 1000%!

Anything to do with encryption and security is always 1000% harder than it appears!

昔日梦未散 2024-07-24 11:51:20

用于不稳定在线服务的通用调制解调器驱动程序。 它还必须支持 30 种类型的调制解调器(Hayes 调制解调器之前)。 它们都有不同的时间特征。

对于我们产品的 CP/M 和 DOS 版本,它必须用 8086 和 Z80 汇编器编写。 我仍然会做关于某个半双工调制解调器的噩梦......

A general purpose modem driver for a flaky online service. It also had to support 30 types of modem (before Hayes modems). They all had different timing characteristics.

It had to be written in both 8086 and Z80 assembler for the CP/M and DOS versions of our products. I still have nightmares about a certain half-duplex modem...

ι不睡觉的鱼゛ 2024-07-24 11:51:20

使用 COM 实现自动化,并通过网格执行

Automation with COM, with execution across the Grid

满意归宿 2024-07-24 11:51:20

使用 ffmpeg API 的专有视频流类 - 在处理数据包并在正确的时间显示帧的级别,与音频同步。 不像列出的其他一些那么难,但它让我痛了好几个星期!

A proprietary video-streaming class using the ffmpeg api - at the level of handling packets and displaying frames at the right time, syncing with the audio. Not as hard as some of the others listed, but it kicked my butt for many weeks!

楠木可依 2024-07-24 11:51:20

可能是平局:使用 可满足性模理论 的集合决策问题求解器和 C 语言的协作进程调度程序/ASM 在 UNIX 操作系统之上运行。 第一个非常困难——在使用 SMT 之前从未做过,并且将高度理论性的论文转化为不同环境中的实际实现是很困难的。 第二个涉及挖掘操作系统数据结构以理解它们,然后替换一些片段以在程序中的函数之间来回跳转,就好像它们是单独调度的线程一样。

Probably a tie: a decision problem solver for sets using satisfiability modulo theories and a cooperative process scheduler in C/ASM that ran on top of a UNIX operating system. The first one was just plain hard -- it had never been done before using SMT and translating the highly-theoretical paper into an actual implementation in a different context was difficult. The second one involved digging to to OS data structures to understand them, then replacing bits and pieces to jump back and forth between functions in the program as if they were separately scheduled threads.

甜心 2024-07-24 11:51:20

调试器

a debugger

同尘 2024-07-24 11:51:20

我于 1998 年开始编写一个矢量图形库,它广泛使用分层细分来提供 O(log n) 中的许多操作以及 OpenGL 显示列表中存储的各向异性曲面细分,以在动态场景上保持高帧速率。 特别是,它可以流畅地放大复杂的矢量图形,因为它将它们分解成树并有效地剔除它们。 多年来,它一直是世界上最快的消费级矢量图形渲染器。

最初的版本是 200kLOC 的 C++,但构成其设计基础的理论问题花了我 2 年的时间才解决。

A vector graphics library I started writing in 1998 that made extensive use of hierarchical subdivision to provide many operations in O(log n) and anisotropic tesselations memoized in OpenGL display lists to maintain high frame rates on dynamic scenes. In particular, it could zoom into complicated vector graphics fluidly because it decomposed them into trees and culled them efficiently. For many years, it was by far the fastest consumer-level vector graphics renderer in the world.

The original version was 200kLOC of C++ but the theoretical problems that formed the foundation of its design took me 2 years to solve.

若有似无的小暗淡 2024-07-24 11:51:20

两件事:

1)编译器。 该语言的名称是“3-balls”(向一位操作球的朋友致敬)

2)一个没有单个宏的Windows汇编程序,所有内容都被推入堆栈,并且地址都是相对的。 它适用于所有 Windows(无地址编码)。 基本上它是一个简单的窗口,带有一些按钮和按钮。 标签。 但好处是,我从对象和可执行文件中提取了操作码并从中生成了 shellcode。 因此,我可以利用程序上的任何缓冲区,并在正在运行的应用程序之上创建我自己的应用程序! 很高兴在远程计算机上显示一个屏幕,并且远程计算机将执行他的计算机上不存在的程序,您实际上将要执行的程序发送到远程计算机。

当然,这太多的头缓存毫无意义……但它值得我输入的所有字节!

2 things:

1) A compiler. The name of the language was "3-balls" (tribute to a friend who had he's balls operated)

2) A Windows assembly program without a single macro, everything was pushed to the stack and the address were all relative. It works in all Windows (no address harcoded). Basically it's a simple window with some buttons & labels. But the nice thing is that, from the object and executable files, I extracted the opcodes and generated a shellcode from it. So I could exploit any buffer on a program and literally create my own application above the running one! Nice to show a screen on a remote computer, and the remote computer will execute a program that does not exist on his computer, you literaly sent the program to be executed to the remote computer.

Of course this is too much headcache for nothing... but it worth all bytes I typed!

吐个泡泡 2024-07-24 11:51:20

我编写了几段代码,在多个空间维度(从 3 维到高达 7 维)进行建模。当您处理无法实际绘制甚至可视化的内容时,问题会变得更加困难。

但实际上,作为一个花了大部分时间构建工具包供其他人在工作中使用的人,我认为我所做的最复杂的程序实际上是工具箱,是一组可以在同一环境中相互协作的工具。一致的方式。 因为它们都是为了协同工作而设计的,所以您可以说几十个实用程序实际上是作为一个工具来工作的。 (当然,任何模块化代码在这方面都是相似的。)在这里,我提供的通常也是建模工具,用于解决色彩管理问题。

I've written several pieces of code that do modeling in multiple spatial dimensions (from 3 to as high as about 7 dimensions.) Problems become harder when you work on something that you cannot actually plot or even visualize.

But really, as one who has spent most of my time building toolkits for others to use in their work, I'd argue that the most complex programs I've done were actually toolboxes, sets of tools made to work with each other in a consistent way. Because they are all made to work together, you can argue that several dozen utilities actually work as in fact one single tool. (Of course, any modular code is similar in this respect.) Here too, what I provided were generally modeling tools, made to solve color management problems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文