Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Unfortunately have to admit it was my C code. I don't have it anymore, but from what I remember the 17 year old me that had no notable prior programming experience took the following implementation strategy:
1. Okay I need to read stuff from a text file. The way to do that is `fscanf` apparently. Let's use that.
2. Well, shucks. These Log lines are fucking complex and I just need a tiny bit of information from each line. Okay, so I add a command line argument that tells the program to preprocess the log file and turn the complex log lines into something I can parse with fscanf. Just tell the user to run it twice. No problem.
3. Okay, Reads the data. fine. Now process the data. Well, I don't know how many data sets I will have in the end, and running the parser twice is not an option. HA! I know it! I have just learned about these "linked lists" in school. Lets implement one of those. *implements linked list* -
4. Okaaaay, that seems to do the trick. Now I need to sort this by time and write out the output. *implements linked list sorting*
Finally, I think the output was something like an ASCII-Art histogram that showed how many IPs were active at the same time.
Needless to say this program was hardly understandable by anyone (why the fuck do I have to run this two times?!?)
It had more than a thousand lines of code for functionality that would likely be a three-liner in Python.
**BUT**
It ran faster than the fucking Perl Script
**AND**
The Perl script couldn't do the ASCII-Art histogram.
Related Rants
-
linuxxx24Not a windows hate rant, just a funny encounter at work. Was configuring KDE on my work pc and got the windo...
-
peterzig4The first documented time of "impressing ladies with my computer skills" 😄😄 I was 4 or 5 yrs old, using...
-
Kryptic04how i spend so long on this as a child i dont know, but i wouldn't change it for the world, damn this brings b...
Re-implemented a Perl-based log analysis script in plain old C to make it faster.
Horrible implementation... Good times.
rant
good times
wk254