/r/learnprogramming

Photograph via snooOG

A subreddit for all questions related to programming in any language.

Welcome to LearnProgramming!


New? READ ME FIRST!

Posting guidelines

Frequently asked questions

Subreddit rules

Message the moderators


Asking debugging questions

If you need help debugging, you must include:

  1. A concise but descriptive title.
  2. A good description of the problem.
  3. A minimal, easily runnable, and well-formatted program that illustrates your problem.
  4. The output you expected, and what you got instead. If you got an error, include the full error message.

See debugging question guidelines for more info.

Asking conceptual questions

Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.

See conceptual questions guidelines for more info.

Other guidelines and links

  1. Frequently asked questions
  2. Asking homework questions
  3. Asking for code review
  4. Answering questions
  5. Learning resources
  6. Other communities

Subreddit rules

1. No unprofessional/derogatory speech

  • Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.

Abusive, racist, or derogatory comments are absolutely not tolerated.

See our policies on acceptable speech and conduct for more details.

2. No spam or tasteless self-promotion

In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".

Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.

Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.

3. No off-topic posts

  • Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".

Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.

See our policies on allowed topics for more details.

4. Do not ask exact duplicates of FAQ questions

  • Do not post questions that are an exact duplicate of something already answered in the FAQ.

If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.

5. Do not delete posts

  • Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.

Use the "solved" flair instead.

6. No app/website review requests or showcases

  • Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.

Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.

7. No rewards

  • You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.

In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.

8. No indirect links

  • All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.

For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.

Udemy coupon links are ok: the discount adds "additional value".

9. Do not promote illegal or unethical practices

  • Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.

This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.

Trying to circumvent the terms of services of a website also counts as unethical behavior.

10. No complete solutions

  • Do not ask for or post a complete solution to a problem.

When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.

If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.

See our guidelines on offering help for more details.

11. Don't ask to ask.

  • Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.

We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.

We also do not encourage help via DM for the same reasons - that more people can benefit

12. Low Effort Questions

  • Do not ask easily googleable questions or questions that are covered in the documentation.

This subreddit is not a proxy for documentation or google.

We do require effort and demonstration of effort.

This includes "how do I?" questions

13. No AI (chatGPT etc.) generated messages/comments. No questions about chatGPT/AI generated code.

  • Such posts/comments will be removed without warning and the poster of ai generated content will be instantly banned.

/r/learnprogramming

4,079,914 Subscribers

1

Programming side hustles?

I’ve heard that one of the best ways to learn programming is to create projects which use skills you’re learning about. As of now, I’m decent at Python, JavaScript, HTML, and CSS. But I’m only 17 years old and have a hard time finding things I could do for people that could earn me some money. What are some side hustles I could do using the skills I’m already semi comfortable with or maybe only requires me to learn an easy skill on top of what I know which would allow me to not only practice my programming, but also make me some money as well? Is there anything I could do? I’ve been researching this and haven’t been able to find anything so far. Hopefully someone can be the shortcut in my research! Thanks in advance to whoever helps me!

1 Comment
2024/04/05
08:07 UTC

1

Java vs C#: Which feels better to work with for backend?

I've recently been laid off as a full-stack developer, and I didn't enjoy the technology I was using in my previous job much (Node & Vue.js with Composition API and JS). In the job market of my country, I've noticed that most opportunities are in Java with Spring Boot and C# with .NET.

I'm currently deciding which one to pursue for a new career in backend. However, I'm not focused on choosing the best option or the one that offers the highest salary. Instead, I want to opt for the one that provides the most satisfaction to work with on a daily basis and the one that sucks the least in terms of the ecosystem it operates within.

Basically, I'd enjoy working with a language that gives fair warnings in its console logs, works well within its own ecosystem and has good documentation. I'd hate a language where random issues occur and you need very hardcore knowledge to accomplish certain tasks/fix, which are easy to implement in other languages. Plus would be if I can accomplish the same tasks in less time compared to the other language.

I know it may seem not prudent to base my choice on a feeling for a language, but I believe that if I enjoy working with one more than the other, I can boost my career, enjoy the process of learning and be more productive.

