r/programming • • Dec 14 '19

Challenging projects every programmer should try

http://web.eecs.utk.edu/~azh/blog/challengingprojects.html
636 Upvotes

99 comments sorted by

View all comments

Show parent comments

-56

u/MetalSlug20 Dec 15 '19 edited Dec 15 '19

Jesus Christ people downvotes this? You guys are so damn harsh. Maybe have a fucking conversation?

How many lines typically are in a basic text editor! Even windows notepad chokes in large files.

If you for example use it for a programming scratchpad well the longest since file I ever had was maybe 8000 lines long. And say 80 characters wide. They ain't shit for memory. You could literally just make a whole new array each time without problems. Not even something to worry about in modern computers

I get some of you guys are data structure nerds and I never said it wasn't worth using them. I just said you probably could get away with not even bothering to do so anymore, unless you are planning on working on some giant manuscripts. And for just text O(n) is plenty fast

Fucking premature optimizers the lot of ya

Even my solution is faster than O(n) if you resize the array in place (or even just allocate a big ass chunk of ram ahead of time why not) you only have to move the characters after the insert to make room!

9

u/robchroma Dec 15 '19

The longest files I have during programming are million-line log files. Open that, do one edit command, and watch the computer churn a little too long.

0

u/[deleted] Dec 16 '19

[deleted]

2

u/robchroma Dec 16 '19

Characterizing random processes, and to create summary statistics.