4 ms·
Almost anything can be simulated in any other data type, often with poor performance and easy bugs. If a programmer use lists in lisps where vectors or hash ta
by Blikkentrekker 6y ago
Almost anything can be simulated in any other data type, often with poor performance and easy bugs.
If a programmer use lists in lisps where vectors or hash tables are more appropriate, he is doing something wrong.
Likewise, simulating arrays in hash tables, which is what PHP expects one to do, is a very bad idea.
Bash lacks multidimensional arrays, but it does have hash tables, so some programmers resort to simulating multidimensional arrays by using keys such as `"3,4"` as a string in hash tables, this would be a very bad idea if Bash had true multidimensional arrays. In it's lack thereof, it is only a bad idea where no better idea is possible.
- raspasov 6y agoThe reality of most of programming I've done is that in 98% of cases you deal with data structures that are sufficiently small for performance not to matter much on modern hardware. If you do need to deal with data structures that are quite large (i.e., take GBs of memory), perhaps PHP is not the right language.
- Blikkentrekker 6y agoThe performance is hardly the biggest issue, the ease of bugs is.