Embed presentation
Download to read offline






![/10@yegor256 7
void push(int x) {
if (pos < array.length) {
array[pos++] = x;
}
}
void push(int x) {
if (pos >= array.length) {
throw new Exception(
“array is full”
);
}
array[pos++] = x;
}](https://image.slidesharecdn.com/2016-05-devit-160521061326/85/Need-It-Robust-Make-It-Fragile-7-320.jpg)





The document discusses robust programming practices, emphasizing the importance of fail-fast approaches and improved error handling. It provides code snippets illustrating better practices such as throwing exceptions when encountering null values or errors, rather than silently swallowing them. The overall focus is on creating more reliable and maintainable code.






![/10@yegor256 7
void push(int x) {
if (pos < array.length) {
array[pos++] = x;
}
}
void push(int x) {
if (pos >= array.length) {
throw new Exception(
“array is full”
);
}
array[pos++] = x;
}](https://image.slidesharecdn.com/2016-05-devit-160521061326/85/Need-It-Robust-Make-It-Fragile-7-320.jpg)




