Why does some of the classes pass null argument while some classes passes a valid argument in the new()?

example 1
function new(string name= “ahb_test_base”, ovm_component parent = null)
begin
super.new(name,parent);
endfunction

example 2
function new(string name= “ahb_test_base”, ovm_component parent = xyzyxzxyz)
begin
super.new(name,parent);
endfunction

why do we need to pass any argument like string name and ovm_component type at all in the new function. How does it is help full?

In reply to Arun_Rajha:

These are default argument values to be used when no other arguments get passed to the constructor. People who use Verilog/SystemVerilog are typically hardware engineers first, and lazy software engineers second. In most cases, it’s better to explicitly pass all the arguments.

But sometimes, like for the string name, it makes sense to have a default so that you are less likely to have mis-matched names for the object.

For classes derived from ova_component, a null argument means it is a top-level component of your testbench hierarchy. I’ve never seen anyone use a default other than null. There parent component constructs the child component, and passes this as an argument to the child constructor, which becomes a handle to the parent.