lainchan / λ
The Beginner's General
λx.x · 2019-06-17 19:42
This is the Beginner's General for beginners' questions.
If you have a simple question and a suitable thread doesn't already exist, just post it here and someone will probably try to answer it for you.
Remember to do some research before asking your question. No one wants to answer a question that a simple search can already resolve.
Kay · 2019-06-17 22:56
The 300th post of >>11248 didn't bump the thread. On the face of it this looks like an off-by-one error.
Backus · 2019-06-18 06:26
>>13962
>The catalog still marks this thread with (sticky) but in the index it no longer has the fa-thumb-tack marker.
Perhaps the catalog didn't get rebuilt at the time you viewed it. You did make certain you had a fresh catalog view, right? It looks correct to me, now.
>>13964
I'm not certain if that would actually be a bug. What point would there be in bumping a thread when no more replies can be made?
Neo · 2019-06-18 10:13
>>13966
>Perhaps the catalog didn't get rebuilt at the time you viewed it.
From the timestamps the thread had been in the 299 state for about 14 hours at that point, which was ample time for the server side. My browser was newly opened and it clears everything when closed, so I got fresh views, fresh "max-age=0, no-cache, must-revalidate" Cache-Control headers, fresh everything.
>You did make certain you had a fresh catalog view, right?
Think about it this way. After posting the catalog view switched from 299+sticky to 300+sticky. You can't have both a stale view and a count increment.
>It looks correct to me, now.
It is correct now but your post was over 7 hours later. The powers that be had plenty of time to intervene, in addition to moving the "multics on a raspberry pi" thread.
>I'm not certain if that would actually be a bug. What point would there be in bumping a thread when no more replies can be made?
The point of a bump is notification about a new post. That post might be answered in the new thread, as you did. Without a bump, those of us using the catalog would have to remember reply counts. With a bump we get notified by an order change.
Agent Jones · 2019-06-18 16:03
>>13967
>From the timestamps the thread had been in the 299 state for about 14 hours at that point, which was ample time for the server side.
I suppose that's odd, then.
>It is correct now but your post was over 7 hours later. The powers that be had plenty of time to intervene, in addition to moving the "multics on a raspberry pi" thread.
Why would any intervention for this have been necessary? I don't understand. What I did was, since it was at 299, go ahead and create this thread, unstickying the previous one.
>The point of a bump is notification about a new post. That post might be answered in the new thread, as you did. Without a bump, those of us using the catalog would have to remember reply counts. With a bump we get notified by an order change.
That's fair. I'll mention this to Appleman1234.
byte · 2019-06-18 20:41
How do i get good at programming if theres nothing im interested in making
Yet Another Lainon · 2019-06-19 07:03
>>13970
Make something your NOT interested in making.
John Titor · 2019-06-19 11:28
>>13969
>Why would any intervention for this have been necessary?
>I don't understand.
>What I did was, since it was at 299, go ahead and create this thread, unstickying the previous one.
As stated previously, a curious state existed wherein the catalog still showed the sticky marker but the index no longer did so. This state existed with the reply count at 299. This state persisted after the catalog view updated to 300 replies.
>>13970
A strict dominatrix with a whip.
Void · 2019-06-19 23:48
>>13935
In fact at compile time the compiler does not care if the function call exists or not, it is only in linking it defines where the function body is.
Try it:
Create the file "main.c" and type:
int main() {
hello_lain();
} Compile with: $ gcc -c main.c
Success! Despite the warnings the file "main.o" was created. If you try to create the executable ($ gcc main.o) an error will occur because the function could not be found
Now create a file called "lain.c" and type:
int hello_lain() {
return 0;
} Compile with: $ gcc -c lain.c
Link with: $gcc lain.o main.o
Success! Now the linker know the address of function
But this creates some problems, as we (programmers and compilers) know how many arguments the "hello_lain" function has?
Modify the "lain.c" code to:
int hello_lain(int var1, float var2, char var3) {
return 0;
} And the "main.c" to:
int main() {
hello_lain("I_am_string");
} Compile with:
$ gcc -c main.c
$ gcc -c lain.c
$ gcc main.o lain.o
Success!
The compiler does not imagine that there is an error because it has no way of knowing. For this the function declaration was invented.
You just say how a function should receive arguments and what it should return before using it. No code of function, just how it '''expects''' to be called.
Change "main.c" to:
int hello_lain(int var1, float var2, char var3);
int main() {
hello_lain("I_am_string");
}
Now the compiler know how many arguments, what types, and what kind of variable should be returned by this function. Try compile and see the errors.
The body of function still in "lain.c", but you can put it in the end of "main.c" or in a "DLL", no matter where, what matters is that it is found at linker time.
The funny thing is that this declaration is only a "help" to the compiler, you can still have the body the function with another type of return and other amounts of variables and the linker will still work. Try change paramtes of "lain.c" and compile with success.
>More text below
Mentat · 2019-06-20 01:22
>>13977
Now we can talk about the header file.
Imagine that whenever you use a function you want to call the declaration, if you have 10 different files you enter the same code 10 times. The include directive literally copies and pastes the contents of the desired file where it was called, so instead of always copying the same code, you can put them into a file and just type "#include my_file.h" and the compiler does copy and paste for you.
There is no secret inside a header file, is just a list of how the functions should be and some #defines.
To program for Windows, and use Windows GUI functions for example, you just type #include <windows.h> and all the hundreds of defines and hundreds of functions will be available to be checked in compile time. At the linking time your code will be linked to the system DLLs like "gdi32.dll", "kernel32.dll", "user32.dll", where the actual address of real functions are.
The diference between
#include <file.h> and
#include "file.h" is that with <> you are calling the system headers and with " ", headers with their functions that you have created for the current project.
Naomi Nascimento · 2019-06-20 02:17
>>13961
I don't think this deserves its own thread so i'll ask it here.
I'm trying to devise a typing system for a language, but I'm struggling with how to go about implementing polymorphism.
I thought of using 'reference type' like the `Any` type, which can be substituted by the type of the argument provided throughout the code. It works but there's a situation that makes me unsure:
Suppose i define a function like so:
f(a T, b U): T, U
In this case, if i use `Any` for variables a and b then the compiler would have no way (or a very difficult way) of being able to substitute where necessary for all T's and U's, and thus might lead to a problem where a and b are the same type despite being provided different types on function call, or some other undesirable behaviour.
Do i have to use meta programming concepts to solve this? How? Is there a different way? Am i missing something? How do other languages handle this problem? I'm trying to take this one step at a time so for now wpolymorphism only refers to generics.
Undisclosed · 2019-06-20 02:55
My question is it possible for me to be a programmer with a math major. I have a bachelor degree in math, but I think of becoming a programmer. The only language I know is well is Java because I took elective of it in school. The only issue for me is that to be a programmer and find a job you need to know so many languages like c++.
How can I get a job as programmer quickly like within six months?
What type of coding could I do with a math major I am not sure what to focus on.
Six · 2019-06-20 03:01
My other question is what is the difference between data analyst and programmer and what would be better one for a math major.
I think a data analyst does statistics and does not need to know how to code only how to use commands on certain software.
While a programmer develops software using languages and has to know things like memory allocation.
Zero Cool · 2019-06-20 03:45
>>13983
>within six months
learn web development.
>math major
functional paradigms will be familiar
>>13984
data scientist probably, i think it has a lot of statistics in it. You will still need to know how to program in that case in which case i recommend that you pick up some python and ruby.
Meddler · 2019-06-20 09:58
I just started including doc strings in my functions to *experiment* with writing inline documentation. Do you think there are better ways to do it?
void *
malloc_or_fail(size_t size)
/*
* Our test cases usually can't continue without a properly allocated
* structure.
*/
{
void *ptr = malloc(size);
if (ptr == NULL) {
fprintf(stderr, "ALLOCATION FAILED (rerun?)\n");
exit(1);
}
return ptr;
}
Batou · 2019-06-20 11:25
>>13988
put it before the function
Chani · 2019-06-20 14:02
Do I need to back up the code and make a system that takes that backup and overwrites the code if the user causes an error in it? I did this in a script but now I am in doubt if I really need it.
Agent Smith · 2019-06-20 19:31
I just thought of something. When you create an account for a website, you have to input a password and since common security sense says the password itself should never be stored on the back-end, I'd assume the front-end does the hashing and sends that.
However, most websites will have password policies, but since the password isn't sent (regardless of through plaintext or SSL'd), then the policies can only be checked through the front-end. So if I just make a POST to the account creation endpoint, it bypasses that policy checking and I could have an account with password "a" right?
Mitnick · 2019-06-20 19:34
>>13989
>>13988
Yes, agreed. Some IDE's (VS Code comes to mind) expect the doctsring to occur after the header, but I personally believe it makes a lot more sense to have it before the header. The header is part of the function and the docstring explains it, it makes no sense to have arg declaration, then a huge comment block, then code.
t · 2019-06-20 21:22
All i have is a physical copy of little schemer. How can i mqke ASCII game
Agent Jones · 2019-06-20 22:41
>>13994
https://www.gnu.org/software/guile/
https://www.gnu.org/software/guile-ncurses/
dup · 2019-06-20 23:18
>>13961
How do i think like a better programmer?
I can't seem to figure out how to print a triangle like:
*
***
***** my original thought process was to use so math like:
1. add white space
2. add stars
3. subtract white space and add stars
Project 2501 · 2019-06-21 00:40
>>13996
(A) To draw a triangle of k levels, draw an offset triangle of k levels and offset 0. To draw an offset triangle of 1 level and offset q, place q spaces and a star. To draw an offset triangle of k+1 levels and offset q, draw an offset triangle of k levels and offset q+1, then place 2k+1 stars.
(B) To draw a triangle of k levels, draw a block with count 1, limit k, offset k-1 and stars 1. To draw a block with count>limit, do nothing. Otherwise, draw 'offset' spaces and 'stars' stars, then increase count by 1, decrease offset by 1, increase stars by 2 and draw a block.
Zuse · 2019-06-21 19:07
>>13996
Try to make a flowchart that represents what you want to program, maybe it helps.
Donna Hawthorne · 2019-06-22 01:16
which syntax should i use for a for-loop?
I'm at a loss as to how to construct for loops in a way that is not as verbose as in C/Java, but still manages to be intuitive to read and write.
Here's the ideas i have so far, implementation may vary:
for i in beg..end (+/-inc), cond { }
for i in [beg, inc..end], cond { }
for i = beg..end (+/-inc), cond { }
for i = [beg, inc..end], cond { }
for var i = beg..end (+/-inc), cond { }
for var i = [beg, inc..end], cond { }
John Rain · 2019-06-22 01:18
>>14003
Thanks anon, I'll try that.
Naomi Nascimento · 2019-06-24 18:18
>>13995
Thabks anon. I hope to learn to program. Ive never heard of guile. I hope i will be smart enough
Six · 2019-06-25 01:15
Does python have a way of getting a tag with a specific particularity using BeautifulSoup? (get a tag that has an HREF and a target, for example)
pop · 2019-06-25 10:02
>>14016
https://www.crummy.com/software/BeautifulSoup/bs4/doc/#a-function
def accept (tag):
return tag.has_attr ('href') and tag.has_attr ('target')
for tag in soup.find_all (accept):
# process tag
vector · 2019-06-25 14:38
Can i study to become webdev and reverse engineer at the same time? I wanna get quick bux and get a hold of what programming is but i dont wanna get stuck there forever, i also wanna learn how computers really work but i dont wanna wait till I get good at webdev to start with the other, my question is, can both of these be tackled simultaneously?
Yu-ichi · 2019-06-25 20:48
>>14017
Thanks.
>>14019
I have this problem too. I did a brief research on the subject (referring to language sites) and saw that it is not indicated because it would not be productive and you would have to memorize many similar words and rules, while another speaks depending on the method you are going to use, but I believe depends on the person's concentration.
John Rain · 2019-06-26 01:39
Im learning C with zero previous experience with any programming before. Im currently using the book "Sams teach it yourself C programming". My OS is Linux mint 19.1 cinnamon and im using Sublime as my text editor.
One of the beginner code strings has me type out this piece of code and asks me what the program does after I compile it, however, when I build it in Sublime, all that occurs is after building it, it gives me zero errors, but nothing comes up on the bottom to show that anything happened. Sorry if this is a stupid question but im very interested in learning how to program.
The code in question:
#include <stdio.h>
int radius, area;
int main( void )
{
printf( "Enter radius (i.e. 10): " );
scanf( "%d", &radius );
area = (int) (3.14159 * radius * radius);
printf( "\n\nArea = %d\n", area );
return 0;
}
Thank you if you can help me.
Turing · 2019-06-26 03:54
>>14024
try compiling it with gcc in terminal (it should print "Enter radius (i.e. 10): ")
Meddler · 2019-06-26 04:56
>>14025
Thank you!
Should I just use the Linux terminal for compiling or stick to Sublime for the future?
Case · 2019-06-26 08:30
>>13961
where to learn daaper/visual studio/asp.net/c#?
any advise?
Anonymous · 2019-06-27 00:37
>>14026
Assuming you prefer convenience and editing in sublime, look to repair your broken build system. If not, then just use the terminal.
dup · 2019-06-27 00:42
>>14031
>>14026
something like:
{
"cmd" : ["gcc $file_name -o ${file_base_name} && ./${file_base_name}"],
"selector" : "source.c",
"shell": true,
"working_dir" : "$file_path"
} in a '.sublime-build' file
Emmanuel · 2019-06-27 01:28
Should i add register and other keywords to function input arguments or is this just noise?
c
void
function( register type often_used, type used_some, type* restrict used_locally_only)
Delilah · 2019-06-27 23:25
>>14004
Take a look at how Ada does it; here's an example that loops through the Natural numbers bound to I:
for I in Natural'First .. Natural'Last loop
...
end loop;
You can also have a plain loop without an ending condition, use the exit keyword to leave it, use exit when as a leave test, have a while test loop, and also loops that use types and whatnot for the bound values.
>I'm at a loss as to how to construct for loops in a way that is not as verbose as in C/Java, but still manages to be intuitive to read and write.
I don't find curly braces intuitive, unless you mean resembling C.
Anyway, Ada loops are something to consider.
Molly Millions · 2019-06-28 00:05
>>14042
Out of curiosity, what does Ada do when you add 1 to that Natural'Last?
Incognito · 2019-06-28 04:05
Do you guys know of any intro to programming book that you recommend that uses a popular programming language that isn't Python?
I found a cool site with tons of resources that recommended to read SICP, but also said that if you found that one too hard you could read another book that looked really good except that it used some language that I'd never heard of before.
So, basically, I'm looking for a book that explains all the core concepts about programming.
Please, Lainons.
Trinity · 2019-06-28 06:18
>>14051
I'm not sure it fits your "uses a popular language" check, but IIRC How To Design Programs is often recommended as an SICP alternative. It's even available as an online version free legally; https://www.htdp.org/2019-02-24/index.html
Davis · 2019-06-28 07:49
>>14053
HTDP is good, I found it really useful even after studying sicp.
Otto Normalverbraucher · 2019-06-28 10:31
>>14051
this >>14053 to be honest. been very dumb a few months (haven't stepped to college, no solid math background), tried lurking here and lainons recommended HtDP and SICP. although I didn't finished reading both books (I got bored and found my first web dev job), it gives me a solid intuition on programming. also Racket/Scheme is a cool language if you want to solve/play with coding problems online. goodluck to us!
HELIOS · 2019-06-29 16:43
>>14051
To correct >>14055 a bit, HTDP doesn't actually use Racket, but smaller languages implemented in it and lending some things from it.
Would recommend reading the section of why they do this ( https://www.htdp.org/2019-02-24/part_preface.html#%28part._drtl%29 ). Myself I wholeheartedly agree with their reasoning, a big reason as to why I always gave up on learning programming the first times around were because it never felt like I was actually learning programming, which in retrospect was because I was trying to learn C++ because that's what the big boys use, and more than half the material is learning the specifics of the language rather than actual problem solving.
Iverson · 2019-06-29 20:23
>>14044
>Out of curiosity, what does Ada do when you add 1 to that Natural'Last?
The type Natural is a subtype of Integer defined thus:
subtype Natural is Integer range 0 .. Integer'Last;
The Integer type isn't a modular type, so you get an exception of Constraint_Error upon overflow.
() · 2019-06-29 22:36
>>14064
Thanks. So, in effect, Natural seems to contain an element where the successor function is not defined. Peano would not approve.
synchronized · 2019-06-30 02:10
>>14070
>So, in effect, Natural seems to contain an element where the successor function is not defined. Peano would not approve.
Just as First and Last are attributes, so are Pred and Succ for the predecessor and successor, respectively. Since Natural is a subtype, Natural'First does have a predecessor, negative one. However, yes, neither Integer'Last nor Natural'Last have a successor, by definition.
If you don't want this behavior, you can use a modular type, where there's wrapping behavior:
type Wrap is mod Integer'Last;
Now you have a type where Wrap'Succ on the last value wraps back to zero.
over · 2019-06-30 03:08
>>14072
>you can use a modular type
>Now you have a type where Wrap'Succ on the last value wraps back to zero.
But then the monoid generated by 1 is no longer free if Last+1==0. And inequalities are no longer preserved by applying successor, since this can be violated:
a<=b -> a+1<=b+1
Bobby Newmark · 2019-06-30 05:26
>>14042
thanks for the response. So for i in [first, inc..last], cond { } right?
>unless you mean resembling C.
sorry i meant that.
I want to see if a can write a C-inspired language that manages to be a true descendent of C which takes inspiration from the functional paradigm. Hopefully it turns out to be an okay or good language.
If you want i can show some syntax of what i have so far?
Debbie Charteris · 2019-06-30 09:33
>>14076
Such Ada loops don't have an increment, no. Here's a resource for this information:
https://www.adaic.org/resources/add_content/standards/05rm/html/RM-5-5.html
>I want to see if a can write a C-inspired language that manages to be a true descendent of C which takes inspiration from the functional paradigm. Hopefully it turns out to be an okay or good language.
Good luck.
>If you want i can show some syntax of what i have so far?
Sure.
Debbie Charteris · 2019-07-01 02:57
>>14077
>Here's a resource for this information...
Thanks! The more languages i know the more good ideas i know to follow and the more bad ideas i know to avoid.
>Good luck.
Thanks again.
>Sure
Here is a primitive example, the language is still in progress so i encourage you to share your thoughts on my design choices, there's certainly a lot to be improved on.
let curry: (a: Int) -> Int
return let b -> a + b;
let printlist: (list: Int[]) -> None
{
for i,e in list
{
println("i: {}, e: {}", i, e);
}
}
// takes nothing, returns nothing
let main:
{
val list: Int[10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var add10 = curry(10);
printlist(map(let e -> add10(e), list));
}
Cat Mother · 2019-07-02 07:31
For a codebase I'm working on, I was tasked with adding support for Google's protocol buffers.
Specifically, because they allow serialization to an output stream.
I have a very small program, but when I run it, it gives me a large amount of linker errors. Is there anything I'm doing wrong here? If I understand PB's correctly, then it should simply serialize my datatype as an empty string (or close enough).
Additionally, how do I make sure I have the "SerializeToString" function? I couldn't find it in the "protobuffer.h"
word · 2019-07-03 00:07
>>14108
Okay. I was able to run the protobuffer stuff on a Unix system, but now my task is to run it on Windows 7.
To run it on my Unix machine, all I had to do was tell it where the library files were:
g++ -std=c++14 -L/usr/local/lib -lprotobuf ProtoTest/data_revised.pb.cc ProtoTest/main.cc
However, I'm not having as much luck on Windows. This is the guide I'm following: https://github.com/protocolbuffers/protobuf/blob/master/cmake/README.md
I was able to get through most of this process without too much of a hassle, and now in my Desktop, I have two folders:
include , which has the lib and include folders I need for my code to run
ProtoTest , which has the program I want to run.
However, whenever I compile it with this command under Cygwin:
g++ -std=c++14 -L/cygdrive/c/Users/solarcar/Desktop/install/lib/ -lprotobuf -I/cygdrive/c/Users/solarcar/Desktop/install/include ProtoTest/data_revised.pb.cc ProtoTest/main.cc I get errors up the wazoo. I'm not really sure what's the issue here, but I've attached a copy+paste of what I'm seeing:
https://pastebin.com/ci6qhPpB
Many thanks!
Lord Nikon · 2019-07-03 03:00
>>14113
Have a try with -std=c++11.
https://github.com/protocolbuffers/protobuf/issues/5796
Neuromancer · 2019-07-03 15:08
>>14114
It was a really stupid issue.
Apparently, you need -l protobuf at the END of the compilation.
I'm not entirely sure why a command that would work on one version of gcc wouldn't work on another, but whatever. We've given up on using C++ protocol buffers for our embedded codebase (We're now using nanopb, which is a C implementation of protocol buffers).
SHODAN · 2019-07-03 15:24
What are my options after I get a CS degree?
Idk what I'm interested in to be honest. Something future proof and comfy would be nice. So if you get the hang of it it becomes comfy after a while.
byte · 2019-07-04 01:02
I've just learned about text streams (stdin, stdout, stderr) for unix systems and i quickly want to know: aren't text streams a security vulnerability?
Hong, Guil Dong · 2019-07-04 06:58
>>14119
In the sense that anything is, yes, but usually not, since streams should only be accessable to the two communicating processes.
Trinity · 2019-07-04 07:50
>>14117
Depends on what do you mean by comfy? Are you OK with learning new things? Are you OK with working on legacy code?
Python programming - it's used everywhere, literly everywhere. You can do backend development, machine learning, admin scripts...
JavaScript - the market for JavaScript programmers is huge, but each month there is some new framework that you just need to learn because it is said to be the next great thing
C/C++ - with the rise of IoT this will not go away anytime soon, so its a safe place to be but it might not give you many opportunities to change your work enviroment (in a sens that the next company making something in C++ will probably do something similar to the previous company). Also projects in C/C++ tend to be those old legacy projects that stay alive for decades.
Switch · 2019-07-05 00:36
How do I git good like this guy
https://www.youtube.com/watch?v=7Hlb8YX2-W8
cond · 2019-07-05 21:19
I want to create a database that will load and save string hash tables in a non-volatile way. Is there a filetype that exists for this type of thing or should I just use CSVs?
stack · 2019-07-06 10:59
>>14139
https://sqlite.org/index.html
Crash Override · 2019-07-08 02:49
>>13961
I remember watching a video about a language where the keywords they included in the language was influenced by double-blind studies. For example, they would run a test as to which word in place of "for" for a for-loop would do the best in terms of people who have never programmed before and people who had a moderate amount of programming experience.
I don't really remember any other features of the language, other than its design was essentially "designed by randomized trials."
Would anyone happen to know what language this is and/or where the talk was? I'd greatly appreciate it!
Acid Burn · 2019-07-08 19:11
>>14170
I did some googlefu for you.
https://quorumlanguage.com/evidence.html seems like it describes the study you described, and they had a nice and handy reference for the paper, and searching for the paper title on youtube gave this:
Neil Brown - Programming Language Design: The Missing Evidence
https://www.youtube.com/watch?v=k7BWqz0FKZ0
Might this be it?
array · 2019-07-09 15:03
>>14172
This is what I was looking for. Thank you very much!
limited · 2019-07-09 21:00
What tools or what IDE do you guys use to work in C?
For I while I been using notepad++, compile in cygwin and use quincy 2005 to debug. A couple of weeks ago a program I was working in made the quincy debugger crash so I told my self "it's time to use something more professional" so I went with code blocks.
Getting code blocks to work was incredibly cumbersome and finally when I get to the debugger I just don't like it. I'm used to go line by line and to watch the variables, code blocks can do this but I can't seem to find how and there are few resources out there.
Now I want to try something different, what does lain recommend?
Hagbard Celine · 2019-07-09 22:10
>>14180
Try eclipse
FILLER · 2019-07-09 22:12
>>14180
I recommend giving https://sanctum.geek.nz/arabesque/series/unix-as-ide/ a read. To make this clear, I'm not trolling. The terminal gives unprecedented freedom, the only limiting factor being you. Not entirely true, but an IDE cages you in a limited box of possibilities, in accordance with the envisioned features of an IDE.
For my workflow, I have a couple of Makefile templates, as well as a script that automatically generates generic Makefiles for me (along the lines of automk -ntest c -s -lmath > Makefile for a program test.c linked against math.h with suckless build flags). As the project grows, the Makefiles tend to too. That's for convenient builds or testing routines, make is convenient after all.
For sporadic file editing, any file browser does. Personally I use rover configured to open files in my text editor in a new term. People seem to to use vim 's built in file browser or something along the lines within emacs for this purpose, but the editor I use doesn't have that. For the editor, I just go with vis , what I am most comfortable with. It's stupidly easy to do anything with, turns out the sam like features are incredibly useful too, and it works literally everywhere, anytime. Upon exiting, the term that popped up with the code also closes, which is part of the comfy workflow.
These were just basics, editing, browsing, compiling, but the true potential lies elsewhere. Ever needed to feed input to a program via stdin? You wouldn't want to type it every time, and the infrastructure to read from some file is bothersome too. In that case: make && cat some_input | ./my_binary
Need to mass replace text (classic refactor) within a file? Editor does that. Mass replace across multiple files? sed. Search terms within a complicated file structure? A handy script searches occurances and lists each occurance's source file with line numbers: find . -type f | xargs grep -n -e "$*"; . Not perfect, but easy enough to come up with when in need. Don't get me started on the handyness of general coreutils like find, grep, awk.
Easy enough to do git stuff too. Easy enough to do diff stuff. For focused debugging, gdb is honestly amazing. Peek at your program's syscalls? strace. Want to find memory leaks? valgrind.
My point being, it can be fascinatingly productive just toying with these lesser utilities, and they can be chained together interactively to create powerful solutions, making it much easier for you to get the information you need to develop. It is somehow profound what this workflow, once learned and adapted for actual, regular use, is able to achieve. I don't believe any IDE recreates that. I don't mean to say that IDEs have an inherent lesser potential for productivity, of course you could also just learn all quirks with any IDE you want to be productive with. If I had to guess however, the mere fact you posed this question probably means you tried a few, and there was something off with each, making you wonder which "gets it right". With this approach, you can just make it right.
Just my 2 cents, I like working this way. There is the added benefit of learning to use all these utilities, which can be useful in other ways.
H.R. Giger · 2019-07-10 02:39
>>14180
easy but restricted mode: vscode or >>14182
'hard' but godlike mode: >>14183
quote · 2019-07-10 05:03
I'm relearning the whole Akka toolkit and I'm wondering if any of you have any good project ideas to build with the library.
word · 2019-07-10 05:09
>>14187
Getting comfortable working around the terminal is a huge benefit, there's a big learning curve but once you get over it; It's a matter of laziness if you're not productive enough lol