LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-05-2010, 03:22 PM   #16
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301

Except for the fact that 'find' 'grep' 'cut' are written in C, and therefore the loops they use run way faster than any you make in bash.
 
Old 05-05-2010, 03:25 PM   #17
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by H_TeXMeX_H View Post
Except for the fact that 'find' 'grep' 'cut' are written in C, and therefore the loops they use run way faster than any you make in bash.
My point is that it is either a number of nested loops or single loop with state variable(s) - whichever way you try to express/hide it.

In the case of nested it's the code portion currently being executed which represents the state.
 
Old 05-05-2010, 03:30 PM   #18
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by petrus4 View Post
...
I think one of his quotes from Donald Knuth there as well, implied that successful management of data structures, is much more important than being able to write complex logic; because if data is organised in a sufficiently elegant and effective way, logic won't need to be complex at all.
I remember a single data structure I needed with 14 or so levels. It was an objective need. I could split the data structure into a number of dimple ones, but that ultimately wouldn't have made my life easier.

The whole point was to just write nested loops and sleep well at night.

...

I reiterate my point - under the hood parsers are actually nested loops (or state machines, or both). And yes, I did talk about hiding the complexity. But one should always understand how many nested levels of nested loops are under the hood - this reflects algorithm complexity.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nesting switch functions in C justwantin Programming 20 04-13-2010 10:33 AM
Nesting windows? anon099 Linux - Desktop 2 05-04-2008 07:37 PM
Nesting while loops rujin69 Programming 2 03-20-2007 05:17 AM
Nesting Hashes in Perl. faref Programming 2 06-07-2006 05:03 PM
Bash scripting: Nesting backticks ? Deleriux Programming 1 01-04-2004 02:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration