r/AskProgramming • • Mar 24 '23

ChatGPT / AI related questions

145 Upvotes

Due to the amount of repetitive panicky questions in regards to ChatGPT, the topic is for now restricted and threads will be removed.

FAQ:

Will ChatGPT replace programming?!?!?!?!

No

Will we all lose our jobs?!?!?!

No

Is anything still even worth it?!?!

Please seek counselling if you suffer from anxiety or depression.


r/AskProgramming • • 47m ago

What systems are you developing / what field you work in as a dev?

• Upvotes

Hey guys!

So lately I hear a lot about who and who will not / could not be replaced by AI. I don’t really want to talk about AI here, just this sparked my curiosity, as to learn some statistics about my colleagues from another mother.

I know that I can be in danger of replacement, I work in an indoor positioning field, managinf the backend microservices, kubernetes, postgres, etc… it can be challenging sometimes to improve performance, but still it’s mostly a CRUD app (the positioning. algorithm part was developed by another, more math heavy team). I started programming at uni, not at early ages, It is also not my life, i don’t do programming apart from work, i value my free time a lot, I do read a lot about it tho, books, courses etc. But i was never an algorithmically or marhemtically gifted dev. I do consider myself good, or at least not bad, but by no means exceptional. I know I never will write a kernel or a compiler, but I also never intend too.

So, I’m just curious about you guys, how hard do you deem your work to be, because I really hear a lot about how AI can’t replace these very complicated fields, I don’t know how many of us actually work in such a field.


r/AskProgramming • • 4h ago

Career/Edu What's the hardest part when you're handed code you didn't write?

2 Upvotes

Curious about this, especially from people early in their careers (or who remember being there).

Most of us learn to code by building things from scratch: tutorials, class projects, personal apps. Then the first real task at a job or internship is usually "here's the existing codebase, fix this bug" or "add this feature."

When that happened to you, what was actually the hardest part?
- Not knowing where to start reading?
- Understanding how the files/folders connect?
- Figuring out where the bug actually lives?
- Being afraid to break something?
- Something else entirely?

And if you got past it, what helped most? Would love to hear from both juniors and seniors.


r/AskProgramming • • 6h ago

Career/Edu Should I teach myself SWE or Cybersecurity?

1 Upvotes

I really dont mind which one you recommend me.

If its cyber - im gonna learn how to ethically hack, climb leader boards on sites, grind CTFs and HTB etc

if its SWE - i really like the idea of graphics programming and i would probably play around with opengl and build a game engine

i have no experience in programming, im 17 and i just want something to do in my freetime that has a genuine chance in landing me job in the future

not sure if im gonna major in comp sci, might major in math, neuroscience or psychology. not sure yet


r/AskProgramming • • 13h ago

Building a public combined search for multiple databases

7 Upvotes

Okay so

I’m working for a department with a public facing website to search for a bunch of different reports across years. They changed the rules for the reports a few times and they ended up partitioned into different databases based on rule set (ie there is a search for reports using old rule set and a separate search for reports with new rule set) However my supervisors are tired of having to go into different search engines to find the reports and would prefer if they had a search that could look through them all at once. They would also like this kind of function implemented on the public website so that visitors also do not have to go through multiple search engines.

The website runs on wordpress

My knowledge in coding is not zero but it’s fairly rudimentary. Is there a way to make the search function they want? What kind of skills should I learn? SQL?


r/AskProgramming • • 14h ago

Algorithms What is you favorite platform for competitive programming or coding challenge problems, and why?

2 Upvotes

Hi all! My name is Mike and I am a computer science teacher who enjoys competitive programming. I am hoping to incorporate more competitive programming into my teaching and I was wondering if you might be willing to share which platforms you use and your thoughts on them.

I currently know about several platforms such as LeetCode, Codeforces, Kattis, etc. Any input that you can offer is greatly appreciated. Thank you!


r/AskProgramming • • 20h ago

