For what it is worth, LLVM was birthed in academia.
Ask HN: What’s the biggest difference between professional coding and academia?
21–30 of 54 posts
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#22Re: Ask HN: What’s the biggest difference between professional coding and academia?
#23In academic systems papers, every performance claim needs to be backed up by an experiment. But you can get credit for features even if you argue that it is possible to implement that feature with your design, even if you didn't actually do it. In production software, this is flipped. Every feature claim needs to have an associated test, as it's a contract with your user. But when it comes to performance, everyone ju…
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#24Operations. Forward and backward compatibility concerns. In professional coding, good enough beats cute implementations that no one will see.
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#25https://news.ycombinator.com/item?id=14692691
Copy&pasting my response there:
---
Why is code coming out of research labs/universities so bad?
1. DON'T SEE WHY CLEAR CODE MATTERS
Academic projects are typically one-offs, not grounded in a wider context or value chain. Even if the researcher would like to build something long-term useful and robust, they don't have the requisite domain knowledge to go that deep. The problems are more isolated, there's little feedback from other people using your output.
2. DON'T WANT TO WRITE CLEAR CODE
Different incentives between academic research (publications count, citation count...) and industry (code maintainability, modularity, robustness, handling corner cases, performance...). Sometimes direct opposites (fear of being scooped if research too clear and accessible).
3. DON'T KNOW HOW TO WRITE CLEAR CODE
Lack of programming experience. Choosing the right abstraction boundaries and expressing them clearly and succinctly in code is HARD. Code invariants, dependencies, comments, naming things properly...
But it's a skill like any other. Many professional researchers never participated in an industrial project, so they don't know the tools, how to share or collaborate (git, SSH, code dissemination...), so they haven't built that muscle.
The GOOD NEWS is, contrary to popular opinion, it doesn't cost any more time to write good code than bad code (even for a one-off code base). It's just a matter of discipline and experience, and choosing your battles.
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#26In academic systems papers, every performance claim needs to be backed up by an experiment. But you can get credit for features even if you argue that it is possible to implement that feature with your design, even if you didn't actually do it. In production software, this is flipped. Every feature claim needs to have an associated test, as it's a contract with your user. But when it comes to performance, everyone ju…
This is not a good rule of thumb, it depends on what your research is. In most cases I've dealt with (security) the academic software displays terrible performance characteristics and is very buggy. The industry application that surfaces years later does not have these problems but it doesn't present anything novel.
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#27Re: Ask HN: What’s the biggest difference between professional coding and academia?
#28Previous HN discussion: "Why can't you guys comment your fucking code" https://news.ycombinator.com/item?id=14692691 Copy&pasting my response there: --- Why is code coming out of research labs/universities so bad? 1. DON'T SEE WHY CLEAR CODE MATTERS Academic projects are typically one-offs, not grounded in a wider context or value chain. Even if the researcher would like to build something long-term useful and robust…
Who is that clown? and why is the shit-post of a 4-day old reddit account being discussed all over the interwebs like gospel?
That person very likely has regrets not finishing high school and is venting frustration in the form of misplaced anger.
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#29In academic systems papers, every performance claim needs to be backed up by an experiment. But you can get credit for features even if you argue that it is possible to implement that feature with your design, even if you didn't actually do it. In production software, this is flipped. Every feature claim needs to have an associated test, as it's a contract with your user. But when it comes to performance, everyone ju…
The code that comes to mind had the following properties: over 20 years old; written in C and badly converted to C++ somewhere along the way (the stuff-all-the-globals-into-a-class approach); a combinatorial explosion of #define and #ifdef statements (covering all the experiments in the original paper)
In the paper, it is clear that one of the experiments wins, and why. So...
Step 1: remove all dead code.
Step 2: observe that the algorithm needs no dynamic memory allocation, remove all but 1 call to malloc, calloc, realloc, and free.
Step 3: the use of float can be replaced by correctly scaled 64-bit unsigned integers, with no loss of precision
Step 4: rewrite entirely in modern C++, this has two benefits, a) I get to use the library (judiciously, this simplifies the code enormously), and b) the code can send clearer messages to the compiler than the mid-90s liberal sprinkling of the 'register' keyword.
The net result is no asymptotic improvement whatsoever — arguably a slight improvement for very large N as heap performance starts to interfere, but nothing worth the effort.
However, the code now has tests (step 0), is clean and maintainable, is 10% of the size, and is 5-30x faster (depending on the shape of the data)
Re: Ask HN: What’s the biggest difference between professional coding and academia?
#30On a more serious note. In addition to what is already mentioned by others on quality, performance and so on I'd like to add that in professional career you most likely work with a (larger) team. Which means you will run into code conflicts where code is reused for different purposes and you cannot simply change it. In addition you have to think about readability and documentation as your colleagues have to be able to understand the code without losing too much time or needing you.
You will also always have to work with legacy code. Most likely code you want to change but can't considering the timelines.
You will have to sync your design with many others. You might have to convince them or discuss issues with conflicting requirements or deadlines. There will be times you can't finish your entire design and have to think of a staged introduction or even harder, change it so it can work with only 50% of the design.
Also, your code has to run for many years. You can't simply take an expirimental third party package maintained by a single person. Too risky. You have to think about hardware expiring or no longer being supported (especially with gpus).
You gave to think about licenses. Academia is usually free. With professional you have to take a close look.