4 ms·
Why should I know the exact signature of the main method? It's not like you write it every day. Eclipse offers to add the main method for you with one clicking
by legulere 9y ago
Why should I know the exact signature of the main method? It's not like you write it every day. Eclipse offers to add the main method for you with one clicking I guess IntelliJ does as well.
Hell after programming only Rust/Haskell/... for a while I forget the order of the statements of for loops in C/Java
For the first question it is very much possible that the interviewer expressed himself not clearly enough what he actually wants.
- Quarrelsome 9y agohow do you start to understand a technology you've never used?
- mmjaa 9y agoYou let the IDE do all the work?
- Quarrelsome 9y agoand if that technology doesn't have IDE support? Lets say that due to an emergency you are the only person that can look at a problem with a WinForm client and there is an issue with Initialisation prior to the WinForm loading. Lets say (since this is a _very_ good example) that you need to create an architecture to share components between WinForm. Without knowing of static void main within program.cs you're not going to find the entry point and any attempts to share components is going to result in static sadness without doing some sort of service container gubbins or constructor shenanigans (although that will fuck the designer) prior to Application.Run(form) hitting in static void main. The ignorance of static void main is a key reason why so many WinForm applications actually suck and why so many developers make the sad mistake of putting their user interface FIRST which has the knock on effect of making code reuse problematic. This is fine when people make utils but I have a very long experience of seeing companies struggle with this issue as their util grows into something more complex. The entry point IS important and if you're trapped in an IDE you suck. Go read pragmatic programmer the chapter: Wizards. You need to know how Wizards do their magic or you get burnt hard when the magic breaks.
- legulere 9y agoyou state that it's a problem when programmers don't know about the main function and I agree. The article on the other hand complained about people not knowing the exact function signature of main without thinking.
- flukus 9y agoThat's also something I'd want to filter out, developers that are entirely reliant on their IDE and can't do simple things without it. I love Visual Studio, but there are way too many working developers that assume something can't be done if if Visual Studio doesn't have a built in menu option to do it, or they assume that the built in VS way is the only way. People like this tend to be the type of developers that can make stuff work, but because they aren't curious they never really learn how things are put together and their lack of knowledge comes out in several ways. The most common one is wheel reinventions, because googling available wheels isn't something they'd ever think of. Another common one is writing very inefficient code because they don't understand what's under the hood.
- felipeerias 9y agoFor a large codebase, normally I use the thing, note the different UI elements and messages, search the code to find where they are created and set up, pick one, and look into what happens when that particular element is triggered by the user. In other words, ask "how does button ABC do its thing?" or "where does message XYZ really come from?" and plunge down the rabbit hole. This tends to be a more fruitful approach than trying to understand how the whole application works from start to finish. Moreover, with existing codebases it usually happens that most of the issues are not in starting and finishing, but in all that happens in between. In terms of IDE support, for me the most important feature is good search. When I stumble upon a hairy-looking method, for example, I want to be able to quickly see where and how it is being used.
- devnonymous 9y ago> Why should I know the exact signature of the main method? It's not like you write it every day. Honestly we can't go from disliking ^typical^ interview questions that have no relation to our daily work all the way to this. The signature of the main function is standard in possibly every programming language and should be derivable by anyone who knows how programs work.
- lomnakkus 9y agoRight, that's why main in Java returns void, and not an Int/Short. Hang on...
- legulere 9y agoAlso java main needs arguments, in C `int main(void)` is valid. Java also takes an String[] as a parameter while C takes an int argc and a char argv. Clearly devnonymous has never programmed in his life if he does not know the exact main function signatures of java and C...
- devnonymous 9y agoWhen I said... > should be derivable by anyone who knows how programs work. That ought to have been a clue. Knowledge of the function signature of the entry point of a program ought to indicate why the signature is the way it is for your favourite programming language. Although now, judging by the replies. Seems like that's a bar a little too high. /sigh, yep I think I should retire soon.
- nadbor 9y agoThis is a phone screen. I have a candidate who presents himself a Java expert with all kinds of projects under his belt, certificates etc. He does give vaguely sensible answers to my questions but refuses to name any Java standard library class, any specific method in Spark (which he also claims to be using extensively), no specifics of anything. At this point I'm starting to wonder - is this guy really a hands-on programmer? Does he actually, personally write code? Sure, we all use IDEs and don't have to remember everything exactly, but this guy is drawing blanks on the seemingly most basic things. How do I find out? What is the one thing it is impossible to not know if you're any kind of java programmer. Hence - public static void main(String[] args) Please understand that I don't care if the candidate remembers Java syntax for it's own sake. We don't even use Java at this project. I only ever ask Java questions if this happens to be the candidate's favourite language. If you don't remember how to write the 'Hello World' program in your favourite programming language after more than a decade of using it, then I don't even want to see you embarrass yourself in the next stage hands-on coding interview.