C# Would Unit Testing be a net benefit when your code relies heavily on another API

3 Upvotes

I am debating re-writing a plugin for AutoCAD, which uses the .NET C# API. The current version of that plugin does not have unit or integration tests. This is because unit tests cant really be written if you are using the AutoCAD API's objects as they only exist in an AutoCAD runtime. Which would lead to integration tests, which as do able just require a bit of extra work.

In order to implement unit testing, the domain/business logic would need to be extracted. I started working on this, but quickly start asking "Is this going to be worth it?"

For example one of the most important/foundational types in my plugin is a "Zone"

public class Zone
{
    private readonly IZoneDataProvider? _dataProvider;
    private readonly IZoneGeometry? _geometry;

    public Zone(IZoneDataProvider dataProvider, IZoneGeometry? geometry = null)
    {
        _dataProvider = dataProvider;
        _geometry = geometry;
    }

    public string? ZoneId
    {

        get => _dataProvider?.ZoneId;
        set => _dataProvider?.ZoneId = value;

    }   

    public bool IsInside(Point3? point)
    {
        if (point is null || _geometry is null) return false;
        return _geometry.Contains(point.Value);
    }
}

This is a simplified version of a the Domain class for a Zone. A Zone in AutoCAD is a Polyline, which is an AutoCAD type.

IZoneDataStore is for handling the storage of business logic related data. ZoneId is assigned to the Zone. For unit testing an in memory data store would be used. In an AutoCAD environment a wrapper class around an AutoCAD Polyline object would be supplied and handle the storing of data on that AutoCAD object.

IZoneGeometry is for other AutoCAD objects to query their location against a Zone to see if they are inside, leading to other business rules.

That explains IZoneDataProvider and IZoneGeometry, which are both implemented in classes for unit testing as well as in adapter classes for AutoCAD.

Where I start asking the question "Is all this extra work worth it?" is when I get to another business rule. One example is a change the color of the Zone Polyline and other objects to match that color.

When a Polyline is "made" a Zone its color is changed according to its ZoneId and some business logic which isn't important. But if I want to add this to the domain object as business logic, I then need an interface like

public interface IZoneColorEntity
{
  public short? CurrentColor { get; set; }

}

So now the adapter class for the Polyline which represents an AutoCAD Zone not only needs to implement IZoneDataProvider, IZoneGeometry, and now IZoneColorEntity.

In essense it feels like I'm making interfaces that mirror the AutoCAD API, because the business logic really is tied to manipulating those objects in CAD.

And this is only the first main class I'm implementing that I'm running into this thought. I wonder if it might be better to just ignore the unit test idea all together and just focus on integration tests? Essentially removing the idea of a Domain project.


r/AskProgramming • • 7h ago

Java Is my code too massive?

0 Upvotes

<SOLVED>

So I'm making a simple messenger as my first project, though now when I'm working on it it seems VERY massive to me, is it normal in other projects or am I supposed to break it into smaller parts?

import java.io.*;
import java.util.*;
import java.net.*;

class server{

    private Socket s = null;
    private ServerSocket ss = null;;
    private DataInputStream din = null;
    private DataOutputStream dout = null;
    static Vector<ClientHandler> array = new Vector<>();
    private HashMap<String, String> login = new HashMap<>();
    void main(String[] args) throws IOException
    {
        // initialize
        try {
//            BufferedWriter bw = new BufferedWriter(new FileWriter("logindata.txt")); idk yet
            BufferedReader br = new BufferedReader(new FileReader("logindata.txt"));
            StringTokenizer st = null;
            String templine = "";
            String loginName = "";
            String pass = "";

            while(((templine = br.readLine()) != null)){
                st = new StringTokenizer(templine, ": ");
                if(st.hasMoreTokens()){
                    loginName = st.nextToken();
                }
                if(st.hasMoreTokens()){
                    pass = st.nextToken();
                }

                login.put(loginName, pass);
                loginName = "";
                pass = "";
            }

        }
        catch(FileNotFoundException i){
            System.out.println("Failed to initialize login file");
        }
        String receivedName = "";
        String receivedPass = ""; // <TODO> encrypt passwords after finishing filework <IMPORTANT>
        int i = 0;
        ss = new ServerSocket(5001);
        boolean userExists = false;
        while(true)
        {
            s = ss.accept();
            din = new DataInputStream(new BufferedInputStream(s.getInputStream()));
            dout = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));

