teleren/devto huggingface dataset:
Using Namespace std;" in C++: Why It's Considered Bad Practice
Tags: beginners, webdev, learning
Published: 2023-09-02 07:17:40

In C++, you might often come across the line using namespace std;. It seems convenient, but it's often discouraged in professional coding practices. In this guide, we'll explore why this seemingly innocent line can lead to issues and what better alternatives exist.

**Understanding "using namespace std;"**

The std namespace in C++ contains many standard library components, including data types, functions, and objects. When you write using namespace std;, you're essentially telling the compiler to consider all the names in the std namespace as if they're in the global namespace. This means you can use names like cin, cout, and vector without specifying std:: before them.

**The Problem with `"using namespace std;"`**

`Namespace Pollution:` When you bring all of std into the global namespace, you risk naming conflicts. If your code or any library you're using defines a name that clashes with something in std, you'll have a problem.

`Readability: `In larger projects, it can become unclear where a particular name is coming from. This can make code harder to understand and maintain.

`Maintenance Challenges:` If you later need to add a new name to your code that happens to exist in std, you'll have to refactor your entire codebase to resolve naming conflicts.

**A Better Practice: Explicit Namespace Usage**

Instead of bringing the entire std namespace into your code, consider using specific names from std explicitly:


![namespace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7n8guh0o10zcwryiy6fv.png)


**Benefits of Explicit Namespace Usage:**

`Clarity:` It's clear where each name is coming from, making your code more readable.
`
Avoiding Conflicts:` You won't run into conflicts with names defined elsewhere in your code or in libraries.

`Maintainability:` It's easier to maintain your code in the long term, especially in larger projects.

**Conclusion:**

While using namespace std; might seem convenient, it's generally considered bad practice due to the potential for naming conflicts and reduced code readability. Embracing explicit namespace usage is a better approach, ensuring your code remains clean, maintainable, and free of unexpected issues.

