Comment On Mentors, the Freshmaker

A few years back, Chris Roberts started his foray into the world of computer programming and, as every newbie should, Chris found a mentor to help get him going. Chris' mentor was generous enough to show him a brand-new project that he had just completed for one of his clients: an ASP-based website to display and maintain listings and reviews of restaurants in a local metropolitan area. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Mentors, the Freshmaker

2006-04-19 15:23 • by graywh
And so the student becomes the master.

Re: Mentors, the Freshmaker

2006-04-19 15:24 • by WeatherGod
With that password, the student can become the mentor!

Re: Mentors, the Freshmaker

2006-04-19 15:24 • by APAQ11

It's pretty bad that the mentor was writing code like that. It's even worse that the mentor thought he was a good enough programmer to teach others his bad ways. Ignorance FTL [:P].

Re: Mentors, the Freshmaker

2006-04-19 15:24 • by Freshmaker
This is nothing a couple of Mentos can't take care of. 

Re: Mentors, the Freshmaker

2006-04-19 15:28 • by mrsticks1982
he must be above all the "new thingies" those young bucks use! Ha, who uses RDBMS anyways! ^o)

CAPTCHA: DOOM


Re: Mentors, the Freshmaker

2006-04-19 15:31 • by Sweet Jesus
Well shit on me and call me a sunday :|

Re: Mentors, the Freshmaker

2006-04-19 15:31 • by Yeah...Right...
69004 in reply to 68997
The mentor /still/ shouldn't have been groaning.  If it was a flat text file surely a quick search and replace (ie sed "s/


Oh, and I hope he used some obfuscated homebrew hashing algo on the password file.....

probably not.

Re: Mentors, the Freshmaker

2006-04-19 15:31 • by connected
Could've saved all that trouble by discovering the 'search engine'...

Re: Mentors, the Freshmaker

2006-04-19 15:31 • by PCBiz
Are you kidding me??  And a client paid him for this.  I hope the student introduced the master to the 20th century.  Correct me if I'm wrong but what happens when the client inputs thousands of records and the text file database gets bigger and bigger?  It might not be today or next month but if the client continues to use this for several years this could become a problem.

And don't get me started on the password.txt file.

Re: Mentors, the Freshmaker

2006-04-19 15:33 • by Jeremy D. Pavleck
This just reinforces my desire to create a web bot that simply crawls the web looking for password(s).txt.

I imagine I'd be quite surprised at what I'd find.




Everyone knows that for security reasons you create a passwords.txt and put the user names in it, and a seperate users.txt that contains the passwords. I mean, cmon now!

Re: Mentors, the Freshmaker

2006-04-19 15:36 • by ParkinT
69008 in reply to 69007

Anonymous:
This just reinforces my desire to create a web bot that simply crawls the web looking for password(s).txt.

I imagine I'd be quite surprised at what I'd find.




Everyone knows that for security reasons you create a passwords.txt and put the user names in it, and a seperate users.txt that contains the passwords. I mean, cmon now!


Right on.  That's how my bank does it.


A file called AccountNumber with my balance in it and one called AccountBalance with my account number.

Re: Mentors, the Freshmaker

2006-04-19 15:36 • by Yeah...Right...
69009 in reply to 68997
stupid forum...


The mentor /still/ shouldn't have been groaning.If it was a flat text file surely a quick search and
replace (ie sed "s/<h2>/<h3") should have been enough...if anything that was an advantage of
the flat file over a database (about the only one). Oh, and I hope he used some obfuscated homebrew
hashing algo on the password file.....probably not.

Re: Mentors, the Freshmaker

2006-04-19 15:38 • by Monday
It's scary how often I see this happen. Before doing a project, always
sit down the designers and the developers. It's amazing the time you
save.

Re: Mentors, the Freshmaker

2006-04-19 15:41 • by BlackTigerX

WTF! clearly, he should've named the file


obscurenameforthepasswordsfile.txt

Re: Mentors, the Freshmaker

2006-04-19 15:41 • by MikeMontana
Another perfect stinker! On a side note, where does one find a
reference "Here's the best way to do a task..." for a particular
language? Reading through the programming manual will give you the
syntax structure for what needs to be done. To understand how to best
apply a toolset seems to be reading through tons of posts on the web,
skimming past flame wars on where to put the "{" etc.



I ask because I am now starting off with Flex-2 development. I'm ok
with sytax, structure and relationships (to a degree at least), but,
stuck at "whats the best way to do things like check for login status,
cross communicate between panels/forms...is that a 'no/no' " and so on.
Any suggestions on the best way to quickly get up on
application-level-development for a particular language (is there a
book series slanted this way??) - and if you have any particularly good
suggestions on Flex2, I'd much appreciate it!



-Mike

Re: Mentors, the Freshmaker

2006-04-19 15:44 • by Disgruntled DBA
But the Mentor was wearing over 35 pieces of flair!

Re: Mentors, the Freshmaker

2006-04-19 15:45 • by treefrog

passwords.txt .... that's just precious [Y]

Re: Mentors, the Freshmaker

2006-04-19 15:46 • by cc6321
If the entire 'DB' was really in a flat text file, it should be pretty easy to change all the H1's to H2 or whatever.

Re: Mentors, the Freshmaker

2006-04-19 15:48 • by treefrog
69017 in reply to 69012

MikeMontana:
. Any suggestions on the best way to quickly get up on application-level-development for a particular language (is there a book series slanted this way??) - and if you have any particularly good suggestions on Flex2, I'd much appreciate it!

-Mike


I've always like the O'reilly "cookbook" series...they always have good recipes for that sort of thing.

Re: Mentors, the Freshmaker

2006-04-19 15:52 • by encryption expert
69020 in reply to 69004
The password file looked fairly secure to me!  Both the User ID and Password were "Doubly encrypted using ROT-13"!

that's the problem with consultants

2006-04-19 15:53 • by AC

The problem with consultants is that the ones with sufficient people skills to convince someone to give them the job often have insufficient development skills.  This sounds like a salesperson who picked up a Learn HTML Programming in 21 days book.  If PHB's had any brains at all, they'd think, in this order:



  1. I'm smooth, but I don't know jack about programming.
  2. I know a ton of people like me.
  3. This consultant is smooth.
  4. Therefore, there's a decent chance s/he doesn't know jack about programming.

Re: Mentors, the Freshmaker

2006-04-19 15:55 • by Code Monkey
69022 in reply to 69012

MikeMontana:
where does one find a reference "Here's the best way to do a task..." for a particular language? Reading through the programming manual will give you the syntax structure for what needs to be done. To understand how to best apply a toolset seems to be reading through tons of posts on the web, skimming past flame wars on where to put the "{" etc.

I ask because I am now starting off with Flex-2 development. I'm ok with sytax, structure and relationships (to a degree at least), but, stuck at "whats the best way to do things like check for login status, cross communicate between panels/forms...is that a 'no/no' " and so on. Any suggestions on the best way to quickly get up on application-level-development for a particular language (is there a book series slanted this way??) - and if you have any particularly good suggestions on Flex2, I'd much appreciate it!


There is no such thing. You seem to be confusing language with implementation. Languages have features that may ease the burden of very small tasks but they do not change the basis of a good pattern.

Re: Mentors, the Freshmaker

2006-04-19 15:57 • by Todd

Actually, this could be pretty easily done with a Perl/Python/awk/etc.


if /^\.+\<\/h2\>/


   s/font-size:14px;/font-size:16px; text-align:left;/


Or whatever...


Still a wtf.

Re: Mentors, the Freshmaker

2006-04-19 16:16 • by JamesCurran

FIRST!!!!


 


(OK, I know the actual "first" was nearly an hour ago, but no one had done it yet, and when has no being first actually stop someone from post "first"?)

Re: Mentors, the Freshmaker

2006-04-19 16:20 • by codeman
69032 in reply to 69029
JamesCurran:

FIRST!!!!


 


(OK, I know the actual "first" was nearly an hour ago, but no one had done it yet, and when has no being first actually stop someone from post "first"?)



Neither first, frist nor brillant!!!

Re: Mentors, the Freshmaker

2006-04-19 16:21 • by Cooper
The real WTF is that 'style=' is allowed in any element, ever.

When I waste time thinking about this (not often except when confronted with WTFery like today's example), I wonder just what they were thinking.

Re: Mentors, the Freshmaker

2006-04-19 16:21 • by codeman
69034 in reply to 69032
Um, I was talkiong about MY post, not James C's post ;)

Re: Mentors, the Freshmaker

2006-04-19 16:25 • by stonguse
69035 in reply to 69023
Do you really think that someone who codes their layout into a flat file would know how to easily replace the formating using code?

Re: Mentors, the Freshmaker

2006-04-19 16:27 • by makomk
69036 in reply to 69033
Cooper:
The real WTF is that 'style=' is allowed in any element, ever.

When I waste time thinking about this (not often except when confronted with WTFery like today's example), I wonder just what they were thinking.


Want to take out style=, eh?

Re: that's the problem with consultants

2006-04-19 16:33 • by ParkinT
69037 in reply to 69021
Anonymous:

The problem with consultants is that the ones with sufficient people skills to convince someone to give them the job often have insufficient development skills.  This sounds like a salesperson who picked up a Learn HTML Programming in 21 days book.  If PHB's had any brains at all, they'd think, in this order:



  1. I'm smooth, but I don't know jack about programming.
  2. I know a ton of people like me.
  3. This consultant is smooth.
  4. Therefore, there's a decent chance s/he doesn't know jack about programming.


Like I have always said:



  1. Those who can, Do

  2. Those who can't, Sell

  3. Those who can't sell, are Consultants

Re: Mentors, the Freshmaker

2006-04-19 16:33 • by mrprogguy
69038 in reply to 69033
Not really a WTF to me.  There's nothing more fun than wading through a stylesheet with a ton of one-off styles.  (Especially since, after awhile, you just flat run out of decent names for elements and start using td000001 and other egregious crap like that.)

Re: Mentors, the Freshmaker

2006-04-19 16:34 • by mrprogguy
69039 in reply to 69038
Actually, that comment was directed at the "removing 'style='" comment, not at completely restying <h2> inline, which is, of course, completely dorky. 

Re: Mentors, the Freshmaker

2006-04-19 16:35 • by ParkinT
69040 in reply to 69036

makomk:
Cooper:
The real WTF is that 'style=' is allowed in any element, ever.

When I waste time thinking about this (not often except when confronted with WTFery like today's example), I wonder just what they were thinking.
Want to take out style=, eh?


That is an instant CLASSIC!


You, sir, have a Paula (aka brillant) mind

Re: Mentors, the Freshmaker

2006-04-19 16:50 • by Happy
69042 in reply to 69040
Heck, no search and replace is necessary.  Just put in at the top:
h2 { font-size: 18px !important; }
and that should override all the inline styles.   It's just a quickfix, but it'll appease the clients while the html gets cleaned up.

But yeah, definitely time to get a new mentor.

Re: Mentors, the Freshmaker

2006-04-19 17:02 • by PACE
69043 in reply to 69042
Anonymous:
Heck, no search and replace is necessary.  Just put in at the top:

h2 { font-size: 18px !important; }

and
that should override all the inline styles.   It's just a quickfix, but
it'll appease the clients while the html gets cleaned up.




"While the html gets cleaned up"?





Made me laugh out loud. Surely one thing that'll never happen. Ever.


I can only try to imagine...





< !-- 2003-03-10: quick css fix for now. Will cleand up html later -->







Re: Mentors, the Freshmaker

2006-04-19 17:10 • by Noam Samuel
69046 in reply to 69007
Anonymous:
This just reinforces my desire to create a web bot that simply crawls the web looking for password(s).txt.

I imagine I'd be quite surprised at what I'd find.


Just use google:

  • I hope this guy didn't get an A on his project: http://dlib.cs.odu.edu/completed_projects/ncstrl+/authortool/password.txt
  • This one has a special text file per each user: http://home.iae.nl/users/geerings/password.txt
  • This message board is a hoot. Note that it stores all messages as html files: http://lostillusion.net/LI/Board/
  • Not only does this one store the password on the web in cleartext, it also has only one possible user: http://www.anunciosdeocasion.com/cgi-local/password.txt
etc. etc. find more here: http://www.google.com/search?q=inurl%3Apassword.txt&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

Re: Mentors, the Freshmaker

2006-04-19 17:27 • by Gene Wirchenko
69051 in reply to 69043
Anonymous:
Anonymous:
Heck, no search and replace is necessary.  Just put in at the top:

h2 { font-size: 18px !important; }

and
that should override all the inline styles.   It's just a quickfix, but
it'll appease the clients while the html gets cleaned up.




"While the html gets cleaned up"?





Made me laugh out loud. Surely one thing that'll never happen. Ever.


I can only try to imagine...





< !-- 2003-03-10: quick css fix for now. Will cleand up html later -->


Perhaps followed by

< !-- 2006-04-19: corrected comment to "Quick CSS fix for now.  Will clean up HTML later" -->

The HTML is still in the "later" pile.  The comment is more accurate now though.

Sincerely,

Gene Wirchenko
 

Re: Mentors, the Freshmaker

2006-04-19 17:31 • by Gunther
69052 in reply to 69012
Regarding steps to set up a web application, here is the quick list.
  1. Setup a real Database. (MySQL, Oracle, PostgreSQL, etc.)
  2. Setup your htaccess file
  3. Use the tools your language supports (PHP, ASP, JSP, etc.)
    1. e.g. If you find yourself inventing something... STOP, Google it, and get back to work
  4. Do not put markup in the database
  5. Modular is good, but use common sense
  6. **If you're not sure, ask an expert!**
  7. Lather, rinse, repeat

Re: Mentors, the Freshmaker

2006-04-19 17:34 • by loneprogrammer
69053 in reply to 69033
Cooper:
The real WTF is that 'style=' is allowed in any element, ever.

At some point in time, (early 2003,) XHTML 2.0 was going to have the STYLE attribute removed completely.

But people must have whined enough to get it put back.  :-(

It's still in the draft specification.

Note: use of the style attribute is strongly discouraged in favor of the style element and external style sheets. In addition, content developers are advised to avoid use of the style attribute on content intended for use on small devices, since those devices may not support the use of in-line styles.

Re: Mentors, the Freshmaker

2006-04-19 17:41 • by bullseye
69055 in reply to 69006

PCBiz:
Correct me if I'm wrong but what happens when the client inputs thousands of records and the text file database gets bigger and bigger?  It might not be today or next month but if the client continues to use this for several years this could become a problem.


I'm convinced that many sub-par consultants actually engineer these disasters as a form of job security.  If you think about it, it makes sense. 


Rather than deal with all that planning and design crap, you mash something together that works for the current situation. If you build a system that will inevitably fail as the client's business grows, you have an opportunity to come back in and do the same thing on a larger scale (interpreted, more $$$).  If the client dies out, then you saved some otherwise unrecoverable brain cells.


I'll call it... Consulting 2.0.

Re: Mentors, the Freshmaker

2006-04-19 17:57 • by foxyshadis
69058 in reply to 69046
Noam Samuel:
Anonymous:
This just reinforces my desire to create a web bot that simply crawls the web looking for password(s).txt.

I imagine I'd be quite surprised at what I'd find.


Just use google:

  • I hope this guy didn't get an A on his project: http://dlib.cs.odu.edu/completed_projects/ncstrl+/authortool/password.txt
  • This one has a special text file per each user: http://home.iae.nl/users/geerings/password.txt
  • This message board is a hoot. Note that it stores all messages as html files: http://lostillusion.net/LI/Board/
  • Not only does this one store the password on the web in cleartext, it also has only one possible user: http://www.anunciosdeocasion.com/cgi-local/password.txt
etc. etc. find more here: http://www.google.com/search?q=inurl%3Apassword.txt&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

Yes, that's true, but google only picks up links. He's talking about a spider that specifically requests "password.txt" in every single folder in every site it finds. Google won't. (On the other hand, some worm probably does.)

Admittedly most sites that stupid run a good chance of having an external link to it somewhere.

Re: Mentors, the Freshmaker

2006-04-19 17:57 • by Mark
That's some WTF to be sure.



Surely the 'mentor' could easily fix the formatting problems with judicious use of sed?

Re: Mentors, the Freshmaker

2006-04-19 17:57 • by lizardfoot
I only wish I could comment on this without making my own employer look too brillant.


Re: that's the problem with consultants

2006-04-19 18:09 • by Adrian.
69064 in reply to 69021

Actually the problem is not just with consultants.  It
is also with customers who want a cheap solution and buy without having any
real idea what can actually be delivered for the amount of cash they are
paying.



Also the consultants who can sell and actually deliver complex solutions cost a
packet of cash.  Said consultants are often undercut by the dodgy
consultants with no real capability - this gives consultants in general a bad
name.






 BTW – I work for a consulting company who in general
delivers quite complex stuff that customers are on the whole reasonably happy
with.  Hence the defence of consultants.



Re: Mentors, the Freshmaker

2006-04-19 18:12 • by TomCo

doubly-linked list of today's activity:


  delete password.txt


  new brillantmoose.txt: "tickle my unda belly!"


  new ticklemyundabelly.txt: "brillant moose"


whoops!  I dialed the wrong number again...WTF, this is even my phone! [li] <click>


 

Re: Mentors, the Freshmaker

2006-04-19 18:22 • by NancyBoy
69067 in reply to 69053
loneprogrammer:
Cooper:
The real WTF is that 'style=' is allowed in any element, ever.

At some point in time, (early 2003,) XHTML 2.0 was going to have the STYLE attribute removed completely.

But people must have whined enough to get it put back.  :-(

It's still in the draft specification.


Note: use of the style attribute is strongly discouraged in favor of the style element and external style sheets. In addition, content developers are advised to avoid use of the style attribute on content intended for use on small devices, since those devices may not support the use of in-line styles.


Just curious, what difference does it make?

Re: that's the problem with consultants

2006-04-19 18:24 • by Sam
69069 in reply to 69037

Smoothness is correlated with how much practice one has with selling/interviewing.  Those who are really valuable generally don't interview a lot (because they get jobs right away). 


At least in my experience.  I've often picked those who don't interview quite as well (appear a bit flustered or speak too fast, that sort of thing).  I look at qualifications primarily, of course, but if they're too smooth it makes me suspicious.

Re: Mentors, the Freshmaker

2006-04-19 18:27 • by Sven Gebhardt
The real real WTF is the hard-to-guess username/password combination. I'm sure intruders would never try "admin:admin"!

Re: Mentors, the Freshmaker

2006-04-19 18:47 • by Bus Raker
69076 in reply to 69011
BlackTigerX:

WTF! clearly, he should've named the file


obscurenameforthepasswordsfile.txt



Or 'New Text Document.txt' , or 'Book1.xls'


Everyone's got one of those somewhere and no one knows what they are for.

Re: Mentors, the Freshmaker

2006-04-19 18:49 • by loneprogrammer
69077 in reply to 69067
NancyBoy:
loneprogrammer:



Note: use of the style attribute is strongly discouraged in favor of the style element and external style sheets. In addition, content developers are advised to avoid use of the style attribute on content intended for use on small devices, since those devices may not support the use of in-line styles.


Just curious, what difference does it make?


The point of CSS is that it controls the way HTML documents appear to the user.

The HTML document does not have to look like any particular image on-screen.  This is because HTML can be presented in many ways -- on a computer, on a phone, on paper, or even read as speech for blind people.  In HTML, a <p> tag means "this is a paragraph" but it does not have to be any particular font or color or size, or in any particular place on-screen.  Some people might be blind and need to have the paragraph read aloud, others might have bad sight and need a very large font, or different colors that they see better.  The user might be using a phone and have a very small screen.

You should not hardcode HTML directly into a database table, and you should not hardcode CSS directly into your HTML tags, either.

When classes are used with CSS, the class itself has the CSS attributes.  That means you can create a class called "mainbody" for the main text of a blog, for example.  Then you can set the font, color, size, etc., for the main text.  It automatically applies to all elements that belong to that class, so the entire blog can have new colors just by changing one CSS file.  People with special needs can create custom CSS to override the web site's settings in their own web browser.

If you hardcode the CSS directly into every page of the blog, then you lose all that.

The reason that the style attribute was left in is so that you can still write <span style="color: red"> I want some red text here </span> if you need to do that, because you might be unable to change the rest of the HTML (you might be sending HTML to a DailyWTF post, for example) or if you just want to make something red in just one place and you don't want a CSS class for that (and you don't care about people who are colorblind and can't see red things).

« PrevPage 1 | Page 2 | Page 3Next »

Add Comment