News for hackers. Stuff that matters.
Re:Time spent programming is often time well spent by larrywright on Wednesday September 23, 2020 @09:21AM (#24566707)
I’ve worked on a lot of personal projects over the years that were never finished or were quickly abandoned. I used to feel bad about this, feeling like I had wasted my time. But then I realized that I learned a ton by doing all of this work. Often I’d have a need for what I learned a year or two down the road. So now I take the attitude that if I learn something, time spent programming is never wasted.
Re:Time spent programming is often time well spent by earthboundkid on Wednesday September 23, 2020 @12:48PM (#24569035)
There's a joke that every web developer makes a personal page by first writing a custom bespoke CMS over a couple of months and then only using it for one "Hello, World!" post, but honestly, I've found that's been a great use of time for me. When I do real work projects, I've ended up saying "Didn't I solve this for my blog a year or two ago?" and then I dig up the code and reuse it. It's a great learning experience, and I think every web developer should do it.
Re:Time spent programming is often time well spent by munificent on Wednesday September 23, 2020 @12:59PM (#24569193)
> There's a joke that every web developer makes a personal page by first writing a custom bespoke CMS over a couple of months and then only using it for one "Hello, World!" post

I might be able to top that. About eleven years ago, I went through this process:

1. I wanted to redo my web site. But I hated using PHP which is all my shared host allowed.

2. Maybe I'll design a little programming language that transpiles to PHP. Then I can program my site using that.

3. I have the parser working and producing an AST. You know, writing a little interpreter that walks that AST is practically trivial. I'll do the PHP backend later, but let's give that a try.

4. Whoa, I have a working language! Neat! But, man, that tree-walking interpreter is slow. Maybe I could translate the tree to bytecode and write a little bytecode VM...

5. Bytecode is so fun! But I'm relying on the .NET VM for most of the heavy lifting like the GC and object representation. I wonder how that stuff works. Maybe I should try writing a little VM in C++...

6. That wasn't as bad as I expected. I learned a whole bunch. Maybe I should write some of this down.

So, uh, now I work at Google on a programming language and wrote a textbook on building interpreters [1]. I never did finish that website. (I just ported my blog to Jekyll at some point instead.)

[1]: http://craftinginterpreters.com/

Re:Time spent programming is often time well spent by TeMPOraL on Wednesday September 23, 2020 @04:20PM (#24571504)
That's one hell of a story! Myself, I only got as far as implementing a CMS with a virtualized filesystem with symlinks (and I think it was even rudimentarily distributed); lots and lots of pointless wheel reinvention, but I've learned tons of stuff and ultimately managed to use it to skip a subject at university. What I didn't manage to do is to use it to build my website (ended up keeping my Wordpress blog, later replaced by a DIY static site generator).

I've seen you around here a lot and enjoyed your comments, but until now, I never realized you're the author of "Crafting Interpreters" and "Game Programming Patterns"! These are some of the best resources I've ever read on-line! Thank you for doing those!

Re:Time spent programming is often time well spent by munificent on Wednesday September 23, 2020 @04:43PM (#24571783)
> These are some of the best resources I've ever read on-line! Thank you for doing those!

You're welcome! :)

Re:Time spent programming is often time well spent by RotANobot on Wednesday September 23, 2020 @03:55PM (#24571201)
You must have really hated PHP.
Re:Time spent programming is often time well spent by munificent on Wednesday September 23, 2020 @04:28PM (#24571602)
Literally laughing out loud now. Yes, this is a pretty fair observation.

I read once that a famous author got started because they read some trashy novel and was so incensed that it had been published that they decided they could do better.

Re:Time spent programming is often time well spent by a1369209993 on Wednesday September 23, 2020 @06:16PM (#24572752)
> I read once that a famous author got started because they read some trashy novel and was so incensed that it had been published that they decided they could do better.

Jim Butcher with Dresden Files, or someone else? Because that pattern-matches to "highly promising book recommendation" for me.

Re:Time spent programming is often time well spent by gcapell on Wednesday September 23, 2020 @08:12PM (#24573828)
AIUI the scenario with Jim Butcher and Dresden Files was that he was _trying_ to write some "genre hack" novel, and succeeded despite himself: https://www.tor.com/2008/07/25/sdccjimbutcherinterview/

"... struggled mightily until deciding (out of frustration) to reverse course and follow Chester’s rigorous writing techniques to the letter, doing all the plot outlining and character background sheets and so on that the English literature folks often scoff at as the workmanlike tools of genre hacks."

Re:Time spent programming is often time well spent by munificent on Wednesday September 23, 2020 @06:44PM (#24573074)
I want to say it was Richard Matheson who said that, but I could be misremembering.
Re:Time spent programming is often time well spent by atum47 on Wednesday September 23, 2020 @04:10PM (#24571388)
well, isn't that a great story.

    - So, tell me, how did you land a job on Google?
    - Yeah, I was trying to redo my website...
Re:Time spent programming is often time well spent by munificent on Wednesday September 23, 2020 @04:43PM (#24571768)
My "how I got a job at Google" story is even more bananas.

Roughly around this same time, I was a very burned out game developer at EA. My job was doing data analytics on telemetry data reported by games. Basically, any time you started a game of Madden, the game would phone home to an EA server and tell EA which stadium you picked, which teams, game mode, etc. EA wanted to use that data to know what to prioritize in future versions. I was working on some rudimentary code to scrape those log files. Nothing that felt like making games in the least.

At the same time, my employment contract prevented me from doing game stuff on my free time. Most game companies essentially own your brain and don't let you do your own game-related stuff on non-work hours. So here I was nominally in the game industry and because of that, I was doing less stuff that felt like making games than ever before. It sucked.

In a fit of pique, I made a throwaway account on Reddit to whine about this. A complete stranger saw and said, "Well, if you know C++, Google is hiring and I could give you a referral..." I already had an interview lined up at ArenaNet in Seattle at the time. The recruiter for Google rushed to get an interview with Google going while I was in Seattle. I wasn't super interested because what the hell do I know about working on search engines and server stuff? However, I wasn't about to turn down the opportunity to see a Google office. My plan was to stay in games.

Then I bombed the ArenaNet interview because the interviewer didn't know what amortized complexity was and I couldn't do a good job of explaining it. (They asked what the cost to append to a growable array was and I said "constant time on average" and they looked at me like I was an idiot.)

Somehow, I managed to squeak through the Google interview. I had no idea at the time how few people get offers. If I did, I probably would have been a lot more nervous and fucked up the whole thing.

So, yeah, I got a job at Google and moved across the country because of a whiny throwaway account I created on Reddit.

Re:Time spent programming is often time well spent by earthboundkid on Thursday September 24, 2020 @12:41PM (#24580532)
I too got a job from posting too much on Reddit. Another user told me to apply to work with him, and that became my career when academia didn't work out.
Re:Time spent programming is often time well spent by atum47 on Wednesday September 23, 2020 @05:09PM (#24572067)
that's really cool. After some code I posted here on HN got featured on top 10, another Brazilian guy from Google asked me if he could refer me. I accepted right away. Stopped everything I was doing to study for the interview. I Applied for 3 job openings using their internal tool (two outside Brazil and one here), but never got called to an interview. Probably for the best, I suck at programming with a timer on.
Re:Time spent programming is often time well spent by richajak on Friday September 25, 2020 @12:31PM (#24591543)
I haven't progressed that much in my CMS, :-) still in-progress. It is not as simple as I think. In addition to the typical blog implementation, I also add extra features.

For example, I included multi-lingual functionality as I wanted google to give me better result when people searched the keyword in my city.

As I had never been satisfied with my design, I found a way how to safely separate content and layout /color/etc. Then I was curious if anyone visited the website, a simple analytics was built. Wait, I also wanted to know in real time of any visit, so I set mobile notification if anyone visited the page or clicked on specific button. This list keeps.... haven't mentioned about my form builder, dynamic popup, and chatbot.

Thanks for sharing the experience, I thought I was that unique.

Re:Time spent programming is often time well spent by joekim on Wednesday September 23, 2020 @03:56PM (#24571214)
Awesome story. Thanks for sharing! Checking out your book.
Re:Time spent programming is often time well spent by tester756 on Wednesday September 23, 2020 @04:45PM (#24571797)
thank you for sharing knowledge
Re:Time spent programming is often time well spent by larrywright on Wednesday September 23, 2020 @12:57PM (#24569160)
Exactly. If I’m curious about a technology, no matter what it is, I know that if I build something with it or even just set it up myself and play around with it, I will learn a lot more than if I just read the README or a tutorial written by someone else.
Re:Time spent programming is often time well spent by hinkley on Wednesday September 23, 2020 @05:21PM (#24572199)
It used to be said all applications evolve until they can handle email, but maybe that should be CMS, or CMS and email. I am fairly certain that 'bespoke CMS' is consuming enough developer-hours to largely account for the 'developer shortage' we have. If you supply an extra dozen developers, eight of them will end up working on another bespoke CMS.

Off the shelf CMS ends up being a mix of feature factories and lock-in traps, though, which probably explains why NIH is so particularly pernicious in this case.

We need a SQLite for CMS.

Re:Time spent programming is often time well spent by larrywright on Wednesday September 23, 2020 @08:44PM (#24574113)
I'd be lying if I said I hadn't built my own CMS. Twice.
Re:Time spent programming is often time well spent by MrPowers on Wednesday September 23, 2020 @09:47AM (#24566989)
As a corollary, time spent answering StackOverflow questions or blogging is also a great way to learn. Writing code & the blogging about it is the best mix for me.
Re:Time spent programming is often time well spent by cpb on Wednesday September 23, 2020 @11:17AM (#24568094)
For blogging, how do you overcome the perception that you have nothing new to add to the discourse?
Re:Time spent programming is often time well spent by Jtsummers on Wednesday September 23, 2020 @11:23AM (#24568139)
Shift your focus. You're not writing for others (strictly) but for yourself. Express your ideas, thoughts, what you've learned. I write a lot, but don't publish, and it's for that purpose. The act of writing is an act of communication, which forces you to formulate your ideas into more coherent forms (and to try and remove ambiguity). If you've just learned a topic, or are learning it, and want to write about it, it makes you think about how to express what you've read or studied (ideally try to do it from memory versus pulling up the references you've been studying).

It's similar to the benefit of teaching, my classmates and I always learned more (in undergrad) by teaching each other in a quasi-seminar format in the computer lab during our study sessions. Someone would naturally take over after a bit as the "teacher" for the session as they found that communicating what we were studying to the rest of us clarified their ideas. Blogging can be similar.

Re:Time spent programming is often time well spent by waterhouse on Wednesday September 23, 2020 @05:08PM (#24572043)
> It's similar to the benefit of teaching

I would throw in "rubber duck debugging" as another similar activity known to produce similar results.

Re:Time spent programming is often time well spent by groby_b on Wednesday September 23, 2020 @11:55AM (#24568506)
Unless you're at the absolute top of the field, it's very unlikely you'll ever add something new to the discourse. That's not a problem, though.

There are two answers I can see: The first is to keep learning, and leave breadcrumbs for the people who come after you. And maybe, at some point, join the top of your chosen field. It'll be a while, but the breadcrumbs are incredibly valuable to anybody coming after you.

The second is both more interesting, and harder: Find a couple of fields that you're good in. Not an expert, but good. Then write about the intersection. That is almost by definition a much smaller field, and you're much more likely to be at the top of that field. (For a made up example, how many people are really good at music, systems thinking, and gardening, and write about that intersection?)

The things you can generate in that particular field are adding to that particular field - and more importantly, they likely contain unfamiliar insights to people who are only fluent in one of those fields. You've added something new to both your field, and their discourse.

Most of us probably alternate between 1) and 2), and only very few of us will ever be recognized experts in a well-defined field and further that field through our expertise.

That's OK. We're still contributing to the discourse, we just target slightly different people.

Re:Time spent programming is often time well spent by larrywright on Wednesday September 23, 2020 @12:55PM (#24569148)
I suffer from the same problem. Something to consider is that we benefit from having a diverse set of materials on the same topics. Maybe you explain something a little differently than someone else does, or in a way that resonates better with a certain type of person. Julia Evans[1] is a great example of this. For much of what she publishes, she’s not explaining something that you couldn’t figure out from reading the man pages or a lengthy tutorial, but her work is still hugely valuable because it’s concise, and visual.

The other thing to remember is that writing is just as much for you as it is for others (maybe even more). The act of writing down an explanation of how to do something or how something works ensures that you understand it was well as you think you do. I don’t publish nearly as much as I should, but I often write things down in a Markdown file because it helps me organize the thoughts in my head and lets me identify any gaps in my knowledge.

[1] https://jvns.ca/

Re:Time spent programming is often time well spent by jniedrauer on Wednesday September 23, 2020 @12:43PM (#24568961)
Examples of common patterns add incredible value. A 1000 page document may contain everything you need to know to implement a protocol, but a well written example will be far more useful for most.
Re:Time spent programming is often time well spent by munificent on Wednesday September 23, 2020 @01:00PM (#24569207)
Trust your reader to decide what's helpful for them. If you never put it out there at all, you never give them that option.
Re:Time spent programming is often time well spent by MaxBarraclough on Wednesday September 23, 2020 @11:30AM (#24568208)
> how do you overcome the perception that you have nothing new to add to the discourse?

Perhaps make a tutorial? There are various neat tools (and combinations of tools) that lack approachable documentation. Won't be ground-breaking, but might be helpful and worth reading.

Re:Time spent programming is often time well spent by msie on Wednesday September 23, 2020 @04:14PM (#24571439)
- That's for the reader to decide.

- If you're worried about other people's opinion then blog anonymously.

- Many people are blogging without being worried about being redundant.

- Blogging on the Internet is like spitting in the ocean. You would be lucky to get some pageviews.

Re:Time spent programming is often time well spent by MrPowers on Wednesday September 23, 2020 @11:34AM (#24568264)
Great question. My blog is to help people answer questions they Google. I'm the top result for searches like "spark partitionby". The content isn't anything new. They're just useful posts for people that are busy and Googling for answers.

Writing the blog post is what forces me to actually learn about the topic and commit the concept to memory.

Re:Time spent programming is often time well spent by jariel on Wednesday September 23, 2020 @02:55PM (#24570559)
Explain something to yourself or someone you are working with so that they understand it. Now just edit a little bit - and that's an article.
Re:Time spent programming is often time well spent by spaetzleesser on Wednesday September 23, 2020 @02:10PM (#24570069)
LI take the attitude that if I learn something, time spent programming is never wasted.”

That’s my philosophy now. Always try to learn new stuff and how to do things better. Even if it doesn’t work out, at least you know why.

Re:Time spent programming is often time well spent by non-entity on Wednesday September 23, 2020 @09:49AM (#24567009)
Unfortunately most of the things I've learned from my incomplete side projects are useless. Some may make for interesting discussion sometimes, but ultimately nothing that will help me in any tangible way.
Re:Time spent programming is often time well spent by jcranmer on Wednesday September 23, 2020 @03:02PM (#24570653)
A few months ago, I was poking around ptrace details for an incomplete (unstarted, really) side project, and I came across a mailing list message suggesting that debuggers should be using perf events instead of debug registers for doing hardware tracepoints.

A few days later (maybe literally the next day, I don't quite remember anymore), a coworker was having an issue where we needed tracepoints to catch who was overwriting bad memory, but the debugger was causing the thread race to not happen properly. So I looked up how to use perf to set hardware watchpoints, and we caught the issue almost immediately after that. I would not have thought to try that had I not been poking around with my side project.

Some of my key skills as a developer are my ability to debug issues quickly and my ability to spelunk through large code bases. These skills were developed largely through poking around code bases for incomplete side projects. Sure, the details of how CVS works is probably never going to come up, but when you stumble across time synchronization issues for code, or the different filesystem semantics of NFS--those details tend to be more relevant, and you might not think to look them up before embarking on the "useless" side projects.

Re:Time spent programming is often time well spent by larrywright on Wednesday September 23, 2020 @01:05PM (#24569271)
Keep at it. There’s plenty of stuff that I learned that never had any practical applications, but the handful of things that did have been very valuable.

Real world example: I was building an app for myself to scrape some websites and Twitter to aggregate stuff I might be interested in. I had built an MVP that I wanted to get up and running on a web host somewhere so that I could let it run for a bit and then iterate. I was annoyed though, because while I was comfortable setting up servers, I hated all of the repetitive tasks involved in getting everything set up the way it needed to be. I’d tried writing shell scripts, but as anyone who’s tried that can attest, they are fragile and end up being almost as frustrating as doing it by hand. I’d heard about this thing called Chef that people in the Ruby community had great things to say about, so I set out to learn that so I could use it to set up servers for me (and my local Vagrant setup). Long story short-ish: I never did get my app deployed to a server, it’s still sitting on my hard drive almost 10 years later. But my Chef skills turned into a bit of moonlighting to bring in some extra money, and then ultimately let me make a career change and get out of a job that had become toxic. I don’t do Chef any more, but I’m still in a job I enjoy and I make a lot more money than I did.

I’m still going to get back to that app though. One of these days.

Re:Time spent programming is often time well spent by logicOnly on Wednesday September 23, 2020 @10:06AM (#24567204)
I got my first paid programming job after 12 years of side projects.

Maybe it's too soon. After 6 years of programming I had made pretty much nothing useful.

Re:Time spent programming is often time well spent by jniedrauer on Wednesday September 23, 2020 @12:39PM (#24568913)
I've been writing code professionally for quite a while now. I'm not trying to land my first coding job. The vast majority of programmers working on side projects are already established in the industry.

I've learned a few novel things from my unfinished side projects, but I've never really used them in my day job.

Re:Time spent programming is often time well spent by idrios on Wednesday September 23, 2020 @04:15PM (#24571455)
> The vast majority of programmers working on side projects are already established in the industry.

I strongly disagree. There are teenagers writing custom skin mods in Minecraft by Googling and copy/pasting. There are non-tech professionals making hello world android apps but are too novice or uninterested in getting a professional developer position. There are photographers who write plugins in Photoshop to create copies of their photos at various resolutions. You won't find any of them making github contributions but they're there.

And a lot of the skills you learn from side projects are internalized without being able to explicitly state it, like getting a feel for conventions in the framework or language you're using, or how much abstraction to use in your solution.

Re:Time spent programming is often time well spent by yetihehe on Wednesday September 23, 2020 @11:51AM (#24568457)
80/20 rule says that 80% of what you learn will be useless. But you don't yet know which 20% is usefull.
Re:Time spent programming is often time well spent by jariel on Wednesday September 23, 2020 @02:54PM (#24570543)
Hmm. My views of Java/C++ (mainline productivity langs.) have changed a lot because of screwing around with other languages. I think I 'code better' because of it.

It's possible you are learning something.