java - Commonly accepted best practice for using newlines -
as extremely jr software engineer, i'm trying make sure develop habits. challenge of using newlines when displaying output seems simple (i'm sure seasoned), how should used throughout program displays output in various places throughout code execution?
example (assuming language java):
public class output { public static string usage = "usage: message"; public static void main(string[] args) { system.out.println("starting program"); checkdata(); system.out.println("ending program"); } public static void checkdata() { system.out.println("data checked"); # assuming method causes exception try { more code... } catch(ioexception ioe) { system.out.println(ioe.getmessage()); system.out.pritnln(usage); } }
clearly of these messages run if printed. program grows, , seeing though errors necessitate need output information well, should newline characters placed @ beginning, end, or wherever 1 decides throughout program?
there advanced feature "aspect oriented programming". spring framework has built in stuff.
try search it, learn how use add anotation functions, handle "entering function", "exiting function" simple @mylogstuff
Comments
Post a Comment