Any comments or advice are appreciated. Thanks, folks!

1 Comment
2024/04/05
08:04 UTC

0

Seeking a mentor to accelerate my CS journey and career development!

Hey everyone, 

I’m a 2nd-year CS student looking for a mentor to accelerate my CS journey and career development.

I’ve slacked off for the past two years, but after much reflection, my commitment to coding and computer science has reignited, fueled by my raging confidence and drive. I’m committed to the journey and hope to turn my career around.

I’ve been making progress starting from scratch again for a month now. I want to accelerate my learning and progress with someone who can guide and support me. Previously, I was inefficient with my learning and did not try to apply any concepts I learned or pursue any personal projects. CS seemed daunting, and I didn’t have that much fun, so I put in little effort and produced little results. 

However, I’ve been actively refining my learning methodology to create the most efficient, productive, and sustainable path in my CS journey. I’ve integrated productivity and self-growth into my learning, aiming for a fulfilling and enjoyable tech career. I’ve already started diving into projects using JavaScript and React Native and sharing my knowledge through articles and explanations, which has significantly accelerated my progress.

Currently, I’m applying my skills and learning as I go in a startup environment, which has been such a transformative and fun part of my journey.

I’m looking for an experienced software engineer who is willing to answer my questions and help me pursue my personal projects. I hope to gain practical knowledge and experience and become more accountable and consistent in my programming goals. 

Of course, I’m willing to pay for this mentorship, as your guidance in navigating personal projects, coursework, and career decisions would be invaluable to me.

My questions range from helping me apply concepts practically to advice on tech-related growth and making my learning process more efficient and effective.

If you’re interested in mentoring and sharing advice, please DM me so we can talk more and set up a meeting! I’m excited and eager to learn and grow with your experience, and I look forward to a mutually enriching journey. 

Thanks for considering my request, and I look forward to hearing from you! 

1 Comment
2024/04/05
07:39 UTC

1

[C++] Segment Tree algorithm to find the number of intersecting segments for each segment

I am trying to solve this CF segment tree problem
The code I wrote is supposed to work as follows:

  1. Run through the whole array
  2. Check if it's left end of the segment and if it is, then put 1 in it's position in the segment tree
  3. Otherwise take the sum between the left end and right end and add into the answer array and update the left end's position in the segment tree to 0.
  4. Reverse the array, redo steps 1 to 3.

Input:

5

5 1 2 2 3 1 3 4 5 4

Expected Output:

1 0 1 1 1

Actual Output:

2 2 2 0 0

My code

1 Comment
2024/04/05
07:21 UTC

5

I'm stuck in a weird place in my coding journey.

So, let me give you a quick rundown of how I got here. When I was around 12-13, I stumbled into programming without even realizing it. It all started with me messing around with the Lucky Blocks mod in Minecraft, tweaking the drop rates to get crazy amounts of diamonds and god apples from a single block. People who know, know.. xd, what a time!

Then, at 14 ish, I got my hands on an Arduino Uno, and that was a game-changer. I'd already been messing around with electronics since I was like 7 or 8—basic stuff, like lighting up a bulb with a 9V battery, taking apart gadgets to see what's inside, you know the deal. But the Arduino was like magic to me. Being able to control electronics from a computer? Mind-blowing. I got pretty good at it and loved making little projects with it.

As I got older, around 15-16, my projects got more complex. I started making my own circuit boards, building lab power supplies, and adding all sorts of fancy features like LCD screens, user interfaces, and temperature control using STM32 dev boards. I even got into sending data to my phone using ESP8266. But even as I got deeper into programming, my heart was still in electronics. Programming was just a means to an end for me.

Then COVID hit, and with colleges closed, I had a ton of time on my hands. So, I decided to really dive into programming beyond just embedded systems. I tried my hand at different languages, and let me tell you, it wasn't all smooth sailing. I hit a few bumps along the way, but eventually, I got the hang of it. But here's the thing, I realized I'd been going about it all wrong. I'd been learning by doing, jumping into projects without really getting into the nitty-gritty stuff like optimizing data structures. The main goal back then were my projects, I just needed to learn enough so I can make my project. Learn by doing works well but it does leave holes in your knowledge which later do come to bite.