`LinkedIn Account` : [LinkedIn](https://www.linkedin.com/in/matthew-odumosu/)
`Twitter Account `: [Twitter](https://twitter.com/iamcymentho)
**Credit**: Graphics sourced from [Youtube](https://www.youtube.com/watch?v=LcHApxMFvPA)
Deep dive into understanding Props in React
Tags: webdev, react, beginners
Published: 2023-09-02 07:09:07


**1. What are Props?**
   - Props (short for properties) are a fundamental concept in React.
   - Think of them as attributes you pass to a component, similar to HTML attributes in tags.
   - Props allow you to send data from a parent component to a child component.
   - They are read-only and help make your components dynamic and reusable.

**2. Creating Props:**
   - To create props, you include attributes in your component like this:
     ```jsx
     <Contact name="Ali" />
     ```

**3. Accessing Props:**
   - In your child component, you access props using the `props` object:
     ```jsx
     export default function Contact(props) {
       return (
         <h1>{props.name}</h1>
       );
     }
     ```

**4. Destructuring Props:**
   - Destructuring allows you to extract props more concisely.
   - Example:
     ```jsx
     export default function Contact({ name }) {
       return (
         <h1>{name}</h1>
       );
     }
     ```
   - This is especially useful when you have multiple props.

**5. Why Use Destructuring?**
   - Destructuring props makes your code cleaner and more readable.
   - It reduces repetition by directly extracting the properties you need.
   - It also simplifies access to nested props.

**6. Example:**
   - Let's create a simple component that receives and displays user information using props and destructuring:

   ```jsx
   // ParentComponent.js
   import React from 'react';
   import UserProfile from './UserProfile';

   export default function ParentComponent() {
     const user = {
       name: 'Ali',
       age: 30,
       city: 'New York',
     };

     return (
       <UserProfile user={user} />
     );
   }

   // UserProfile.js
   import React from 'react';

   export default function UserProfile({ user }) {
     return (
       <div>
         <h1>{user.name}</h1>
         <p>Age: {user.age}</p>
         <p>City: {user.city}</p>
       </div>
     );
   }
   ```

**7. Conclusion:**
   - In React, props are like attributes you pass from parent to child components.
   - Destructuring props simplifies access and enhances code readability.
   - Understanding props is essential for building dynamic and reusable React applications.
Responsive Social Media Dashboard with Theme Switcher (SCSS + JS)
Tags: codenewbie, frontend, scss, tutorial
Published: 2023-09-02 07:03:41

I've just completed a front-end coding challenge from @frontendmentor! 🎉

This is my solution for the **Social Media Dashboard with Theme Switcher**.

You can see my solution here: https://www.frontendmentor.io/solutions/responsive-social-media-dashboard-with-theme-switcher-scss-js-SlFQ0A6SQ4

Live Preview: https://kanishkasubash.github.io/social-media-dashboard/

View Code: https://github.com/kanishkasubash/frontend-mentor-challenges/tree/main/social-media-dashboard/build

**🛠️ Built With:**
- Semantic HTML5 markup
- SASS/SCSS
- Node.JS
- GULP.JS
- Vanilla JS
- Mobile First Approach

**📦Features:**
- The user indicates their preference through an operating system setting (e.g. light or dark mode) or a user agent setting.
- Responsiveness (Mobile/Tab/Laptop/Desktop).
- Toggle button for custom Theme Change.
- Hover Effects
- Animations

**🔖What I am used:**
- Toggling Button [Link](https://www.w3schools.com/howto/howto_css_switch.asp)
- prefers-color-scheme. [Link](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
- Window: localStorage property. [Link](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
- CSS **Flexbox** & **Grid**. [Link](https://blog.logrocket.com/css-flexbox-vs-css-grid/#css-grid-layout-flexbox-alignment)

💡Any suggestions on how I can improve are welcome!
What Feature Was Added from User Input?
Tags: discuss, watercooler
Published: 2023-09-02 07:00:00

_Step into our coding showcase series, where you can elevate your projects, exhibit your coding prowess, and collaborate with like-minded developers._

Talk about features implemented based on user feedback and delve into user-centric development.

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
The magic function...
Tags: vanjs
Published: 2023-09-01 06:29:54

The core of VanJS is based on the following object:

```js
const tags = new Proxy({}, {
    get: (tag, name) => {
        return (...args) => {
            let el = document.createElement(name)
            args.map(cl => {
                el.appendChild(typeof (cl) === 'string' ? cl = document.createTextNode(cl):cl)
            })
            return el
        }
    }
})
```
When tags is accessed via any tag name property, the getter return a function which, when called, create a new DOM element based on the tag name, and that where resides the 'magic'

Example :

```js
const div = tags.div
```
Which can be rewritten

```js
const { div }  = tags
```
Let's use it to display a list of users [Users](https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvEAXwvW10QICsEqdBk2J4hcYgAJiGAOZxJAXkloYAd0kAFAE60AHgE8AFMHaTgAHTSSbk2TGKJJRmbIoquASiUA+c1dtAyW0HAFdtayN8aIxteW9FP0trINTYKRgoJUkAE1pqUJwGfGoQjEYAUVgi4iNMHE8A1KDY+XwsDAAHI2osxP8U5ubM-C7OphyAYUJoHJcDcdowZ16ExWUAcgltCDRZDckAfkle7LyCmpKyxgAVGD1iADlaHJgeqE9EVaahm1ZGwa-ELEcLWTI-IKsCFQtD-KxWcRSYA5CAAN3chAAjO5QlB3FAIKxsq44PC0IjJKE4DBtAplMgLCAABIAQQAMoz3IyAEIVABKN0ZAF0yelJASJAB9Kk0umUqBRaIy2ntLpGIzKhJ+Aka6naTwGsnnQoifAAIxeBlGnXGaCmMygcwlxGlergAMoIGpsGoxAg9AQPExAE5EAAGNgcED1bgEahwAQ0eiMZg8NhC1hAA) :

```js
const {div, h1, ul, li} = tags

const users = ["HAL", "BERT"]

let list_users = ul(...users.map((user) => li(user)))

document.body.appendChild(list_users)

```
With that in place, you can go pretty far when building UI, without using any external libraries, neither VanJS.

Personnaly, I find this awesome. If you want to learn more, see my posts about [VanJS](https://dev.to/artydev/the-tiniest-javascript-ui-framework-in-the-world--ioa)
What's Your Go-To Hack for Breaking Through a Coding Block?
Tags: discuss, beginners, codenewbie, career
Published: 2023-09-02 07:00:00

_Join us in bridging the knowledge gap and fostering a stronger coding community. Your expertise can shape the next generation of developers. Let's do this together!_

When faced with a stubborn coding challenge, what's your secret weapon to spark creativity and overcome the block?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
On questions that are impossible to answer
Tags: beginners, management, productivity, career
Published: 2023-09-02 06:17:08

For the managers who want to **know precisely** the time estimations and costs,
For the bosses, who want to **be sure** the product or project will work,
For parents, who want to **be certain** about their children's choices,
For everybody else, who wants to **know everything**.

It's not that some questions are hard to answer.

Some of them are **impossible** to answer.

Heisenberg discovered that we can't know everything about the real world.
Gödel proved that some statements in math can't be proved.

What makes us think that we (or even worse - others) should be capable of saying something about this non-scientific, chaotically empirical, ever-changing social hotchpotch for sure?

After You destroy the fundamentals of physics, math, and logic created by the greatest minds ever lived, we can continue the conversation.

Meanwhile, let's drop that wishful thinking, quit the useless bureaucracy, and start appreciating the people we're working with.

Only after this law of nature is understood can we can start doing miracles.

**Feasible, real life** miracles.

[1] https://en.wikipedia.org/wiki/Uncertainty_principle
[2] https://en.wikipedia.org/wiki/G%C3%B6del%27s_incompleteness_theorems
Latest Newsletter: A Bit of a Trip (Issue #130)
Tags: javascript, tech, webdev, discuss
Published: 2023-09-02 06:07:05

---
title: Latest Newsletter: A Bit of a Trip (Issue #130)
published: true
description: We are entering into an era of very long timescales. This week we go on a bit of a journey in space and time to try and get handle on what this might mean exactly.
tags: javascript, tech, webdev, discuss
---

A Bit of a Trip (Issue #130)

We are entering into an era of very long timescales. This week we go on a bit of a journey in space and time to try and get handle on what this might mean exactly.

https://markjgsmith.substack.com/p/mark-smiths-newsletter-02-09-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Full-Stack Web Development In 7 days Ebook
Tags: webdev, javascript, fullstack, programming
Published: 2023-09-02 06:05:33

🚀 Unlock Your Full-Stack Potential in Just 7 Days! 🚀

Are you ready to embark on an exciting journey into the world of web development? Look no further! Introducing our brand-new Ebook: "Full-Stack Web Development In 7 Days."

🌐 What's Inside: 🌐

🖥️ Comprehensive HTML, CSS, and JavaScript tutorials.
🌐 Dive into front-end development with React.
📡 Master back-end with Node.js.
🗃️ Database management using MongoDB.
🚀 Build a real-world project from scratch.
💡 Tips, tricks, and best practices from industry experts.
📚 Additional resources for continued learning.
📆 Why 7 Days? 📆
We understand your time is valuable. Our Ebook is designed to provide you with a solid foundation in full-stack web development in just one week! Whether you're a beginner or looking to upskill, this structured program will get you there fast.

🧑‍💻 Who Is This For? 🧑‍💻

Beginners looking to break into the tech industry.
Developers aiming to expand their skill set.
Entrepreneurs wanting to build their own web projects.
Students seeking a clear, step-by-step guide.
🎁 Limited-Time Offer: 🎁
Get your hands on "Full-Stack Web Development In 7 Days" now and receive exclusive bonuses, including access to our private community of learners and weekly Q&A sessions with experienced developers.

Ready to unlock endless opportunities in the tech world? Don't wait! Grab your copy today and take the first step toward becoming a Full-Stack Web Developer in just 7 days.

📚 [Link to Ebook] 📚
[https://www.digistore24.com/redir/490219/Online242023/]

💡 Start your journey today and build the future you've always imagined. 💡

#WebDevelopment #FullStack #LearnToCode #TechJourney
STATUS FROM WHATSAPP
Published: 2023-09-02 05:54:20

In the world of modern digital communication, WhatsApp has emerged as an essential platform for connecting with friends, family, and acquaintances. Beyond its core features of text messaging and voice calls, WhatsApp provides a canvas for self-expression through the sharing of profile pictures and statuses. If you're wondering how to download these images and updates, the process is both straightforward and user-friendly.
[Website](https://quirkyquillsq.blogspot.com/status-from-whatsapp#)
How to see branch name on terminal in ubuntu 22.04
Tags: git, terminal, ubuntu
Published: 2023-09-02 04:48:45

To see the current branch name in the terminal when you are working with Git repositories in Ubuntu 22.04, you can use a combination of commands and customizing your shell prompt. Here's a step-by-step guide on how to do this:

1. **Check if Git is Installed:**
   Make sure you have Git installed on your Ubuntu system. You can do this by running the following command:
   
   ```bash
   git --version
   ```

   If Git is not installed, you can install it using `apt`:

   ```bash
   sudo apt update
   sudo apt install git
   ```

2. **Install a Git Prompt Tool (Optional):**
   There are various tools and scripts available that can help you display Git branch information in your terminal prompt. One popular option is "git-prompt." You can install it using `apt`:

   ```bash
   sudo apt install git-extras
   ```

3. **Configure Your Shell Prompt:**
   You can customize your shell prompt to include the current Git branch. To do this, you need to edit your shell configuration file (e.g., `~/.bashrc` for Bash or `~/.zshrc` for Zsh) and add the following lines:

   For Bash (default Ubuntu shell):

   ```bash
   # Add the following to your ~/.bashrc file
   parse_git_branch() {
       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
   }
   
   PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(parse_git_branch)\$ "
   ```

   For Zsh:

   ```bash
   # Add the following to your ~/.zshrc file
   parse_git_branch() {
       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
   }
   
   PROMPT='%n@%m:%~$(parse_git_branch) %# '
   ```

4. **Reload the Shell Configuration:**
   After making changes to your shell configuration file, you need to either open a new terminal or run the following command to apply the changes to your current terminal session:

   ```bash
   source ~/.bashrc  # For Bash
   source ~/.zshrc   # For Zsh
   ```

Now, when you navigate to a Git repository in your terminal, the current branch name should be displayed in your prompt. If you're using a different shell or prefer a different prompt style, you can adjust the customization accordingly.
Online reputation monitoring | Reputation management
Tags: orm
Published: 2023-09-02 04:11:24

IBRANDtech is an Trusted & Renowned digital agency that offers Online reputation management services in India including digital marketing services. We expertise in making optimum use of the powerful Digital medium for securing your online reputation and assured business growth, as a part of our reputation management services.
Website- [Online reputation monitoring | Reputation management](https://ibrandtech.com/)
Everything Starts with Hello World
Tags: webdev, beginners, programming
Published: 2023-09-02 02:53:07

Okay so I have used dev.to previously whenever I faced problems in coding & searched for it on Google. But when we are in crisis solving mode, only solution gets noticed, place where we found solution hardly visible to our eyes. It's not until my dear friend Nishnath Bhat who started writing and sending dev.to blog link to our group. That's when I realised this particular platform is something where I can write, just write about coding & other IT related stuffs for Dev.

So it's the beginning of something or just one post and never going to write anything here, but either way I had to write something here, just to prove that we can always do something unprepared and first time. Everytime there's unknown language to learn, we start with writing Hello World. Same ways as Dev we should start writing content. It's important to build up network and show world what's running in your mind.

September has been always year of starting new for me since 2019, the year I graduated and decided will be starting my on Web Dev agency. In 2022 September, I started with my YouTube channel. Since then posted over 200+ video content across multiple channels. So this year it's official that I'll be starting to create content on more social platforms.

So there we go, Hello World
Decoding the Path to Technical Product Management: Cloud, Frontend, or Backend?
Tags: beginners, codenewbie, microservices
Published: 2023-09-02 02:01:11

As a non-technical product manager venturing into the world of software engineering to become technical, what angle do I go—cloud engineering, Frontend or Backend?

In this article, I will walk you through my thought process on how I choose a path to becoming a technical product manager.

## Why become a Technical Product Manager?
I started my 'product manager' (PM) journey in the upstream function of product management, and managed products from idea to launch. But being a first time PM at a startup, it is customary that I would also be involved in activities related to product marketing. 

> On a light note, you can call me a 'Full Stack PM'. Although, I am currently a Generalist PM. 

A cloud-based payroll solution is one of the products I manage. And in my collaboration with the devs on my team, I've repeatedly heard certain terminologies used so much that I understand the role they play in the development of the product, mostly backend-related. This has inspired my wanting to know beyond the 'Why' of a product to understanding the 'How'.



![Product Manager vs Technical Product Manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fky8muzwuzta9if31a3r.png)


## How to become a Technical Product Manager
First of all, what does a Technical Product Manager do differently from a Non-Technical Product Manager?

> A technical product manager (PM) is a product manager with a strong technical background that is typically focused on the more technical aspects of the product. A technical PM works more closely with the engineering team than the business, sales, and marketing teams of the organization. 
— Product Plan.

Technically, what I need to become a technical product manager is a deeper understanding of technology enough to empower me to translate business value into technical requirements, and effectively collaborate with technical stakeholders. 


![Frontend vs Backend](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmt1ubl7yzcbtyhun8yw.jpeg)

## In Conclusion,
Since I already love the sound of conversations around concepts like microservices, database management and scalability etc, I might as well just kick off with Backend Engineering. 

Also, at some point in my backend engineering journey, I'm aware that I will interact with some bit of cloud and frontend, and I think that suffices for me, for now. My next contemplation would be Nodejs or Python—Which should I go for?

Thank you for reading this far. This is my first article on Dev.to, and it means a lot to me that you are here. Feel free to connect with me on [Linkedln](https://www.linkedin.com/in/pediomo/), and expect to read my next article pretty soon. 
_<u>
Photo Credit: Simplilearn and Skiplevel</u>_
2023-09-01: Watchin and waitin
Tags: devjournal
Published: 2023-09-02 01:51:28

A lot of this week was dedicated to watching people do stuff, honestly.

First I'll give an update on the game. Apparently we ended up getting an actual development team for Unreal, so we don't have to piddle around with stuff we don't know, so hopefully it comes around. We also secured some funding which is always good news.

For work, here's a play by play for what I did each day:

Monday, my boss wanted everyone to send me some example human responses rather than the AI responses that we'd been working with till now. He wanted to do a little comparison test between the AI and what actual human responses would be, so we set up a "reverse Turing test," in which I'd give him and another person a file with a 50/50 chance of either being all AI responses, or AI responses mixed with human responses.

It did seem fairly easy to tell what was AI and what was human based off what he told me the following day, but they supposed the AI responses were satisfactory.

Then the next day, my boss wanted us to do a 4-person task to implement a sort of flow between the front end and the back end. However, somehow all four of us misunderstood what we were supposed to do and thought we just needed to brainstorm a bunch of introductory messages for the bot. So we did that, but the next day we had to answer for why we didn't accomplish what we were tasked to do.

Thankfully, it was an opportunity to sort out further issues with communication. Hopefully something like that doesn't happen again.

After that little debacle, my coworker and I rode along with our boss as he set up the Azure server, along with a virtual machine running Kasm. Very cool tool, by the way. I hope we can use it in the future more because it would make working on the go a lot easier.

We learned a lot about how to set up the Azure environment and how to access the remote machines, and what to look out for when we are trying to create new virtual machines. There's a lot to learn there and even the 3 hours we spent o that wasn't nearly enough.

He also shared with us an interesting Python notebook on distilling the GPT-4 knowledge base into GPT-3.5, since OpenAI has fine-tuning abilities now for businesses, which can find below:

https://github.com/sixvo-labs/Sapir.git

Thursday, I was tasked with creating some MermaidJS diagrams detailing possible user stories when chatting with our chatbot. I came up with a bunch of different scenarios, which should cover a lot of our bases, but there are always going to be edge cases to think of. Some of the funnier ones were where the user was trying to troll the bot, and another where the user was getting frustrated at the smallest thing.

Today, I was tasked with organizing all the information I found from generating that data, identifying all the "actions" that the bot could take, such as "analyze," "match," etc. and put it all in a table with its different functionalities and scenarios. It's a pretty big ask but it should be valuable to do so.

Anyway, that's my account this week. Cheers.