- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Popen(['echo', 'Frist!']);
Admin
Snailcond!
Admin
Duplicate of [insert article link here]
Admin
It would be better if it is more generic.
i.e. implement *sh in Python
Admin
TRWTF is Chris. He's got some juniors in on work experience and just left them to get on with writing code with no guidance from him. What did he expect?
Admin
Chris is indeed TRWTF... I work a lot with interns, and if I gave the instructions (As presented in the article) and got back something different than what was posted I would have been unhappy.
Admin
Chris is indeed TRWTF... I work a lot with interns, and if I gave the instructions (As presented in the article) and got back something different than what was posted I would have been unhappy.
Admin
... of http://thedailywtf.com/Articles/Best-of-Email-Brains,-Security,-Robots,-and-a-Risky-Click.aspx
Admin
TRWTF is why replace a concise shell command with lots of Python code.
Admin
Running low on WTFs, so we are supposed to chuckle about juniprs from school?
Admin
"TRWTF is why replace a concise shell command with lots of Python code."
Hear hear, give this man a beer!
Admin
And here lies the entire problem with the way programming/computer science is taught in college. You see Dudley was taught that he will always be given the exact description of what the issue/project is and he should never go above that
Admin
TRWTF is that neither the original nor the Python port can handle files with spaces in the name. Well, the Python port at least handles that for the directory passed to find.
Admin
gives beer
Admin
Find with "$1" will handle spaces in the name. "" is a bit magical with arguments. I've not studied it in detail but in practice I've found it will always map to a single argument in bash. Otherwise you would have to ask yourself why all these scripts with "$VAR", wouldn't that be redundant?
Following the find the string manipulation would easily be handled by python with basic knowledge and the recursive directory search would only require one step up on knowledge but the real questions is what the hell pmccabe does.
Admin
Are intern coding fails acceptable to be posted here? Seems like it would be in the same bucket as student/non-professionals.
They are going to make mistakes. You shouldn't shame them for that. And if you want them to port code then you need to be clear that it shouldn't be a direct port. I frequently do a direct port on my first iteration just to ensure the output will match.
Admin
My mistake you modified the original.
Turns out... https://pypi.python.org/pypi/mccabe
Admin
I am confused... Why do you need python for a web front-end?
My first web-programming gig back in the 90s was Perl.
You can put a web front-end on Perl without breaking a sweat.
So instead of just putting a web-interface onto the perl scripts, they decided to throw their perl away because ????
Admin
Agreed.
Admin
Good times.
Admin
Writing it the long way lets you put comments behind each line so you know what each character is supposed to do.
TRWTF is no comments.
Admin
Making fun of interns is really lame.
Admin
Now, as to why you need to convert everything from Perl, you don't have to, but it sure can make the jobs of the sysadmins and maintainers easier. Also, Python code is significantly more distinguishable from line noise or the output of /dev/random ducks.
A note on dealing with interns: The point for the employer is to find good entry-level hires in a low-stakes situation that makes it easy to get rid of the idiots. That means that the ones that aren't going to make the cut are often real dunderheads, and should be treated as such.
Admin
Admin
Dudely is smart and knowing when to reivent wheel and when not to.
Admin
Yes. This is because a lot of developers are afraid of *nix systems. Nobody will admit this, but I have seen and heard this with my own eyes and ears.
Admin
In america are not interns making coffee? if you make of them, they will spit in your coffee.
Admin
And give two to me, or else leave me be!
Admin
TRWTF is not to use existing tooling, comparable to Checkstyle (http://stackoverflow.com/questions/2977866/checkstyle-for-python). Even as a stupid college student, you should know a) look if someone already solved the problem b) if yes, test if it works and is maintained c) if yes, use it, else discuss finding with supervisor
Admin
TRWTF is "E for effort".
E???
Admin
I'm surprised nobody has complained about
in the Python script, but not in the original shell. Nor that isn't defined anywhere. I don't know Python (refuse to learn), but I could at least make that out.Admin
Maybe Chris should have been a bit more expressive about his expectations when talking to a junior programmer? After all, Dudley did exactly what he was asked to do.
Admin
You can use VB on the web, doesn't mean it's a good idea.
Admin
Admin
I don't wanna learn, see?
The more you code, the less intelligent ya are.
Admin
It's not magic. This will handle spaces just fine because it has been written to.
Find will output any files matching the criteria, normally separated by a newline, which would be seen by other commands as whitespace and would confuse things if the filenames had spaces in. The "-0" will make it output the files separated by a NULL char instead of newline. This feature of find is explicitly and deliberately to solve this issue.
the "-0" on xargs will make it expect the input strings be terminated by NULLs instead of newlines, and it will split the input on the NULLs to get an array of arguments, some of which will contain newlines.
When it forks and execs "pmccabe", it simply passes this argument array in.
Admin
I love how all errors are sent to DEVNULL, then at the end, he goes back and checks for errors.
Admin
Duds are no different from live shells, except someone forgot to set the fuse.
Admin
Alternatively, it's a grade between "D" and "F".
Admin
...by The Daily WTF. All is in order.
Admin
And I will take four, or boot your ass out the door!
Admin
TRWTF is expecting someone with zero real world experience to have in depth knowledge of both languages and be able to not just translate the literal code but the intent behind it. Chris is the dud here in managing people.
Admin
In some universities, "E" is "Conditional Failure", meaning that the student can meet with the professor who will set conditions for upgrading to a "D".
Admin
snoıʌqo sı ןןoɹʇ snoıʌqo
Admin
You can meet with professor only if your sex is opposite to that sex of the professor.
Not that I am doing any such things here.
Admin
I'm having eight Fuck, I am in a state
Admin
Yes of course. Same-sex shenanigans is frowned upon where you come from, innit?
Admin
Yay! No Discourse :)
Admin
Admin