Vibecoding is scarily powerful: minutes to get C and Python recursive pdf-to-txt
* 180 lines of code ~120 of which in C; * it's actually recursive and has pseudo-try-catch + memory liberation so it's more professionally coded than a total noob. * my fingers rest, i type nothing. * Because it was painfully easy i added 'ok chatgpt, thanks yeah all works but you know...sometimes pdf text is too 'tight' on the left side and i want it to be wide super formatted, can this be done? ' - of course it can..i now have wide version and tight version...
And here's the best part:
Since i decided as usual to stick to Cygwin for portability and avoid RAM overhead rather than switching to linux (dual boot) or vmware (ram) or rdp on aws (money!) chatgpt 4 (not even 5!) told me easily how to compile it and what to do to make it work on cygwin, it worked flawlessly.
Now...if i was trying to get it to work without LLM...this is what it looks like:
gcc -std=c99 -Wall -O2 pdfer_dir.c -o pdfer_dir `pkg-config --cflags --libs poppler-glib`
so where the journey starts: i had older version of cygwin and downloading it resulted in full reinstall (why not right?), then of course i needed to install 'poppler' (i had no idea what this is) which also depended on glib and even devel part of poppler or whatever that if it wasn't for chatgpt i would've never have guessed.
I also have now version which only extracts couple of pages and not the whole doc.
Sure given the cyygwin reinstall and all the options variations it was longer but the whole process can easily fit in 10 minutes or less. No one can convince me that senior Python and C developer who never works with pdf files can do it in less even if you ghost-type code, the whole process of researching on stakcoverflow, coming up with compiler options and doing it professionally with nice user-friendly output would've been hours work + energy lost. But with vibecoding and chatgpt now i have 2 programs in different languages each of which enters a specified dir and recursively converts every single pdf in each found directory to txt while the output txt retains the same name as the original pdf file.
And because it's so damn easy i may as well try to do it in c# or why not even f# (this one actually might fail since f# isn't too used for training these days).
The point is to highlight the ridiculous simplification of coding work, if you can even claim that i "coded". Vibecoding is great power and i hope it stays that way.
No comments yet