            receivedName = din.readUTF();

            for(Map.Entry<String, String> entry : login.entrySet()){
                if(entry.getValue().equals(receivedName)){
                    userExists = true;
                    break;
                }
            }

            if(userExists){
                dout.writeUTF("User found, enter your password: ");
                dout.flush();
            }
            else{
                dout.writeUTF("User was not found, u may register by making a password: "); // <TODO> make a check if password was written correctly
            }

            ClientHandler client = new ClientHandler(s, receivedName, din, dout);
            System.out.println("User " + receivedName + " Accepted");

            Thread t = new Thread(client);

            array.add(client);

            t.start();

            i++;
        }

    }
}

r/AskProgramming • • 1d ago

Is this book worth learning slowly over time?

1 Upvotes

Introduction to Algorithms, Fourth Edition by Thomas H. Cormen


r/AskProgramming • • 1d ago

Career/Edu Can I Become a Software Engineer Without a CS Degree?

17 Upvotes

Can someone with a non-tech degree become a software engineer today through self-study?

I don’t have the option to attend college or get an academic CS degree. Would following a curriculum like OSSU or Teach Yourself CS be enough to build the necessary knowledge and skills?

Any advice would be appreciated.


r/AskProgramming • • 2d ago

Should I learn C or Rust?

7 Upvotes

I’ve been working as a Java programmer for a few years now.

The thing is, I’d like to learn a second programming language for lower-level tasks—specifically, I want to work on things related to operating systems. Rather than building one from scratch, I’d like to explore and modify open-source operating systems like Linux or a BSD variant.

I’m doing this purely as a hobby. What drew me to C is its simplicity (though not necessarily ease of use) compared to Java or other modern languages, and its long history of use in systems programming. On the other hand, however, there are operating systems (or components of them) being rewritten in Rust—such as GNU coreutils or the adoption of Rust in the Linux kernel.

So, would it be more useful in the long run to learn Rust, given that it might sooner or later become the standard for writing operating systems?

Thanks.


r/AskProgramming • • 1d ago

Career/Edu Would C# or C++ be better for school coursework?

0 Upvotes

Hello all,

I just started the A Level course for computer science, which involves a section of coursework where we have to solve a problem for a business with a program that handles and processes some kind of data. We've been doing C++ in class, which was new to me at the start, but I was great at Python in secondary, and picked it up extremely quick - the teacher will give us a task to do for the last 45 minutes and ill do it in 5-10 minutes.

For the coursework, youre able to use pretty much any programming language you like, but the majority of the people in my class will be doing C++ as that's what we're being taught. I was told that if I'm more comfortable using a different language I can use that, but my teacher only knows C++ so won't be able to help me if I run into trouble. However, he does also say that there are some people in our class (maybe me) that are better than him at programming, as he knows just enough for the coursework, so it wouldn't make much a difference in that case.

I have limited experience with C#, but after a quick bit of (limited) research, I've come to the conclusion that C++ is a lower level language so faster and more efficient if done right, but C# is more forgiving? Please correct me if I'm wrong.

So my question is: is it worth learning C# in my own time to use for my coursework? Id like to add that ive always wanted to do game design in Unity, so if I did C# I would have a space to practice, rather than just doing a bunch of small exercises in C++.


r/AskProgramming • • 1d ago

What's the best platform for an open collaborative project?

0 Upvotes

I'm working on an open source classification system for the web (alphanumeric calls with an XXX.XXX.XXX format) -- called the Open Classification System. I'd like to have open forums for public discussion and feedback, but restrictive voting for board members.

