Details
-
AboutT420 + Arch + i3 + vim Terminal Junkie Favorite Imperative Language: • C++ Favorite Functional Languages: • Haskell • Common Lisp
-
SkillsHaskell, Common Lisp, Java, Swift, Objective-C, C++, C, Solidity, Arm v7 Assembly, Bash, VimScript, Python, GNU/Linux
Joined devRant on 10/26/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
@404response once you are comfortable with the editor I recommend reading: http://learnvimscriptthehardway.stevelosh.com/...
(free online version). It will give you a very in depth understanding of the language that the editor is built around.
Don't worry about customizing your vimrc. In the beginning don't install many feature adding plugins as vim itself can already be overwhelming.
If you want a feature, try to write some of the functionality yourself (often times it's not that hard to do).
Over time your vimrc will become monolithic, but it only becomes unmaintainable if you put other people's vimscript in it.
Some tips for a new user:
* Become comfortable with hjkl
* Make it a habit to jump back into normal mode when you finish typing
* Learn to touch type if you can't do so already
All that being said, here are the vimrc tricks I blindly started out with:
" Vim won't try to be Vi
set nocompatible
" Nice built in indentation plugin
filetype plugin indent on
" Disable arrow keys in normal mode and insert mode.
" This is an awesome habit breaker!
inoremap <Up> <nop>
nnoremap <Up> <nop>
inoremap <Down> <nop>
nnoremap <Down> <nop>
inoremap <Right> <nop>
nnoremap <Right> <nop>
inoremap <Left> <nop>
nnoremap <Left> <nop>
" Enable soft tabs
set shiftwidth=4
set tabstop=4
set expandtab
" Enable line numbering relative to current line (helps with navigation).
set number
set relativenumber
" === End of vimrc ===
Stack exchange has a vim site and there is a built in manual (:help) as well.
Vim is all about habit, the longer you use it the easier it gets.
Cheers.
Edit:
vimperator is a great addon for Firefox
vimperatorrc recommendation:
set gui=none
noremap j 3j
noremap k 3k -
http://dangermouse.net/esoteric/...
-
Gnu/Linux is my integrated development environment. Vim is just what I use to edit source code.
Also vim is pretty easy to use as well as powerful once you become accustomed to it. Not hard to learn, it just takes more time than most editors. -
Keep your indentation consistent.
-
@GodHatesMe One word, c#. Haha, just kidding! :D
-
@b3b3 There actually is a c--, but it's called B. Uncle once wrote in it when he worked on old IBM mainframes lmao
-
@JoshBent Thanks! Now I can automate all the things!
-
@Froot JS will die when web assembly becomes mainstream. Won't happen fast, but it will definitely happen.
Then we can avoid that whole compile to js mess. -
@Hastouki How are they different?
I was under the impression that they are pretty much indentical in all but the syntax actual for defining classes in either language.
From what I have used c++ anonymous inner classes for, I haven't seen a difference.
Genuinely curious now. -
@bdhobare I'm in the same boat haha! Good ranting w/ you. Cheers.
-
@Hastouki Nice try, but c++ has anonymous class! And multiple inheritance is useful in many situations.
-
@bdhobare I mean, you can achieve the same functionality in every language, but I was just pointing out that Java is missing a couple nice features. Anyway, to each his own.
What assembly language do you know? Arm v7 Assembly over here! :D -
@bdhobare Java is the first language I ever mastered, it is what got me interested in programming. By no means do I hate it! But at the end of the day it lacks many features that other languages have by default.
-
@bdhobare First off, there is no static variables for functions in java. Static variables in funtions are variables that persist for the duration of the program within the scope of the function. Static only works on member functions or variables in java. You obviously don't program much in c++ or you would understand what static funtion variable meant.
Comparing auto to Object is laughable. Auto is used for type interface, which means it acts like you wrote the full type out by hand. This is so much better than using Object as you don't have to cast it every time you want to call a method.
ASM interface is useful to have if you want to do some serious optimization, I use it when I program microcontrollers.
You say the primitive wrapper classes can be passed by reference, but in java they cannot be reassigned a value as primitive objects are immutable. With the reference operator in C++ you can actually reassign values (like a swap function).
Just to be clear, my list above is very incomplete. There are many more features that just don't exist in java that make c++ a fun language to work in. Don't make the argument that I don't understand java when you barely understood the features I was talking about. -
@xico Objective-C looks scary, but that's just because it is so different from other languages! Once you understand the basics and get over the tiny quirks it really is a great language! :D enjoy it!
-
@Linux It really is a great book! Also my go-to reference whenever I am lost.
-
@Hastouki I would argue that Java is lacking many good features such as:
• Generics with primitive values
• Operator definitions in classes
• passing functions as pointers (rather than an anonymous inner class or a lambda assigned to a functional interface)
• primitive references
• auto
• compile time if statements
• macros
• lambda variable capture
• static function variables
• Multiple inheritance
• Structs
• Bitfields
• ASM interface (from c)
• typedef
• etc
I guess garbage collection would be nice though (but smart pointers make life easier)...and I really wish c++ had reflection! -
@Hastouki What statement are you referring to? I have said that Java is seriously restrictive and that Java doesn't get many language level additions like C++ does (and most modern languages for that matter).
What major changes has java (the language, not the java standard library) undergone that I haven't mentioned already?
Also, c++17 is awesome! :D -
Have you used Solidity on the Ethereum platform?
-
++ for ancient alien technology
(I am running into you everywhere today lol) -
@AleCx04 Yup, I agree that the JVM ecosystem is great. I just don't personally like the language as I think it is seriously restrictive.
-
@AL1L The module system?
-
@AleCx04 An argument against Java based on preformance is not a very good one nowadays. The JVM is amazing (and JIT is lightning fast), but Java specifically is not the nicest language in the world. I doubt Java will be used in anything other than legacy here in 10 years, but the JVM ecosystem will thrive for a long time to come for sure.
-
@AleCx04 Swift feels strangely inconsistent to me. Everything just feels off and I don't know why.
Glad I'm not alone on this! :D -
This book covers pretty much everything a linux sys admin needs to know.
I highly recommend you read it if you want to learn the Gnu/Linux system inside and out. -
@Electrux Fair enough. :D
-
Have you open sourced the project yet?
-
@just-basic-user how come?
-
@ocalderon I believe so, about every 3 years a new c++ standard comes out and we get cool new language features!
c++ also adds new syntatic sugar to the language regularly (as opposed to just getting new library features every release).
The biggest change Java has made in years was the addition of Lambda expressions in java 8 and the ability to not write generic type information inside the angle brackets on the right side of the assignment operator in java 7. -
@Torbuntu I use them at work. Personally I prefer to use either C++ or Haskell.