I'm 22 now, and due to some bad decisions, I didn't go the traditional university route. Instead, I'm doing a HND diploma in computer science. It covers the basics but leaves a lot to be desired, I'm itching to dive into more advanced projects and land a job. However, I've hit some hurdles along the way. I've got a handle on coding but topics like calculus, data analysis (especially for my current project), and understanding concepts like Big O notation for algorithms or the best design patterns for systems. A total mystery to me. While I can put together projects, doing them well requires a solid foundation in the basics.

This is the problem, I can learn online but I'm just not sure where to start. I want to have a solid understanding of the CS fundamentals, not just portions of it.

5 Comments
2024/04/05
06:11 UTC

1

I have project in mind. But I don't know where to start

Hi,

I work currently for a pharma company in a career path that's not even remotely related to programming. I currently keep track of document issuance and transfer by physically entering them in an Excel sheet. It is turning out to be more tedious and less useful everyday.

So, I decided to create a 'tool' from scratch to help make this process easier for me. This should be able to recall descriptions of documents and their last known location from an ID. My long (very long) term goal is to turn it into a mini-QMS software which is capable of producing audit reports.

I know the use cases and I am sure that I will be using SQL of some form.

I don't know what it should be. Should it be a web application? An app? A desktop software connected to an online database server?

My questions are:

  1. How do you go about deciding this?
  2. What is easiest way to implement it?
  3. What is a more complicated way to implement it, but is probably more recommended?
  4. How do I assess its security?

I have basic understanding of most languages and I'm prepared for this learning experience to (probably) be very humbling.

2 Comments
2024/04/05
05:27 UTC

1

Good course/certificate to pursue to supplement introductory CS courses at Uni?

Hello, I’m currently taking my first introductory course to computer science and I’ve developed a pretty strong understanding of the very basics. However, I obviously feel years behind in programming ability, and I have an IT internship coming up. I would love to take something meanwhile to supplement my current knowledge.

Is IBM’s DevOps / SWE course a good option? Any other recommendations? I’m especially interested in cloud computing.

Thanks!

1 Comment
2024/04/05
05:17 UTC

1

Not able to Download the file!!

Hey, I was trying build Data-Compression using FFmpeg library and I am able to compress audio files and also download it but,I am not able to do the same for Video files .It's getting compress and store in the server side but when I am trying to download it , it's showing error. And the worst part is it was working fine till yesterday morning but now it's not working at all.

https://pastebin.com/zAemWnMu

Link for my code server-side and client-side. Plz 🙏🏽 go through my code and tell me what actually happen yesterday that I am getting this error.

Error: error: videobutton.js:36

    GET http://localhost:5000/compressed_video.mp4?fileName=mapty%20__%20Map%20your%20workouts%20-%20Personal%20-%20Microsoft%E2%80%8B%20Edge%202024-02-16%2011-14-53.mp4 404 (Not Found)

handleDownload @ videobutton.js:36 callCallback @ react-dom.development.js:4164 invokeGuardedCallbackDev @ react-dom.development.js:4213 invokeGuardedCallback @ react-dom.development.js:4277 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291 executeDispatch @ react-dom.development.js:9041 processDispatchQueueItemsInOrder @ react-dom.development.js:9073 processDispatchQueue @ react-dom.development.js:9086 dispatchEventsForPlugins @ react-dom.development.js:9097 (anonymous) @ react-dom.development.js:9288 batchedUpdates$1 @ react-dom.development.js:26140 batchedUpdates @ react-dom.development.js:3991 dispatchEventForPluginEventSystem @ react-dom.development.js:9287 dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465 dispatchEvent @ react-dom.development.js:6457 dispatchDiscreteEvent @ react-dom.development.js:6430 Show 15 more frames Show less videobutton.js:53 Error downloading file: Error: Network response was not ok at videobutton.js:39:1