Thinking of going old-school democracy and appointing board members randomly, instead of by vote -- to keep things relevant to laymen.

Basically, like the Dewey Decimal System, things will need to be moved around and recategorized over time.

SOC.ANT.CUL may eventually become SCI.ANT.CUL, for example.

Unlike the OCLC, I don't plan on suing everyone who uses the system for every tiny IP violation.

I'm needing it broad enough to cover a range of topics: from product domains and local municipalities to academic disciplines.

All I'm seeing right now is Reddit. Lemmy isn't nearly as restrictive enough, but I don't want to worry about all the moderator tools and restrictions and BS either.

In your experience, what platforms work best for this kind of thing?

  • Public discussion
  • Approved board member voting

r/AskProgramming • • 1d ago

Are you guys writing code or prompting AI at work?

0 Upvotes

Looking for honest answers.

We’re mainly prompting and reviewing code. We haven’t had any abnormal issues with the codebase and we’re all are decent engineers. We just don’t manually code much anymore.

Curious what other companies are doing?


r/AskProgramming • • 2d ago

Normal amount of lines for PR review

8 Upvotes

Hey guys, hoping to get some insight and opinions here.

As you all know with the boom of AI, people are vibe coding away which results in crazy amounts of code lines (newly added and removed). I'm just wondering what the general consensus is of what is acceptable to review, in one go by one person. Currently I'm staring at a PR with 3200 lines of newly added code. As of late, this is becoming the new norm whereas I was used to maybe a few hundred, MAYBE 1000. In another post, someone mentioned 0-500 was the norm prior to AI

What do you all think?


r/AskProgramming • • 2d ago

C/C++ Where to get started with advanced C++ template usage

6 Upvotes

As someone who went through a basic introduction to C++ through online lessons, followed by about 5 years of experience, I'm learning that real-world usage of the language is a lot more complicated than I thought.

One example of this I keep running into is the (ab)use of templates and static declarations. I already have a weak grasp on how exactly declarations work (I know static = internal linkage, extern = external linkage, except for in classes where it works more like Java's static keyword, but that's about it), but templates complicate things even further than what I'm comfortable with.

Is there a good resource for learning template metaprogramming and other advanced tricks which use templates? I tried looking it up on multiple occasions, but all the results showed very simple examples (like a template with arguments A and B that adds them together when instantiated) that I couldn't figure out how to apply anywhere else.


r/AskProgramming • • 2d ago

Career/Edu Useful projects you developed

2 Upvotes

Hello

What are some cool projects you personally developed to help you in your daily life that you actually benefit from?

Thank you.


r/AskProgramming • • 2d ago

QT6 C++ on VSCode - QApplication No such file or directory. How to set up properly?

0 Upvotes

Edit: Problem resolved: Register Qt Installations

I am encountering the error:

text QApplication: No such file or directory

or whichever #include from Qt is at the top.

Here is what I have done so far:

1. CMake

I have CMake installed:

text cmake version 4.3.0

2. CMakeLists.txt

I created a CMakeLists.txt based on the settings from the Qt documentation example:

```cmake cmake_minimum_required(VERSION 3.16)

project(QtApp VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 REQUIRED COMPONENTS Core)

qt_standard_project_setup()

qt_add_executable(QtApp main.cpp )

target_link_libraries(QtApp PRIVATE Qt6::Core) ```

3. main.cpp

```cpp

include <QApplication>

include <QWidget>

int main(int argc, char *argv[]) { QApplication app(argc, argv);

QWidget window;
window.resize(800, 600);
window.setWindowTitle("Qt 6 App");
window.show();

return app.exec();

} ```

4. VS Code extensions

I have the following extensions installed:

  • CMake Tools
  • Qt C++ Extension Pack

It feels like I have done everything essential, but I haven't found a proper tutorial. Maybe I have missed something?


r/AskProgramming • • 3d ago

