Welcome to RegexAdvice Sign in | Join | Help

RegEx Side

The light side the dark side and the regex side.
Computer Science not teaching regular expressions?

I don’t know what to think about this problem. While I was in one of my computer science classes. I recommended to some of my classmates that they use a regular expression to solve the homework. They all gave me an odd look. I could not believe that none of them had heard of regular expressions. No class I have taken there has ever had us use regular expressions, and I am not sure why. I still don’t know why, but after contacting a few other computer science students at other “better” schools, I found out that most of them had also not used Regular Expressions before. It seems that this is not required of students to learn. All the courses I’ve seen that teach regular expressions are not required courses, and most don’t talk about applications of them. It is more learning about them from a language perspective.

I have not been using a regular expressions for that long, but I have discovered many many uses for them since I started working with them. It seems that almost any case where I am even working with strings of characters that regular expressions are useful. Why don’t they teach more of this stuff in school?? Maybe someone knows why. They aren’t complicated certainly not for Computer Science students. Anybody have any thoughts on why this is?

Most of my blogging takes place on my own domain where I try to give good technical advice. Go read the new posts on my blog.

Sponsor
Posted: Tuesday, September 26, 2006 9:33 AM by Brendan
Filed under: ,

Comments

Alfred Thompson said:

What level of school are you talking about? In high school I can see not having time to get to regular expressions. At the university level I would think most people who see them at least in a complier course when talking about parsing. Maybe in some other courses as well. I remember talking about them sort of in one other of my graduate courses but I forget which - that was a while ago.

But often they do not fit as a natural part of the curriculum. There is only so much time in most courses. What course do you see them fitting into?

They sure are useful though.

# September 27, 2006 6:40 AM

Brendan said:

Yes, I am talking about college level courses. They can be very useful in a lot of cases. I don't know which classes exactly should be teaching them, but I would assume some required course should. I think if you take a course in compilers at almost any school you will cover that, but I also don't know of many schools requiring a course in compilers for undergraduate work that is.

I think some core courses should at least give some quick introductory work into them. Maybe have the students parse a bit of text.

# September 27, 2006 1:34 PM

mash said:

I think part of the problem is even among programmers knowledge of regular expressions isn't that strong.  I wouldn't be surprised if your teacher had only a passing knowledge of regular expression if any at all.  Support for regular expression in many langagues and appliacations has only recently gotten strong enough where their value can be appreciated.  It wasn't too long ago the regex information was very scarce.  Most of the book and website with info on regex have only appeared in the last 3 or 4 years.  And it's not a feature many languages or applications have promoted much.

Another problem is that regex doesn't have a standard.  There are multiple implementations and they vary.  Unless you were going to cover them in any depth you'd almost have to pick a language to show them in, meaning you'd have to teach the language first.  If part of your core taught a language that had good regex support that might not be and issue, but if not that one or two more classes that would have to be added. Perl would probabally be the best choice since most regex implementation are a least a subset of their implementation.

And be honest you could have a full course on regex and not cover everything in one class and this would almost certainly be an elective.  Which many wouldn't take simply because the didn't know what regular expressions were.

# October 6, 2006 2:47 PM

Tony Stubblebine said:

My college (Grinnell College) taught the theoretical underpinnings instead, automata and state machines. I think that's all that's important, every programmer is going to be expected to pick up new vocational skills for the rest of their career, no matter how many they picked up in college.
# January 7, 2007 8:40 PM

Drew Dulgar said:

We briefly touched on regular expressions in my ASP.NET class. Though it wasn't us learning them, they were already provided by the .NET framework. i had already had heavy experience with Regular expressions, though other people in my class were alittle freaked out about the syntax. Of course though they have no idea how to do it since the regular expression was already built into the system.
# January 22, 2007 12:16 PM

Brother Bill said:

One ought to be able to cover the basics of Regular Expressions in one to two days, and have the students do some parsing exercises. One good exercise is to take a sample regex and recode it without using a regular expression. Thus, the students will see the benefit of using regular expressions. It might be interesting to see timing benchmarks on using regex vs. standalone coding. I agree that anyone taking a computer science course ought to at least be exposed to regular expressions. They ought to be able to parse a simple regex such as ^https?(www.)?/w+.(com|gov|org)
# June 30, 2008 1:45 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Enter the code you see below

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS