How common is string manipulation, really? [closed]

I’ve noticed a lot of programming introductions (almost any language) usually include a heavy barrage of string manipulation quite early, such as:

  • Count the number of “xx” in the given string. We’ll say that overlapping is allowed, so “xxx” contains 2 “xx”.
  • Reverse the given string and remove all vowels from it.

Not just online courses, but even in degree programmes.

But the thing is, I’ve never encountered a situation in “real life” where you had to do anything like that. Is it just luck, or do you really need to do heavy manipulation in the above manner in some fields of programming? Can you give a description or an example where it is needed?

Edit:
Just to clarify, not necessarily string processing itself as in echoing variables to a html template, or other basic stuff like that, but the more arcane type of processing, like reading every second character? But yes, perhaps it is just for training purposes instead of direct needs. The file format conversion is a good note, though.

5

Real life programming will almost certainly involve string manipulation at one point or another. Your example is a very specific case and may or may not appear in a real life scenario (In reality, I’m sure somebody, somewhere has had to tackle that problem in real life).

However, the real life applicability of a particular use case is not necessarily the point of those exercises when introducing a new language or teaching someone brand new to programming. The point of those exercises are likely to be any of the following (depending on context):

  1. To teach a programmer the basic syntax of a given language using an easily understood problem.
  2. To provide an exercise allowing novice programmers to learn basic programming logic without having to understand a complex problem.
  3. To express a languages ability to solve a particular string manipulation problem.

1

Text files and text data are everywhere.

Converting .csv to .xml, reading .py for execution or .f90 for compilation, building and sending spam from a list of mail addresses, building a database of keywords for indexing the web: all of that is string manipulation.

Do computers do something else than manipulating strings?

3

String manipulation actually is fairly common when you’re doing I/O, which includes most network programming. Unicode complicates things, of course, but text remains the closest thing we have to a universal interface.

But where it really shines is as a metaphor. Working with individual characters in strings is, in many ways, not unlike working with cells in memory. At the lowest levels, the operations can be almost identical. This makes strings a less abstract way of learning the very basics of working with data at low levels, and that makes it valuable to learn early.

These are very specific examples, really just given as training for string manipulation.

And it is more common than you think – mostly in parsing and UI code.

For example – parsing dates out of strings – this requires extensive string manipulation.

Or parsing HTML into a DOM – same kind of thing.

You will also need to manipulate strings for UI purposes – constructing strings based on specific data and conditions.

Is it just luck, or do you really need to do heavy manipulation in the above manner in some fields of programming?

There are domains where string manipulation is not a necessity, or it is a marginal problem. There are also domains where it is a critical requirement.

For example, web technologies depend critically on text manipulation (web and mail servers and clients); so do most software development tools (IDEs, editors, compilers, etc).

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

How common is string manipulation, really? [closed]

I’ve noticed a lot of programming introductions (almost any language) usually include a heavy barrage of string manipulation quite early, such as:

  • Count the number of “xx” in the given string. We’ll say that overlapping is allowed, so “xxx” contains 2 “xx”.
  • Reverse the given string and remove all vowels from it.

Not just online courses, but even in degree programmes.

But the thing is, I’ve never encountered a situation in “real life” where you had to do anything like that. Is it just luck, or do you really need to do heavy manipulation in the above manner in some fields of programming? Can you give a description or an example where it is needed?

Edit:
Just to clarify, not necessarily string processing itself as in echoing variables to a html template, or other basic stuff like that, but the more arcane type of processing, like reading every second character? But yes, perhaps it is just for training purposes instead of direct needs. The file format conversion is a good note, though.

5

Real life programming will almost certainly involve string manipulation at one point or another. Your example is a very specific case and may or may not appear in a real life scenario (In reality, I’m sure somebody, somewhere has had to tackle that problem in real life).

However, the real life applicability of a particular use case is not necessarily the point of those exercises when introducing a new language or teaching someone brand new to programming. The point of those exercises are likely to be any of the following (depending on context):

  1. To teach a programmer the basic syntax of a given language using an easily understood problem.
  2. To provide an exercise allowing novice programmers to learn basic programming logic without having to understand a complex problem.
  3. To express a languages ability to solve a particular string manipulation problem.

1

Text files and text data are everywhere.

Converting .csv to .xml, reading .py for execution or .f90 for compilation, building and sending spam from a list of mail addresses, building a database of keywords for indexing the web: all of that is string manipulation.

Do computers do something else than manipulating strings?

3

String manipulation actually is fairly common when you’re doing I/O, which includes most network programming. Unicode complicates things, of course, but text remains the closest thing we have to a universal interface.

But where it really shines is as a metaphor. Working with individual characters in strings is, in many ways, not unlike working with cells in memory. At the lowest levels, the operations can be almost identical. This makes strings a less abstract way of learning the very basics of working with data at low levels, and that makes it valuable to learn early.

These are very specific examples, really just given as training for string manipulation.

And it is more common than you think – mostly in parsing and UI code.

For example – parsing dates out of strings – this requires extensive string manipulation.

Or parsing HTML into a DOM – same kind of thing.

You will also need to manipulate strings for UI purposes – constructing strings based on specific data and conditions.

Is it just luck, or do you really need to do heavy manipulation in the above manner in some fields of programming?

There are domains where string manipulation is not a necessity, or it is a marginal problem. There are also domains where it is a critical requirement.

For example, web technologies depend critically on text manipulation (web and mail servers and clients); so do most software development tools (IDEs, editors, compilers, etc).

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật