Jump to content

Seeking to code like a pro using VS.

Gat Pelsinger

Right now, I am pretty turned up for coding Windows native code in C rather than writing POSIX code, because right now I only have Windows and I will get Linux afterwards. I thought MSVC would be more Windows friendly, but it is hard to just get only the msvc compiler without installing the full Visual Studio IDE. I made up my mind to install that as well, because I thought it would enable me to program better and its compilation, though won't give me that much control (on the outer surface), would have settings that could benefit for Windows by default.

 

But coming from dreams of mastering Linux, its terminal, and Vim, my eyes cannot bear all the GUI that is present. Coming from a GCC + text editor based programmer, how do I survive in the MSVC + IDE environment? How do I compile my code through the terminal instead of the one click compilation (ew, ugly)? I have some more questions.

 

VS is mostly meant for C++ programming, but I am a barebones C programmer. If I choose to compile a C program, will it also compile understanding it as a C program rather than a C++? If not, how do I specifically make it compile as a C program?

 

Also, there seems to be a lot of bloat. No, not the IDE bloat, that is understandable because it is an IDE, but compilation and the resultant program bloat. I think by bloat, I mean a lot of debugging, even when I don't want debugging. But I think terminal compilation will get rid of it.

 

Lastly, I want to know how the MSVC compile commands even work.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

37 minutes ago, Gat Pelsinger said:

how do I survive in the MSVC + IDE environment?

IDEs are just text editors at their very core. Integrations with debugging tools and terminals in one location is where they thrive

 

39 minutes ago, Gat Pelsinger said:

VS is mostly meant for C++ programming, but I am a barebones C programmer. If I choose to compile a C program, will it also compile understanding it as a C program rather than a C++? If not, how do I specifically make it compile as a C program?

You compile whatever code you're writing. I could write java code in pycharm, but that doesn't make the program I wrote python.

 

40 minutes ago, Gat Pelsinger said:

I mean a lot of debugging, even when I don't want debugging.

Yes you do- debuggers are one of the best, and most helpful tools you can use as a developer.

 

41 minutes ago, Gat Pelsinger said:

Lastly, I want to know how the MSVC compile commands even work.

Depends on the level of understanding you want. There is plenty of documentation on the microsoft learn website.

Community Standards || Tech News Posting Guidelines

---======================================================================---

CPU: R5 3600 || GPU: RTX 3070|| Memory: 32GB @ 3200 || Cooler: Scythe Big Shuriken || PSU: 650W EVGA GM || Case: NR200P

Link to comment
Share on other sites

Link to post
Share on other sites

@wasab

 

nah lets be real pls.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

@wasab Interview question for pro programmer:

1.) Name this IDE.

2.) Now exit VIM.

If you can do both you are hired or burned as witch. 

 

@Gat Pelsinger Being a good programmer is unrelated to language, IDE or compiler. 

If you would come through the door and answer the question what makes you a professional with I use Microsoft visual studio and their compiler it would be a fail.  

 

The initial post is pretty messed up. Consider going back to square zero and start over. Learn basic concepts and theory. From there on you grow and once you hit the point where a discussion about GCC vs. MSVC is within scope you already know the answers to the question "Seeking to code like a pro using VS.".

 

I couldn't answer when to choose MSVC over GCC. All I know is that GCC is blazing fast and I can use it with all the architectures I care about.

 

 

 

People never go out of business.

Link to comment
Share on other sites

Link to post
Share on other sites

Once again you're looking at things that as a beginner should be completely irrelevant to you. Adding debugger hooks will not impact the performance of your 100 lines of code in any meaningful way, and besides you can just build it in "release" configuration if you don't want them.

 

If you prefer VIM there are multiple VS plugins that emulate its behavior. Or you could just use VIM if you have no use for the features VS offers... using GCC or MSVC is completely inconsequential when you are dealing with small, beginner level C programs that are not meant to be distributed to anyone other than yourself.

17 hours ago, Gat Pelsinger said:

I thought MSVC would be more Windows friendly

What does this mean? Do you know what the differences between these compilers are, or are you just going off vibes and hearsay?

17 hours ago, Gat Pelsinger said:

Lastly, I want to know how the MSVC compile commands even work.

Have you tried looking at the official documentation? Many programming questions, especially ones as basic as "how do I use X", can be answered by just reading the docs, rather than immediately going to post the question on a forum where someone will go and read them for you...

https://learn.microsoft.com/en-us/cpp/build/walkthrough-compile-a-c-program-on-the-command-line?view=msvc-170

 

tl;dr:

cl hello.c

 

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

57 minutes ago, Sauron said:

Many programming questions, especially ones as basic as "how do I use X", can be answered by just reading the docs, rather than immediately going to post the question on a forum where someone will go and read them for you...