3 Comments
2024/04/05
05:11 UTC

3

How to find the correct Mathematical equation?

As I’ve been going into recursion, I’ve noticed that I had trouble realizing and understanding why to use the solution I saw for printing a Fibonacci number from an index by input received.

Code related to what I’m talking about:

‘’’ Function(intN): If intN <= 1: return intN Else: Function(intN - 2) + Function(intN - 1) ‘’’

If it comes out bad, sorry I’m on mobile.

Anyways, what should I look into to get better at identifying what equation to use (even beyond this example) when presented with a problem?

3 Comments
2024/04/05
05:07 UTC

1

Interview task/code for frontend developer [Angular]

I have interview for front end Angular Developer, and the recruiter have told me that the technical interview will assign you task Can you guys help me how do i practice for these interviews and what kinda task would it be?

I have already failed in 1 interview before and thr interviewer was asking me to write a function to validate palindrome

In my past 1 year of working as a frontend angular developer, I've never been in a situation/or given a task to do such or even a similar thing, All i was working on was backend API integration, Authentication, CRUD etc things that actually need to build web application

1 Comment
2024/04/05
04:35 UTC

2

When to use std::string and std::string_view?

I have been pretty confused when I should use std::string and std::string_view. Can anyone give me some tips? Thank you in advance!

3 Comments
2024/04/05
03:48 UTC

126

Every senior software engineer from whom I've sought advice has said the same thing: they don't watch video tutorials on specific technologies. Instead, they simply refer to the documentation and continue experimenting until they succeed. Why is this the case?

Most junior engineers find themselves stuck watching YouTube tutorials on various technologies and following Udemy video courses to learn new things. Every senior engineer I have sought advice from has advised against this approach. They always say the same thing: just refer to the documentation, keep coding, and build something, Keep building, Keep getting stuck and find solution on Google.

109 Comments
2024/04/05
03:35 UTC

1

Help with ngrok and WebSockets

I have recently created a websocket server and client with ngrok. The first time I tested it, it worked just fine. Then I closed ngrok and went to set it up again, but now the client won't connect to ngrok. If i have the client connect directly to the server (using localhost) it works just fine. I have tried resetting my ngrok authtoken, using different ports, but nothing works. Here's my code:

Client:

<html>
<head>
    <script>
        const ws = new WebSocket('ws://ngrok-link-here')
        function turtleForward(){
            ws.send('forward')
        }
        function turtleLeft(){
            ws.send('left')
        }
        function turtleRight(){
            ws.send('right')
        }          
        ws.addEventListener("message",msg=>{
            console.log(msg.data)
        })
    </script>
</head>
<body>
    <button style="font-size: 50px;" onclick="turtleForward()">Forward</button>
    <button style="font-size: 50px;" onclick="turtleLeft()">Left</button>
    <button style="font-size: 50px;" onclick="turtleRight()">Right</button>
</body>
</html>

Server:

const socket = require('ws')
const webSocket = new socket.Server({port:2608}) 
var clients = []
webSocket.on('connection',wsClient => { console.log('Something Connected') clients.push(wsClient)
wsClient.on('message',messageData => {
    console.log('Recieved Message: '+messageData.toString())
    clients.forEach(function(client){
        client.send(messageData.toString())
    })
})

wsClient.on('close',() => {
    console.log('Someting Disconnected')
})
})
1 Comment
2024/04/05
03:28 UTC

1

How do I cross-compile using Meson for windows and find all the dependencies?

I am trying to compile spice-gtk that uses Meson for Windows. I heard I could just use MinGW on Windows, but there are so many errors it just seems impossible. It was also from an old post when spice-gtk didn't even use Meson yet. I then tried to compile just like I did before on Linux except use a special build file as explained here. I used the very first example on there but under binaries changed "wine64" to simply "wine" and added where pkg-config is.

To be honest, I don't really know what's going on when I cross-compile or know how to properly do it, especially with Meson.

Anyway, when I run meson setup builddir --cross-file x86_64-w64-mingw32.txt , it ends up saying

