|
Really? The first thing that came to mind when I read that was, "Wow, what a cute sandbox you work in."
How about writing and debugging VBScript code in Notepad because you're not allowed to use certain tools in Government installations? You're also not allowed to use any other languages or scripting engines because they require some kind of runtime installation that's also not allowed.
How about debugging SQL stored procedures that work perfectly fine in TEST and QA but fall flat in Production using nothing but command line tools? Oh, and you're not allowed to connect to Production with SSMS or anything else remotely. You actually have to stand in the datacenter on the console.
How about writing Javascript code and debugging using nothing but Notepad and console.log statements.
Not every situation is one where you're sitting at your desk with all of your tools. Sometimes you're even in situations where you can't even bring your cell phone with you let alone a laptop with your toolset to help you.
|
|
|
|
|
So you are on a secure installation, and they are going to allow you physical access to do debugging
So all I can see at the moment is some dramatic situations where one would question the value of what is being done (because you either forgot or they took your tools off you), that you can save the day while the poor IDE dependent pleb might have to think of another way around it, drive and get his tools or get proper authorized access. However in that moment on that workplace you will shine and save the day in less time and effort.
As I said I can't think of any realistic situations but I am impressed by your abilities with notepad, mine are woeful.
In vino veritas
modified 18-Sep-18 10:20am.
|
|
|
|
|
I am with Dave K on this. Having to write, build, test and debug code without all the fancy tools definitely teaches you some core skills. Most of my professional life I was working in the era of no IDEs so I had no choice. Now that I have Visual Studio, intellisense, project templates etc. it makes life easy. But I can still fall back on my knowledge of the basics when necessary.
|
|
|
|
|
It's the old calculator versus long division thing.
Many schools in many countries don't teach long division basically because calculators exist.
You will get people who will argue that you should learn long division because one day you will get caught without a calculator.
You know the counter why waste so much time learning something that when caught in the situation you could easily fix.
So we invent a drama but wait you have a plane crash on a deserted island and you need to solve the division to save yourself. If only I learned long division I could save myself. What we leave out is you probably didn't learn how to calculate sine and cosine from first principles so we better hope your escape doesn't need trig functions
Neither side will convince the other, it's answer simply becomes just our own personal bias on how we feel about the technological advance.
In vino veritas
modified 19-Sep-18 4:05am.
|
|
|
|
|
I am not trying to make a case for one side better than the other. Merely that learning some basic skills can actually help you, and not just when you don't have access to all the fancy tools. It's like the people who post some code in QA and ask for a step by step explanation, or for us to debug and correct it. They are perfectly capable of downloading code from the internet, adding it to Visual Studio to build it, but have no clue as to what any of it is supposed to do or why.
[edit]
And having read (and benefitted from) many of your answers, I am pretty certain that you have those skills in spades.
[/edit]
|
|
|
|
|
Yeah I understand, and yes willing to do the hard yards learning is much more important. I am so old I can do long division and work without an IDE but if I am honest I am just not sure it means much. Of the younger staff around me I am not sure how many can actually work without IDE (or do long division) not something I had ever found I needed to ponder.
In vino veritas
|
|
|
|
|
I totally agree with leon de boer. 
|
|
|
|
|
I totally agree with Dave Kreskowiak 
|
|
|
|
|
I respect your opinion.
cuique suum...
|
|
|
|
|
I agree with this mostly, but since I'm not a real programmer I use vim.
|
|
|
|
|
I've to admit I use vim too. 
|
|
|
|
|
The first question is whether you have done ANY programming. If not, I suggest finding an "Fundamentals of Computers" class at your local community college or online (my kids took a class similar to the following: Free Online Course: Computer Science 101 from Stanford OpenEdx | Class Central[^])
FWIW, my youngest son scoffed at a class just like the above, went straight to CS 101 and was overwhelmed. He was getting his homework done, but not understanding any of it. Like me, just saying something was a variable wasn't good enough--what really was a variable? Unlike me, after the above class, he decided computer programming wasn't for him. To be honest, it probably isn't, but my youngest daughter aced that class and would be a good computer. Alas, she shows no interest.
From there, I agree with leon; get Visual Studio Community Edition. Your intent is to learn programming. If you are on Linux, get CLion.
|
|
|
|
|
I took and completed with a B an intro to programming course once. I think I have a good grasp of the very basics. Now I want to build on that knowledge and begin learning as much as possible.
|
|
|
|
|
One thought that's just occurred to me is that you could learn C while programming an Arduino. It's technically a superset of C (it has a string type) but if you buy a starter kit[^] you'll have a set of tutorials to complete that may (or may not) help you to learn as you go. Some people say they find it easier to stay motivated when they have some tangible result.
I can't really say how good the learning tutorials are though, because when I got my first Arduino I already knew a reasonable amount of C so I didn't really need to learn any language specific stuff from the documentation - just hardware specifics.
|
|
|
|
|
I am trying to implement coroutines in c++ (I had to reinvent the wheel for my project).
coroutine.h
class coroutine {
public:
void (*action1)(int);
Stack local_stack;
coroutine(void (*action)(int ), int id);
coroutine.cpp
coroutine *global_coro;
fcontext_t context_array[2];
coroutine :: coroutine(void (*action)(int), int id)
{
global_coro=this;
action1=action;
fcontext_t f_ctx = make_fcontext(global_coro->local_stack.local_stack, 1000, global_coro->action1);
context_array[0]=f_ctx;
}
coroutine::~coroutine(){}
void coroutine::yield(){
transfer_t tr = jump_fcontext(context_of_current_corotine, context_of_next_coroutine );
Following is my stack class which allocates a block of memory to every coroutine from a global Memory pool
stack.h
extern MemoryPool memPoolObj;
class Stack {
public:
void *local_stack;
MemoryPool& m_memPool=memPoolObj;
Stack();
~Stack();
};
Stack.cpp
#include "Stack.h"
MemoryPool memPoolObj;
Stack::Stack() {
auto *local_stack= m_memPool.Allocate();
}
Stack::~Stack() {}
Context.h
typedef void* fcontext_t;
struct transfer_t
{
fcontext_t fctx;
void * data;
};
extern "C"
transfer_t jump_fcontext( fcontext_t const to, void * vp);
extern "C"
fcontext_t make_fcontext( void * sp, std::size_t size, void (* fn)( int) );
Main.cpp
#include "coroutine.h"
void workPackage(int id){
printf("Coroutine with id %d is called\n", id);
coroutine::yield();
printf("Coroutine with id %d is resumed after first yield\n", id);
coroutine::yield();
printf("Coroutine with id %d is resumed after second yield\n", id);
}
int main() {
coroutine Coro1(workPackage, 1);
coroutine Coro2(workPackage, 2);
printf("Main is finished \n");
}
My program compiles but gives segmentation fault during execution. Valgrind gives the following information and i am not able to solve the problem. I will provide the assembly file also if needed. Any help would be appreciated
Use of uninitialised value of size 8
==24145== at 0x10922B: make_fcontext (in /home/user1/eclipse-workspace/coroutines/Debug/coroutines)
==24145== by 0x10912D: main (main.cpp:32)
==24145==
==24145== (action on error) vgdb me ...
==24145== Continuing ...
==24145== Invalid write of size 8
==24145== at 0x10922B: make_fcontext (in /home/user1/eclipse-workspace/coroutines/Debug/coroutines)
==24145== by 0x10912D: main (main.cpp:32)
==24145== Address 0xffffffffffffffe8 is not stack'd, malloc'd or (recently) free'd
|
|
|
|
|
Where is the code for make_fcontext , which is shown as the place where the error occurs?
|
|
|
|
|
My project structure in eclipse is as follows
Coroutines
Src
Debug
Code for make_fcontext is in src folder in file "make_x86_64_sysv_elf_gas.S"
.text
.globl make_fcontext
.type make_fcontext,@function
.align 16
make_fcontext:
movq %rdi, %rax
andq $-16, %rax
leaq -0x40(%rax), %rax
movq %rdx, 0x28(%rax)
stmxcsr (%rax)
fnstcw 0x4(%rax)
leaq trampoline(%rip), %rcx
movq %rcx, 0x38(%rax)
leaq finish(%rip), %rcx
movq %rcx, 0x30(%rax)
ret
trampoline:
push %rbp
jmp *%rbx
finish:
xorq %rdi, %rdi
call _exit@PLT
hlt
.size make_fcontext,.-make_fcontext
.section .note.GNU-stack,"",%progbits
|
|
|
|
|
You will need to use the information from the stack trace to figure out which line caused the SEGV, and which value has not been set.
|
|
|
|
|
A quick glance brings up a problem here:
Stack::Stack() {
auto *local_stack= m_memPool.Allocate();
}
Perhaps I misunderstand the intention, but shouldn't this be:
Stack::Stack()
: local_stack(m_memPool.Allocate())
{}
|
|
|
|
|
Good catch; I missed that completely.
|
|
|
|
|
|
Can anybody help me? I want to launch a word processor(MS Word) in an MS Visual C++ dialog based application. How this can be done exactly. Thanks in advance for your help.
|
|
|
|
|
Would you like to embed MS Word into your dialog or just spawn the MS Word application from your dialog?
|
|
|
|
|
open MS Word from the dialog
|
|
|
|
|
Then use ShellExecute(Ex).
|
|
|
|