Should I consider uncertain future requirement while development? [duplicate]

I have one text box across multiple pages which is used to enter multiple customerids (as comma separated) . But in current page due to some subsequent implementation difficulties we make it as customerid so that user can enter only one customer not multiple customerids as comma separated.

But coding styles and naming of variables across all pages are same since we are assuming that multiple customerids could be entered in future.

we are having array instead of string to store customerid as given below:

customerIds.push(tbxval); 

whereas customerids array always having only one element inside that as of now in that particular page.

I guess if that future requirement not asked from product owner, this code could make some problem or at least until that requirements comes.

But I’m not sure what kind of negative or positive impact it could make.

2

If we interpret this question in its most general sense, the proposed duplicate question has perhaps the best answer you could ever get:

Too often when you try to design for the future, your predictions
about future needs turn out to be wrong. It’s usually better to
refactor when you actually know how the needs have changed than to
overdesign your system on day one. At the same time, don’t shoot
yourself in the foot, either. There’s certainly a middle ground, and
knowing where that is is more art than science.

To boil it down to one rule of thumb: less is more.

But we can expand on this a bit. There’s a big difference between trying to predict the future, and actually knowing the future.

It is important for developers to be aware of the long-term vision of the product because once in a while, you really do know for sure that you will need to do X at some point in the future. For instance, I know that our application will have to support color themes someday, so I try to avoid relying on the current default color values as much as possible. But I haven’t written any code to change the default colors, because we won’t need it for a very long time, and I have no idea how exactly we’ll want it to work. We also knew from the start that our application would need internationalization, so we (mostly) kept user-facing strings and “code-only” strings clearly separated from day one, even when we didn’t have a system for translating the user-facing ones yet.

In your example, it’s not clear whether dealing with an array instead of a single number would result in you writing additional code you don’t need yet, or just slightly different code. It’s also not clear whether you know you’ll need this in the future or if you’re just guessing. Only you and your product manager can answer that. If the odds are high that you will need arrays, and using arrays doesn’t make the code significantly more complicated right now, then it’s probably a good idea to start using arrays early.

The only time it might be worth trying to predict the future and be more generic than necessary is when you’re designing an API, schema or file format that needs to be backwards compatible. For example, if you have a web service API with a method getPublicUserStats(), making it only accept a single user id instead of an array is needlessly restrictive, even if you only need one at a time right now. But you shouldn’t go out of your way to optimize for requests with a thousand user ids until you actually have a performance issue.

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