Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Lets say I have some inputs and I'm generating some output.
I don't need to maintain state.
Should I use a function or should I create a class that will have one method that
would look exactly like that function?
What are the advantages of one over the other?
(besides unit testing which is easier with the object)
Coming from a Java background, this question is like asking if you should create a static final "Utils" class, a service class to inject, or a "smart" data carrier with behaviour.
Just as a personal opinion, generally, if the methods truly are stateless, it's just easier and simpler to create a static final "utils" class.
But as someone pointed out in the comments above, it's as broad as long, really.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I understand that Chisel is a HDL/HCL language to overcome some of Verilog/SystemVerilog restrictions by using higher abstraction level.
And it is open source as well.
It might be a bit naive and presumptuous, but still I would like to ask.
My question is that why do so many similar efforts are working in parallel, e.g. Blusspec, spinalHDL, Pyha etc?
I mean, is there any reason why the development community may not choose one of these and concentrate efforts on stabilizing or enhancing one of these.
That's exactly what is happening now, it just takes a while to choose.
Although the past does not show that the best technology wins, let us hope it does this time.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
A couple of years ago (2011/2012) I remember stumbling across a paper or a webpage which talked about how in pure functional languages, you can tell a lot about what a function will do just by examining its type signature. Unfortunately after much Googling I haven't stumbled across it again. (Partly because I don't know what search terms to use)
My question is: How much information about a function can you deduce from its type signature?
For massive brownie points: Provide some links to external resources which discuss this or related issues
An example of what I'm looking for: If I remember correctly, a function with the type signature a -> a has to be the identity function.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Since I have started programming in VBA I have used
this website as basically my bible. However I don't see any mention of whether or not to comment my variables.
After doing a fair bit of research online I have been able to find very little regarding the topic at all. So I though I would see about getting your guys opinion on whether or not commenting variables is worth it. Any feedback is appreciated.
I tend to comment my variables when I think their purpose might be confusing. Generally, I try to create descriptive variable names so that I can tell at first glance to what they refer. However, with some calculations, and in some circumstances, it's difficult to determine just from the variable name its intended function. In these cases, I'd throw in a comment.
I'd say overall, it should be left to the user's discretion. Do you think it's difficult to understand what it does? If so, comment it.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
as the title suggests, I am trying to determine which language would better suit for the task at hand. I am probably going to include a GUI for the program. Am I okay to proceed with Java for this task or is another language recommended? Thanks
I can't speak on the pros or cons of writing such a program in C++. However, Java seems well suited to accomplish your task.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I had to do a overview for a customer meeting, and they requested flow charts. It had never occurred to me that there was no switch symbol in any of the flow charting I've seen. I know functionally they are similar, but documentation should represent the code you've written or are planning too. Maybe I'm just being picky, but it seems like a common enough construct that it would have "representation."
Pete
My impression is that diamonds are the correct symbol for switches (multidirectional branches) as well as binary decision points — i.e. the diamond is any conditional. One just gets the idea that diamonds are for either/or because that's their most common use.
The difference between a series of if's and a switch is irrelevant at the flow chart level. Both are a series of conditionals. If you want to document your code down to the if/switch level, just print out the code.