C/C++ Help

2 Upvotes

I’ve been learning programming for about 5 months now. I’ve finished C and C++, and I’m almost done with data structures, but so far I feel like I’m doing something wrong or missing something. I feel like I don’t know how to think correctly, and even very simple things slip my mind, and I don’t know how to do them. So I need help because I don’t know whether I should take a course or if I’m on the right track—and that’s normal, especially since I’ve only been at this for about six months, which isn’t a short time. I’m planning to apply for the Digital Egypt Pioneers scholarship to specialize in backend. Is this the right path, or not? I hope those with experience and who’ve come a long way can help us out—and I’m very grateful to them 🤍🤍🙏🏻


r/AskProgramming • • 4d ago

Career/Edu Career shift after PhD

3 Upvotes

Hello,

Am doing PhD in mechanical engineering and currently am in my last year, am thinking seriously of leaving Academia and becoming a software engineer but I have no clue from where to start, what certification do I need? What should I prepare to apply for companies in my field? (Based in Japan for now)

I can write scripts in python, did signal analysis with data regression and classification using neural networks (tensorflow) and I have two published papers. Also, no background on data structures and algorithms

I know someone would say this is too academic but this is the issue am seeking guidance of !!

So if anyone went through same experience please tell us.


r/AskProgramming • • 4d ago

Career/Edu Graduation project Ideas

5 Upvotes

I am in my third year Software Engineering (Licence 3)

i am a Web developer (focusing more in backend )

i dont want to kust build a simple CRUD website for graduation. i want idea that impress the doctors. why not a Startup idea , saas.

if anyone has any idea please tell me in the comments


r/AskProgramming • • 4d ago

Question proceed with python or c++ another language

2 Upvotes

Hey, i was able to get admission nto 4th year of CS highschool italy, before that i was graphic designer, i know fundamentals of java, and our prof... Said this we are gonna start Java from 0 and next year JavaScript then sql database etc..., i feel like shouldn't try to maximize java cause we are already gonna do it in class, so i was thinking to do another language at home, should I learn c++ rather than python cause there are so many py dev, and c++ is more paid and used in newer HFT firms while Py do have ML etc.. advantages, i don't get it its not like if choose python i will never learn another language or vice versa, i just want to enhancen myself to be at least have edge on everyone around me, then after becoming decent going even with another language. I am new just sorry me i just want to know from experienced people rather than Google/Ai random subjective thoughts


r/AskProgramming • • 4d ago

Popular discord channels and other communities for CS?

3 Upvotes

Hello,

I'm looking for some active discord channels for software engineering or other type of communities (reddit ones that are less known would be nice to know as well). I've done some googling but to my surprise I can't find popular channels for discussion. If anyone knows any I'd be interested to hear.


r/AskProgramming • • 5d ago

cursed python hello world

0 Upvotes
Is there any way to make this code wok in python?

"hello"(print)

This is just a joke and i do not care how cursed of a setup this requires.

r/AskProgramming • • 5d ago

Career/Edu I have a new job and almost everything is done with AI. What are the bests ways to get better at programming here?

0 Upvotes

Hi!

In a lot of jobs in one year how most companies program has changed a lot.

I dont want to do the panic AI thing, I would like to know whats the best way to learn a new job in this way.

I started 2 months ago and they program almost everything with AI so i do the same. In my last job it was almost nothing (i think they are also changing as well to AI programming)

My question is: what is the best way to learn and be useful in this environment?

I dont know a lot of things and if I just let the AI do everything i will "get the job done" but I wont improve overtime. Im very confused about this situation because i normally have learned to program in the past programming and now i just prompt.

How do I get better at my job? How do i keep progressing and learning? Is any of you in a similar position? What did you do to adapt?

Looking forward to all your answers

Small edit: Also if you just prompt, what do you do until you get the answer? We use copilot with plan mode and it does a lot and it does it quite good but it could take from 5 min up to 3 hours in some cases