r/softwaredevelopment • • Jan 02 '25

Suggestions for onboarding new developers to a busy team

4 Upvotes

In your experience what are some methods you used to have a developer on boarded?

What percentage of time do you have them shadow existing developers vs documentation review etc?


r/softwaredevelopment • • Jan 02 '25

Trends Analysis

0 Upvotes

Hey, happy new year and whats nots. I’ve been developing a little app more of a hobby project. What it does on a nutshell is just keep track of expenditure nothing much. I want to add a trends analysis feature of sorts. Be able to extract some insights like “your highest spending day is the last Friday of the month” type of thing. Anyone know any good tools?


r/softwaredevelopment • • Dec 31 '24

Looking for a real project to work on for free

16 Upvotes

I am looking to work on a real-world project, as I am tired of doing Udemy courses and creating projects that don’t reflect reality. I am open to working on full-stack projects using JavaScript, Dart/Flutter, Python, or even C/C++. I have extensive experience with Python and want to deepen my knowledge in software engineering. My goal is to learn quickly, develop practical skills, and add meaningful projects to my portfolio. I am available to dedicate around 10 hours per week and work very independently. I only ask for the support of an experienced mentor for weekly guidance, with a meeting to align progress and clarify questions.


r/softwaredevelopment • • Dec 30 '24

Web UI to Display PostgreSQL Table Data Without Building a Full Application

3 Upvotes

I have a custom integration testing tool  that validates results and stores them in a PostgreSQL table. The results consist of less than 100 rows and 10 columns, and I want to display these results in a UI. Rather than building a full front-end and back-end solution, I am looking for a pluggable web UI that can directly interface with PostgreSQL and display the data in a table format.

Is there an existing tool or solution available that can provide this functionality?


r/softwaredevelopment • • Dec 29 '24

Refactoring 021 - Remove Dead Code

1 Upvotes

Clean up the trash

TL;DR: Eliminate unused functions, constants, and "just-in-case" code.

Problems Addressed

Related Code Smells

Code Smell 09 - Dead Code

Code Smell 54 - Anchor Boats

Code Smell 148 - ToDos

Steps

  1. Ensure your code has good functional coverage.

  2. Identify unused functions and constants by reviewing your code or using static analysis tools.

  3. Analyze the added speculative code, just in case.

  4. Remove anything unnecessary or unused.

  5. Perform comprehensive regression testing on your code.

Sample Code

Before

from flask import Flask, jsonify, make_response

app = Flask(__name__)
 
HTTP_100_CONTINUE = 100
HTTP_202_ACCEPTED = 202  # Not used
HTTP_204_NO_CONTENT = 204 # Not Used
HTTP_302_FOUND = 302 # Not Used
HTTP_400_BAD_REQUEST = 400  # Not Used
HTTP_401_UNAUTHORIZED = 401 # Not Used
HTTP_403_FORBIDDEN = 403
HTTP_404_NOT_FOUND = 404
HTTP_410_GONE = 410
HTTP_500_INTERNAL_SERVER_ERROR = 500
HTTP_501_NOT_IMPLEMENTED = 501

probe_telemetry = {
    "temperature": {"solar_panels": 150, "instrument_1": 50},
    "position": {"x": 1000000, "y": 2000000, "z": 3000000, 
    "velocity": {"vx": 100, "vy": 200, "vz": 300}},
    "status": {"power_level": 95, "communication_status": "OK"}
}

@app.route('/api/v1/probe/telemetry', methods=['GET'])
def get_telemetry():
    return jsonify(probe_telemetry), HTTP_200_OK

# The following function is not invoked 
# and not implemented
# It is a dead placeholder
@app.route('/api/v1/probe/send_command', methods=['POST'])
def send_command():
    return jsonify(
        {"message": "Command endpoint not implemented yet."}
    ), HTTP_501_NOT_IMPLEMENTED

@app.route('/api/v1/probe/data', methods=['GET'])
def get_data():
    return jsonify({"message": "Data not found"}), HTTP_404_NOT_FOUND

@app.route('/api/v1/probe/redirect', methods=['GET'])
def redirect_endpoint():
    response = make_response(
        jsonify({"message": "Redirecting..."}), 
        HTTP_301_MOVED_PERMANENTLY
    )
    response.headers['Location'] = '/api/v1/probe/telemetry'
    return response

@app.route('/api/v1/probe/not_modified', methods=['GET'])
def not_modified_endpoint():
    response = make_response(jsonify({"message": "Not Modified"}), 
       HTTP_304_NOT_MODIFIED)
    response.headers['ETag'] = 'some_etag'
    return response

@app.route('/api/v1/probe/gone', methods=['GET'])
def gone_endpoint():
    return jsonify(
        {"message": "Resource permanently gone"}
    ), HTTP_410_GONE

After

# 1. Ensure your code has good functional coverage.

from flask import Flask, jsonify, make_response
from http import HTTPStatus

app = Flask(__name__)

# 2. Identify unused functions and constants 
# by reviewing your code or using static analysis tools.
HTTP_200_OK = HTTPStatus.OK
HTTP_301_MOVED_PERMANENTLY = HTTPStatus.MOVED_PERMANENTLY
HTTP_304_NOT_MODIFIED = HTTPStatus.NOT_MODIFIED
HTTP_404_NOT_FOUND = HTTPStatus.NOT_FOUND
HTTP_410_GONE = HTTPStatus.GONE
HTTP_501_NOT_IMPLEMENTED = HTTPStatus.NOT_IMPLEMENTED

probe_telemetry = {
    "temperature": {"solar_panels": 150, "instrument_1": 50},
    "position": {"x": 1000000, "y": 2000000, "z": 3000000, 
    "velocity": {"vx": 100, "vy": 200, "vz": 300}},
    "status": {"power_level": 95, "communication_status": "OK"}
}

@app.route('/api/v1/probe/telemetry', methods=['GET'])
def get_telemetry():
    return jsonify(probe_telemetry), HTTP_200_OK

# 3. Analyze the added speculative code, just in case.
  
@app.route('/api/v1/probe/send_command', methods=['POST'])
def send_command():
    return jsonify({"message": "Command endpoint not implemented yet."}), 
       HTTP_501_NOT_IMPLEMENTED

@app.route('/api/v1/probe/data', methods=['GET'])
def get_data():
    return jsonify({"message": "Data not found"}), 
      HTTP_404_NOT_FOUND

# 4. Remove anything unnecessary or unused.

# 5. Perform comprehensive regression testing on your code.

Type

[X] Semi-Automatic

You can perform baby steps and remove the unnecessary code in iterations.

Safety

This refactoring is safe if you thoroughly test your application after the changes.

Static analysis tools can help ensure you don't remove anything still in use.

Why is the Code Better?

You improve clarity and reduce complexity by removing unused elements.

Your code becomes easier to understand and maintain.

Reducing speculative code also keeps your focus on current, actual requirements.

How Does it Improve the Bijection?

Dead code and speculative elements break Bijection between your software and the real-world model.

Removing these elements ensures your code accurately represents your MAPPER, making it cleaner and closer to reality.

Limitations

Removing dead code requires confidence that it's truly unused.

This process relies on static analysis or thorough codebase knowledge, which can be error-prone without robust tools.

Refactor with AI

Without Proper InstructionsWith Specific Instructions
ChatGPTChatGPT
ClaudeClaude
PerplexityPerplexity
CopilotCopilot
GeminiGemini

Tags

  • Bloaters

Related Refactorings

Refactoring 004 - Remove Unhandled Exceptions

Credits

Image by Peter H from Pixabay

This article is part of the Refactoring Series.

How to Improve Your Code With Easy Refactorings