Well to be fair, you guys have been rather patiently explaining to him pretty much everything he's been asking for. He's been trained to just use ChatGPT to conjure up a bit of code he doesn't fully understand and then goes and asks experienced programmers about it in a misguided attempt to learn programming in the most inefficient manner possible. So far, the results are exactly what he expects: He posits a question and you give him answers. And his behavior when he gets an answer he didn't expect is to raise objections in ways every walking Dunning-Kruger phenomenon does, by second-guessing everything that you write with a degree of dismissiveness and an air of authority that don't befit someone of his experience level. Because a Dunning-Kruger phenomenon is what he is. I've been observing this charade for a while now, how he thinks he can improve upon standard library functions while at the same time barely being able to get a text editor or an IDE running. To be honest, I'd stop responding to his threads entirely until he's proven he can actually write working code, even if it's horrendously ugly and inefficient.

 

@Gat Pelsinger, you remind me of another forum member we had a while ago, @Wictorian. If either of the two accounts' locations are correct, you're not the same person, but the uncanny ability to ask advanced questions in the wrong way and for the wrong reasons is eerily similar. So in that spirit, I'll pull out the same harsh advice I dished out to Wictorian:

Stop trying to put the cart before the horse. Don't muck around with reinventing basic functions and trying to improve on those. Don't waste time with premature optimization if you can't even write a complete program. And for fuck's sake, don't try to write a garbage collector in C if you can't even produce a calculator first. In fact, I'd advise you to quit two things immediately: ChatGPT and C. The former for obvious reasons, you're not gonna learn anything by having an LLM produce code snippets or summarize tutorials for you. The latter because you have a tendency to miss the forest for the trees. Learn Python first. Get comfortable with logically breaking down problems into smaller problems with easy ways to implement the solutions. That way, you don't front load your learning, because this will always lead to a brick wall. If you eventually arrive at a project worth coding in C, you'll be ready to adapt that knowledge and have a much easier time. You don't need to peek behind the curtain to know how the CPU deals with the ones and zeroes. Trust that smarter and/or more experienced people have dealt with that for you and focus on actually learning programming concepts. Once you have the experience and notice something that can be done better, you'll be in a more suitable position to actually improve on the basic tools everybody else is using.

 

Another bit of advice: If you don't know how to do something, you will need to be able to efficiently look up information. The mark of a good programmer isn't to know everything about everything all the time. It's the ability to break down problems and if you have areas where knowledge is spotty or lacking, you need to be able to find information autonomously to fill those gaps. This is not done by asking ChatGPT or forums, nota bene. Read the documentation. If you still can't figure something out, at least show what work you did when asking questions. People aren't your servants who tell you stuff you could figure out yourself with a couple of minutes of Googling yourself. Telling people what you did saves them the trouble of telling you what you already know so they can confidently point you in a direction you might have missed or not known about. That's what saves both you and others time and headaches. You're asking people for help, after all. The least you can do is put in the effort to make it easy for them to help you.

 

And lastly: You really need to drop the obsession with text editors. No text editor in the world is going to make you a better programmer. Coding in Vim or Emacs isn't going to impress anyone. Write with the tools you find most comfortable. The important part isn't the window where you type text. It's the result that text produces. And from what I've seen across all your threads, you haven't produced much. Focus on that.

And now a word from our sponsor: 💩

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

Link to comment
Share on other sites

Link to post
Share on other sites

@Avocado Diaboli

 

uhh, what?

 

I am sorry that you think of me like in that way, but just to tell you, I am not an university student who is learning programming languages to get a job as soon as possible. I do all this because I have interest in it and want to explore stuff rather than just learning the standards and get a job. The definition of dunning-kruger effect is literally that people overestimate their abilities in a field with limited competence, but I do not overestimate my abilities at all.

 

I might ask questions greater than I have any understanding of them, while having a lot of pending behind, but again, if you might have noticed, I have a great interest in low-level stuff and how computers and that level work. Again, this would have been completely irrelevant if I were had to study to get a typical web-dev job. I accept that I try to do something way beyond my capabilities, but not because I think that I can achieve it, but because I just want to play around, gather knowledge from here and there, and build up my programming base from that way. Right now, I got no time to sit down for 10 hours and read official C documentation and learn everything. I will definitely do that once my current studies are finished. I do all this because of my curiosity. I wonder what happens if I malloc too much, what happens when Windows is extremely low on resources, what happens if I overload the kernel with syscalls, what happens when an integer overflow occurs in an algorithm which produces fascinating results (context: Minecraft. I do a whole lot of tinkering what as well).

 

C is such a diverse and complex languages that has so many quirks. And you have no idea how much better I am starting to understand about it from you guys. Take example, my cousin sister, who is going to college to obtain a degree in Computer Science. She also had C and C++ in her Diploma days, and just recently I was talking about stuff related to C. I got to know how less she knows about the inner workings of C. She didn't know a struct is basically a variable but you can address different parts of it with different lengths of data types. She didn't know that C doesn't know the data type of a variable, rather it is upon the programmer to address their own memory they way they allocated it. She has very little idea of Assembly, POSIX, libraries and APIs. She even didn't know what pointer arithmetic is, but it is likely that she forgot. All this because she learnt the standard way, where you just use what you have, rather than understanding it. A true programmer is the one who understands his software completely, though a greater programmer is the one who knows his software, and his hardware, and you cannot deny this fact.

 

Just as I have gather knowledge from here and there in programming, so have I in hardware and typical OS level software.