meson.build:117:21: ERROR: Dependency "gio-windows-2.0" not found, tried pkgconfig

I'm sorry, but what the hell is gio-windows-2.0? I searched the Ubuntu Package archive and didn't find anything. I simply Googled it and saw a file called "gio-windows-2.0.pc.in." I then noticed that the MinGW installation on my Windows PC had "gio-windows-2.0.pc" in a folder under the pkgconfig directory. I don't think that really helps me right now though. What is a .pc file? Could it get me gio-windows-2.0? Is cross-compiling the way to do it? Or should I go back to compiling on Windows itself because I'm possibly just missing something?

1 Comment
2024/04/05
03:07 UTC

1

C won’t work in vscode. Been trying for 2 hours to set it up.

I followed 2 different tutorials and both resulted in the error message, “collect2.exe: error: ld returned 1 exit status” when just making a simple hello world. I installed code runner, and a c/c++ extension. I downloaded mingw, gcc, gdb, and all of that crap I don’t understand and I keep getting the same thing. Yes I made sure to set the path. I didn’t miss a step in those tutorials and looked back over them. I tried closing vscode and saving it. Still the same error. I just want to learn another language but I can’t even do that because I can’t even get started. Why is this so dang difficult? Someone please help me.

17 Comments
2024/04/05
02:21 UTC

1

In A Rut - Advice Appreciated

So I'm a few months into the journey of learning to be a full stack SWE. I realized quickly I much more prefer front end tasks but am learning everything my courses are requiring of me. I love the program I'm in and support I receive, I started super strong and was finishing entire sprints and projects weekly -10 days ish and now I'm in a rut. I've taken about a month off and I'm getting back to my classwork and practice projects and I am already just over it again.

I know this sounds ridiculous but honestly I am so incredibly bored with learning the material. It's so dry and technical and mind numbly dull. I find no joy or creativity in learning how to do equations in JS or reading 100 more nonsense technical jargon for hours on end.

When I'm actually working in my IDE and doing a project and seeing it come together I enjoy it and see the rhyme and reason behind things and feel a sense of accomplishment. I see the end goal of a career transition into a few different industries I find so much purpose and passion in, I see the value this skill can bring to my career and other's I can then work for but this learning is so awful. I love learning and taking on new ideas and tasks in anything in life but learning coding has to be one of the most dull things I've ever had to study in my existence outside anything with math. And now the place we're in with studies is combining the two most dull and awful and dry topics (math and coding tutorials and jargon) I've ever had the displeasure of dragging myself through learning.

Does it get better and more engaging after you get to actually just use these skills and brush up on your learning and practice hands on and not have to read through endless books and chapters of bland lessons that honestly are so dam dull I retain almost none of it and fake my way through the material so I can self learn in more engaging ways.

I don't want to give up on this challenge and journey but my god if it's so dry and dull I can't even focus on the material and get through the chapter enough to retain anything what's the point. Am I just stuck in beginning learner's hell currently and need to push through to the other side?

2 Comments
2024/04/05
02:21 UTC

1

What's the best way to get only Authorized Headings from this search? Is it possible to write a plugin for this?

https://authorities.loc.gov/cgi-bin/Pwebrecon.cgi?DB=local&PAGE=First

There is no search feature to get only Authorized Headings. The output is a table. If I had access to the database I could just look for all rows where the first column is an Authorized Heading.

I had considered web scraping to get every single Subject Authority Heading, but I'm wondering if it's possible to write a plugin or something else that could just filter out results except Authorized Headings.

I have tried looking through their metadata API, and it's not what I was looking for.

1 Comment
2024/04/05
01:54 UTC

31

What should I do if my professor's code keeps breaking my assignments?

