10
votes
Network Interface Object
the posted code causes the compiler to output several warning messages.
When compiling, always enable the warnings, then fix those warnings.
Here is the compile statement and the resulting warning ...
10
votes
Accepted
Network Interface Object
There is no guarantee that write writes out the entire buffer. This means that
...
4
votes
Accepted
Simple web service call with retries
In general if you have a goto statement, you should reorder your code to not need it. In this case, your code actually tries 9 times, not three, because you ...
4
votes
Program for creating custom directory listings
You care about state of the art: that's good! But CGI and state of the art do not go in the same sentence.
You're writing for integration to a specific server, Abyss, whose Python support explicitly ...
4
votes
Accepted
Microservice that fetches data from REST repository endpoints on Github
The main improvements can be done in your two helper functions. Your first function could use the builtin collections.Counter:
...
4
votes
Microservice that fetches data from REST repository endpoints on Github
The two functions you broke out (LanguagesCounter, and RepoListLanguages) both could be simplified significantly using list ...
3
votes
Getting metadata from MusicBrainz service
Some quick remarks:
Properly name things. avail_recordings and fpcalc_output do not follow the Microsoft guidelines (e.g. don't ...
3
votes
Accepted
Getting metadata from MusicBrainz service
Here are my observations:
There are couple of unused namespaces
right click on the namespaces then select the Remove and Sort Usings
menuitem
acoustid_mbids \ <...
3
votes
Accepted
3
votes
Accepted
Callback usage with custom Stack Exchange Flair
I wouldn't say the code is difficult to follow but I do have some suggestions.
The first thing I notice is that some variables are declared with let. Many of those ...
3
votes
Simple web service call with retries
Retry logic is usually a bit of a code smell. It's not very common to have a transient error that is common and resolved in the space of a few seconds of retry logic. In such a scenario it may be ...
2
votes
Simple web service call with retries
I would like to add few more suggestions to the previous answer. The idea is to set minimum delay, maximum delay and step delay, this will help us in increasing of delay progressively, irrespective ...
2
votes
Pool of two objects for a web service
I have plenty of things to say here..
You should apply separation of concerns by isolating the pooling behavior from the logic of the webmethod itself.
you might want to create both instances at ...
2
votes
Single instance of reusable HttpClient
I suggest
private HttpClient Client { get { return _Client = _Client ?? GetNewClient(); } }
Instead of
...
2
votes
Accepted
2
votes
Accepted
Web Service that gets data from multiple tables in a database using EF Core Database-First approach
Controllers should be kept as lean as possible. Consider adding another layer of abstraction specific the controller in order to separate concerns.
...
2
votes
Accepted
Gin framework project with an endpoint to return a list of users based on their score
Let's start by addressing your 2 main questions:
1. Visibility (exporting) of functions
Yes, there's a very easy way of doing this, by using receiver functions (methods), and interfaces. Golang ...
2
votes
Decorate a python function to work as a Google Cloud Function
Decorator Function -> Decorator class
IMO, this decorator function should be a class. The use of global pool hints at this, the decorator needs to maintain some ...
2
votes
Accepted
Most efficient way to check if user is allowed to update an object
Soo ... I'm not quite sure how to formulate this without it sounding brash, but... Both of these methods are less than ideal...
Let's follow the behavioural flow to see what issues this code has:
The ...
2
votes
Tiny Network Web Framework / Library in C++
General Observations
First off, nice a Server and Client Library in 1250 lines of code!
This review does comment on some code in the repository that is not included in the question.
One of the rules ...
2
votes
Microservice in Springboot
Actually I did not reviewed your code as such (as warned by @Emma). But for an "architectural" perspective I see some improvements. However some are more personal guts than real good ...
2
votes
A program designed to update fields in Service Now depending on type
Pathlib
_filePath = os.path.splitext(__file__)[0]+'.exe'
is better expressed as
...
1
vote
Flask static url view
The good thing is that you are using the logger module. It is very useful for debugging too. But then you should not do this:
...
1
vote
Flask static url view
Don't provide multiple methods -
methods=('GET', 'POST')
only to then check the method:
if request.method == 'POST':
Instead, ...
1
vote
Accepted
Retrieve filename and ID with Google Drive API in C#
First of all let me clarify that I'm not familiar with the Google Drive API. I've done some refactoring but I haven't tested it (just make it compile).
If I can assume you are using greater C# version ...
1
vote
Accepted
Properly disposing of a WCF connection using IDisposable
The adviced way to call a service endpoint when the connection is not an open stream, is to have the lifecycle of you client in line with the operation you are calling.
So rather than storing an ...
1
vote
Accepted
Java Messenger data transmission
Is it common practice to use ObjectStream's with a custom "Protocol"/Packet to transmit data or should I use already existing protocols like HTTP instead?
I am not en expert and would say that it ...
1
vote
Accepted
Web application response message API
It seems to me that you are somewhat reinventing gettext. So if your system allows it, you could use it instead.
You would need to change your ...
1
vote
Find currency exchange rates
What if in future we need to add different providers with different representation? How can I make it more flexible and keep the core logic decoupled?
It seems like the parser in parse-xml.js is ...
1
vote
Accepted
User registration - Controller, service and repository layers in Spring framework
Should I keep in my Controller class just AuthService field? I'm using userRepository to check if username and email is available.
I think it is ok to use the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
web-services × 94c# × 33
python × 17
java × 15
php × 8
javascript × 7
asp.net × 7
rest × 7
python-3.x × 6
object-oriented × 6
api × 6
wcf × 6
performance × 5
.net × 5
json × 5
go × 5
http × 5
spring × 5
beginner × 4
multithreading × 4
networking × 4
server × 4
soap × 4
jquery × 3
design-patterns × 3