In my family, I am the most tech nerdiest person. I have fixed hardware that multiple repair shops flagged it as a replacement. My sister praises all of my knowledge about this so much. I never reached this position where I am so useful by working in repair shops or having a degree about hardware. I did this just by gathering information from here and there. But by no means, I consider myself as a tech god. I don't even a desktop and never built one. I always have an understanding of by abilities and my limits. Tell me, is it right to tell a fellow power user who is trying to overclock his CPU to first go and get a degree as an electrical engineer?

 

This doesn't mean I won't do what a normal programming student as through go through. I have to solve algorithms on leet code. I have to learn multiple languages, be it be higher level. It's just no the right time for me. I just do programming because it fills my dopamine, like actually. So don't call me a person with the Dunning-Kruger effect. I hope you understand. I only use ChatGPT because I just do not have the time to invest to learn the whole thing from scratch. I am trying to learn bit by bit, from here and from there. But again, when I get the time, I have sit and read for 10 hours. I think a problem is that this forum is not programming oriented, and I am the only one flooding the programming section, which I am aware of, feels awkward. I definitely try to solve the problem myself, but when I just can't, you can't expect to keep the question with myself and improve further.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Gat Pelsinger said:

The definition of dunning-kruger effect is literally that people overestimate their abilities in a field with limited competence, but I do not overestimate my abilities at all.

The entire rest of your post of what follows this statement is textbook Dunning-Kruger behavior. 

 

Never mind that you basically just cemented my opinion that nobody here should help you out anymore. You don't have an earnest interest in solving the problems you keep asking about. You don't really want to learn anything. You deliberately sabotage any effort you put into it (which already isn't much, by your own admission) and you actively waste time of anyone who sincerely wants to help you.

And now a word from our sponsor: 💩

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

Link to comment
Share on other sites

Link to post
Share on other sites

@Avocado Diaboli

 

First of all, be clear what you mean, I don't get your use of English that clearly.

 

Secondly, how can you say I have no interest in learning and I just ask stuff without making it useful? Okay, I think I get it. Sometimes I do behavior such not replying back, or asking stuff which even I don't have an idea of what I am asking and then kind of ignore some comments. This is because sometimes even I am very confused or overwhelmed about some stuff or have a wrong idea, or sometimes too exhausted, in which I give up sometimes. This only happens a very few times, and recently, I've been asking legitimate questions on which I have doubts on. Could you take some effort to specify an actual example of mine? I bet I have a good excuse for everything that I have done wrong.

 

All the other times, I ask something, I get replies, my knowledge increases, me happy.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

I would say, it's important to learn the fundamentals and then things like what IDE etc you are using can come later.

 

I literally started programming use notepad, not notepad++, but MS notepad.

 

It didn't have anything fancy, and I had to create bat files to compile my code...but it worked and I learned the fundamentals.

 

You learn basic ideas that way of how to find issues with your code.  You learn to read compiler errors/error codes and learn what they mean that way (instead of how some kind of spoon feed you these days).

 

Not saying IDE's are bad, they are great tools, but ultimately you should be able to hop onto other platforms and program with just a bit of learning curve (you learn one IDE you pretty much learn them all...you just need to figure out where the menus etc are).

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Gat Pelsinger said:

Tell me, is it right to tell a fellow power user who is trying to overclock his CPU to first go and get a degree as an electrical engineer?

what do you mean by this? isnt that exactly what youre doing?

@Avocado Diaboli is telling you the simple way to start programming (aka overclock in your metaphor) while you are trying to get the degree before you enrolled a single class. not even, youre asking other people to do the study for you and give you results

MSI GX660 + i7 920XM @ 2.8GHz + GTX 970M + Samsung SSD 830 256GB

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, Gat Pelsinger said:

Could you take some effort to specify an actual example of mine?

You recently asked about getting AVX instructions to work in your code. I explained the problem you were running into, and you got upset that I didn't just write the code for you. Even when I took the time to setup an x86 environment (since I develop on ARM64) and then wrote some example code for you, you completely lost interest and had moved on to asking a question about optimizing memory. Several people tried to explain that your question wasn't practical without a specific use-case in mind. You again ignored those responses, lost interest, and then moved on to asking about variadic functions, I assume because you were under the impression that calling functions as a list of function pointers resulted in less program memory (it doesn't). Again, we tried to explain to you that what you were trying to do wasn't practical, and I even gave you example code demonstrating what you were trying to achieve. You ignored that example code (maybe you just didn't understand it?) and then moved on to your next unrelated question.

 

I'm sure others feel similarly that we want to help you with your interest in programming and continue to encourage you to learn, but it's been hard to continue offering you advice when you continue to ignore it.

 

Stop trying to dig into the esoteric details of C. You're not going to find some magical algorithm that radicalizes the language. Start with the basics. Find a text book and/or online repository of C coding challenges with explanations and solutions.

Link to comment
Share on other sites

Link to post
Share on other sites

This community's willingness to give relevant answers to questions is remarkable, even if the question does not make much sense. I don't think I ever heard criticism that was this neutral. Y'all must be really nice people IRL

ಠ_ಠ

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×