I'm taking an introductory Python class. Each assignment requires students to write code given certain parameters in VSC/github and then copy/paste the professor's code at the end. The problem is that his code breaks mine pretty frequently. I had my sister (graduating next month with a degree in software development) and my friend (electrical engineer) to help me figure out what was going on, and my sister found errors in his code (like typos and some things she said didn't make any sense). The problem is that he takes points off of my assignments, and even fixing the things that are clearly wrong and keeping my assignments from running results in code that SHOULD run but doesn't. as far as we can tell, I've met his parameters and things should be fine on my end.

Is this something I should go to the dean about? This has happened on 3 different assignments.

42 Comments
2024/04/05
01:15 UTC

0

Heya! Im looking for the best fullstack and data structure / algorithms book

Hello! I know books arent the best solution but I learn best with them

What is the best fullstack book that covers best practices and real world code architecture and just general fullstack knowledge
And what is the best data structue & algorithms book that gives u the most bang for ur buck while also being very clear and being able to explain concepts efficiently

Thank u

1 Comment
2024/04/05
01:06 UTC

2

I am learning to code JavaScript, but I am also learning to code C at the same time??

I have been putting concerted efforts into learning JavaScript, and I feel that I have progressed beyond the beginner stage. I understand the syntax, and I can write original code that works, more or less.

Anyway, whilst browsing the web, I can across some beginner C tutorials. I was surprised how much of it made sense to me. Static typing, pointers, structs, and memory addresses are new, but loops and arrays, nested loops, and multidimensional arrays, and the rest of the basic syntax, all seem familiar. Has anyone else noticed this?

I have written my first piece of bespoke JavaScript code, a tool for work, that is an analogue for an Excel spreadsheet. I found it easier to code in JavaScript, than VBA. The funny thing is, looking at the code I have used, I think that I could make it work similarly in C.

I have also looked at C++, and whilst it looks more complex than C, it is not entirely alien either. I think that I am going to start learning C, alongside JavaScript.

5 Comments
2024/04/05
00:47 UTC

1

Interning at a Non-Tech Company, Feeling Unprepared - Any Advice?

Hey everyone,

I'm in my third and final year of my Bachelor of Computer Science degree, which includes a 9-month internship that's starting in two weeks. I pretty much went through all the courses studying last minute (scraping a 3.44 GPA) and knowing just enough to be able to do the assignments, only to forget most of it after the semesters would end.

I got hired at a company (for a software developer intern role) that's based around biotechnology, selling health and beauty products. When I was interviewed, I showed some of my uni projects (we really only had about 2 actual coding assignments we did in Java apart from AI and ML assignments). I asked them about their requirements for skills and languages and they mentioned that they don't have any such preferences since they're not a tech-based company. They were actually more interested in other things like an online business I had.

They briefly mentioned needing software where they'd be able to list their products and product information, and a system where customers can easily repurchase their regular orders. I honestly don't know anything more than this in terms of what I'll be working on for my internship, and I feel really scared because I feel like I don't know anything at all.

I think for the projects they discussed the coding should be pretty simple (a java program using a javafx form with sql database perhaps?) but I'm worried that they don't have many people in tech and they'll be requiring me to make some difficult things. I'm looking forward to actually learning and building proper things now, but I'm terrified I'll just be fired within the first month. I wanted to know if anyone has been in my shoes (forgetting pretty much everything they had learned, got internship at a non-tech company) and how things went for them.

Also, if you guys could give me some pointers as to what I should focus on learning these two weeks before I start (I don't know if delving into DSA or OOP theories right now would be helpful or not for instance), it would be incredibly helpful!

2 Comments
2024/04/05
00:46 UTC

0

[Competitive Programming] Looking for Study Buddies!

I’m seeking study partners to join me on competitive programming platforms, primarily Codeforces, although I’m open to exploring other platforms too. Here’s the plan:

• Weekly Contests
• Daily Activity - at least one problem or concept related to competitive programming.
• Group Support to ask questions, share resources and accountability 
• Group Calls - Flexible timings and frequency

Whether you’re an experienced coder or just starting out, if you’re dedicated to improving your competitive programming skills and supporting fellow members, we’d love to have you onboard!

Feel free to message, drop a comment with your Codeforces/LinkedIn username or fill the following Google form if you prefer to maintain anonymity: https://forms.gle/pwkJbtDozaeXpPY99

3 Comments
2024/04/05
00:18 UTC

107

As an expert/senior software engineer, what common mistakes do you notice among new engineers learning programming?

Share some advice on what you would have done differently.

84 Comments
2024/04/04
23:52 UTC

2

Dev10?

I don’t see much recent experience but wanted to know if anyone here has recently(in the past 6 months)had any experience with them. I’m self taught and also finished boot camp which promised resources but failed to deliver for after class ended. Anyway, I’m tempted to join dev10 but wanted some recent thoughts.

1 Comment
2024/04/04
23:10 UTC

1

Looking for a review of the class design (and Pythonic nature) of my code for an automation task project

Code: https://gitlab.com/__muditj__/email-automation

I was working on this automation task to fetch, process and perform some action on emails using the Gmail API and a rules.json file. Currently, I am using dummy email text files for this as I was working on the processing of the rules.json. Basically what happens is this

  1. A user provided rules.json is validated against a schema(Currently hardcoding a rules.json stored under /rule-samples)

  2. The emails are fetched from the Gmail API and stored in the DB (currently using dummy data here stored under /email-samples)

  3. In executor.py, after validting the rules.json, we run the rules through the emails and get a list of the filtered emails which "obey" the specified rules

  4. Perform the action(s) mentioned in the rules.json for the filtered emails(Currently just printing out the filtered emails in stdout)

I am still figuring out the best way to arrange this code and how to do class design so I wanted a critique of what I have done so far. I know I have to use strategy design pattern for the predicates like "contains", "greater than" etc so I am working on this, but some of my questions are:
How to arrange my code into "layers"? For example, all this is rules processing, should I put everything except main.py under a "processing" directory? Would all the Gmail API processing come under an /api directory?
What are my best options for providing end user with the option to provide command line flags for passing the rules.json, view the rules.json being used etc? Should the code for this be added in main.py or in a different /cmd directory?
The code is stored in this repo: https://gitlab.com/__muditj__/email-automation

2 Comments
2024/04/04
23:10 UTC

3

Is it worth learning Visual Basic these days? Not sure if even the right path to follow.

Hi All,

First time ever posting anything, anywhere. Really outside of my usual behavior, but everybody seems real cool here, so let's go.

At my job (Restoration), we use 3 main tools. Dropbox, Quickbooks, Excel. Dropbox for storage of docs/photos, Quickbooks for accounting, And Excel for everything else. We are highly inefficient since accounting Dept and Project managing Dept don't share data. infinite amounts of emails and delays occur everyday.

So far, i have been able to establish a template "Excel book" company wide for every individual project taken up by any PM(project manager). I have several tabs named(e.g. Estimate, tracking chart, job setup info, billing, costs, etc.). where the data is inputted manually, BUT, Saved locally to every PM's Dropbox link. We don't have a central Database where that manually inputted data is saved, and than accessible to other aspects of the company.

Also, a lot of what we do is repetitive and i would like to create quick action shortcuts to streamline a lot of what we do. i would also like to setup checklist stops, where an event cannot occur if the previous event is not concluded. I have a vision for a central database, where both accounting and PM can view/edit in real time, concurrently. Also, an interface for the PM's where we have an overview of all active projects and relevant information and lots more.

I'm aware that PM software exist and i have explored them. However, my industries is very niche/specific to what we do. All Software I've seen are very general or way too big, and honestly i think i can build something better, simpler, more tailored to what we do.

To finalize, i have most of my concept written down on paper/Excel. I know exactly how i would like this to work. HOWEVER, besides the basic python and C+ i learned once 10y ago, I'm lost. Excel has a developers tools where you can do somethings on Visual Basic, and I've been messing around with that, but i don't think that'll do.

I have a very specific problem, and I cant wait to build something that solves it, and makes everything way more efficient. Based on the above (I tried to not disclose too much info on purpose), What language/path would you recommend that i can start working on right away?

This will be my own personal project, and will work tirelessly to get it done. Every day that goes by working in this unproductive manner, drives me an inch closer to insanity.

Thanks kindly and I wish you the best in all your endeavors!

16 Comments
2024/04/04
23:07 UTC

8

How can I write a compiler that compiles down to another language instead of Machine code?

So I’m a physics undergrad and last year I started learning FORTRAN. However, I’ve been programming for a few years as a hobby and I hate FORTRAN’s syntax cause it’s so different from the programming languages I’m used to. However, FORTRAN is blazingly fast doing computations and the speed is really essential for me. I started learning Rust a while back and I got the idea to make my own language, so that it has a syntax that is easier, and I can “fix” some things I don’t like about FORTRAN like making defining matrices easier to write; maybe even combine FORTRAN and Python in it so that I can get the blanzingly fast computations from FORTRAN and the pretty graphs from python without sacrificing speed. The project I started uses Regex to format my custom syntax, look for the things the user defined and write them in FORTRAN. As far as I’ve gotten this way, even though it’s actually working well, I’m afraid that once I start adding even MORE features, the Regex will become really slow and “compiling the code” would take very long, which is against the purpose; plus having an actual compiler checking everything in my custom language would be nice. I heard about Gleam recently and saw that it can compile down to JS, and I wondered if I can do something similar. However, I’ve tried to find resources online but can find any. Does anybody know what could I do to write an actual compiler (preferibly in Rust) that can compile down to FORTRAN? I’d love to learn about this and hopefully make mine and others life easier!

14 Comments
2024/04/04
22:11 UTC

14

How important is git when it comes working with a team?

I only know the basics of git such as add, push, pull, merge, rebase. I don’t know if i should continue learning about it since i have no idea if it is used or not. I’m learning programming by myself so ive never worked in a project with other people

45 Comments
2024/04/04
22:09 UTC

1

Question with MQTT, Node and React

I few weeks ago I started to work on a personal project. In my job I work as a Zabbix administrator (is a monitoring software tool) and I wanted to develop one for my own, just for fun (it has been actually a pain).

Before starting, I hadn't touch neither react nor node. Right now I feel a little bit more comfortable (like 3/10), because it was even worse discovering that Node.js works in an asynchronous way by default.

But my question is beyond all of this. I want to monitor MQTT devices in a web app that I made with react. I just don't know how to interconnect everything. I have a microcontroller than sends data using the MQTT protocol, then my mosquitto broker receives de data and here is when everything turns dark for me.

I need two things:

  1. My mqtt client running in my express.js server should be able to subscribe or unsubscribe from topics dynamically. This is because in the frontend, the user would ideally add or remove devices to monitor.

  2. Once the server is receiving the data sent by the microcontroller, it should be sent to my react application and ideally it should update in real-time. Maybe that's too much, but at least something like a pseudo-real-time update after a certain amount of seconds would work for me.

Obviously this is extremely easy to say, but hard to do. I just need guidance on, What should I look for in order to do it? What I need to consider? How do I even start doing this?

If anyone is interested in the project, I will share with you the repo that I had in GitHub. Just be aware that I suck at coding and surely everything is working just because God exists or something else.

2 Comments
2024/04/04
22:08 UTC

4

Software Engineering or Web Design, as a complete newbie??

I'm having trouble finding info on this, maybe this just are things that people decide between often, or they are similar/the same/etc?

I have the opportunity to get a training program mostly/completely funded for me. I've always had an interest in coding/tech, but didn't go that route in college (I have an accounting degree). I'm decently good with picking up/learning new technical things. I don't have big aspirations to be a top tier programmer making millions or anything, just finding a stable job I enjoy that challenges me decently. While my strengths seemingly lie in the academic/mathematical, many many of my hobbies and interests are creative.

The only experience I have so far are some very basic web page creation with html. I had a ton of fun with that, and was almost immediately looking up new was to edit the page, even if it was simple. Either way, I will/I'm open to playing around with basics before committing to either program, or looking into another path (maybe testing?) if that's more suggested. ty!

edit just to mention I am physically disabled and therefore would need to be remote as much as possible, if that affects at all which field would be better.

13 Comments
2024/04/04
21:58 UTC

Back To Top