shoya's blog

By shoya, history, 20 months ago, In English

Which IDE/Editor do you use and what do you like about it? How do you test for sample tests of the problem fast? Do you use terminal during contest? Also how do you debug your code during contest? Do you use IDE Debugger or debug manually?

 
 
 
 
  • Vote: I like it
  • +7
  • Vote: I do not like it

»
20 months ago, # |
  Vote: I like it -9 Vote: I do not like it

Usually, I write my code on Sublime text (it has some interesting features), then run it on a local IDE (Code::Blocks for C++), or an online IDE(like C++ shell, but it's not really practical, since you can't copy/paste input from contest to IDE). I still use this method during contests that take place on other platforms.However, onn CodeForces, I use the Custom Test machine that is provided in the contest. Actually, it is pretty fine, and even if it's not as visually comfortable as Sublime Text, it is good, and, being an IDE, it avoids me some drawbacks of Sublime Text which is just an Editor. It's also pretty fast, compared to other online IDEs such as CodeChef's and AtCoder's (Based on personnal experience). Moral of the story, I advise using the Custom Test of CodeForces. If you don't like it, I advise downloading Sublime Text and/or an IDE to compile and run your code. I hoped my advice was helpful. Happy coding!

  • »
    »
    20 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Why don't you run you code on Sublime text only, I compile and test it on sublime itself.

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      How do you debug? Is there a way to use gdb on sublime?

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Any idea for how to add user defined flag, i always use ifndef online_judge how to add ifdef myflag?

      • »
        »
        »
        »
        20 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        use -DMY_FLAG argument during compiling. This will enable you to use #ifdef MY_FLAG

        • »
          »
          »
          »
          »
          20 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I meant how to put the flag in builds in sublime text, i tried it didn't work out.

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I think the Custom Invocation will be slow due to server load during a contest.

    • »
      »
      »
      10 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I used Custom Invocation regularly. At the beginning of a contest, you will have a hard time using Custom Invocation. I use Ideone when it is slow. After 20 — 30 mins you will have a faster Custom Invocation. In fact, recently Custom Invocation is decently fast from the very start of a contest.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use vscode(prefer the layout) and run it in the terminal. Pretty easy and straightforward. :)

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use only SublimeText on Linux. Before switching I was on Code::Blocks and Windows. Major drawback on previous setup for me was: you couldn't compile/run another code before closing cmd. It isn't issue for me now (and compilation on linux is faster)

»
20 months ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Before : Windows + Code::Blocks + Hightail

Currently : Linux + Sublime text 3 + (Hightail || Sublime Input method as a comment)

»
20 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I write code in Dev c++ and run it on hackerrank

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use VIM with some modifications so that F5 is compile and run. That way I barely need to exit to type commands in the terminal (I can never remember them).

Also wrote a script to open vim and all the relevant input files so I don't have to do it myself.

For sample test I just paste it to a text file and run the program (you can use preprocessor stuff so that your code reads in input from some text file).

  • »
    »
    20 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you share your .vimrc please?

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      It is very messy.

      But I basically copied and paste stuff from wherever I can find.

      The thing I was talking about is on line 91:

      map <F5> :<C-U>!g++ -Wall -Wextra -Wshadow -fsanitize=undefined -DLOCAL -O -std=c++17 % -o %:r && ./%:r <CR>
      

      This should let you compile and run C++17 files in Vim if you do F5 (with the LOCAL tag, you can also make a version without -DLOCAL). I didn't write this code, netman has it on here.

      • »
        »
        »
        »
        20 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thanks! :D I have been thinking of using vim lately. This will surely help!

  • »
    »
    20 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Did you switch from IDE to vim or you borned with vim? :(

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I was scared of Vim (before I was using Sublime Text). But I decided to switch and now it's feeling more natural.

      • »
        »
        »
        »
        20 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I don't like the fact that the cursor fills all of the word that we are in and also that we cannot move faster like I cannot go 30 lines fast ( Maybe there is fast method in vim)

        • »
          »
          »
          »
          »
          20 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Do you mean ctl-D and ctrl-U? Vim is very capable of doing anything you can think of (with the right setup), you just have to search for it.

          • »
            »
            »
            »
            »
            »
            20 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            sorry for a lot of questions bro.

            how did you install vim i do apt-get install vim but it says that it has independent packages and i also checked the file that I have the links to servers and changed them several times and I still cannot change it do you know why ( I have searched in google and tried all of the solutions on stack overflow)

»
20 months ago, # |
  Vote: I like it +21 Vote: I do not like it

sublime text and copy pasting test cases and manually writing compilation command to terminal

  • »
    »
    20 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This also gives you a lot of flexibility, you can stop compilation, stop running the code, and even clean up leftover files when program terminates abruptly. Another benefit is, switching to output redirection(>) into files is really easy, which can help with checking large outputs.

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Exactly! Redirect file input output from standard IO exe is also really easy and nice. Only downside is sometimes I end up copy pasting some code into the terminal instead of the test cases and suddenly like 50 junk files show up in the directory. (Actually I still haven’t found a satisfactory way to resolve this yet.)

»
20 months ago, # |
  Vote: I like it -14 Vote: I do not like it

Geeks for Geeks IDE...code and run online :)

  • »
    »
    20 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Explains your rating

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it +14 Vote: I do not like it

      Um... your ratings are pretty similar.

    • »
      »
      »
      20 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Is an IDE/Editor responsible for ratings...XD....u should rather improve yours buddy XD

      • »
        »
        »
        »
        20 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thank you for the encouragement sir I will work hard to improve my skill.

    • »
      »
      »
      10 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      What is the problem btw? Me and my friend Unpossible both use Geeks for Geeks IDE.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by shoya (previous revision, new revision, compare).

»
20 months ago, # |
  Vote: I like it +16 Vote: I do not like it

personally i like codeforces IDE ,here i can copy sample test and run it there , which is comfortable and saves time .

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use devc++ to write and compile my code.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

For Java, you could go with IntelliJ Idea(or Eclipse). IntelliJ has many good features for development too. Infact, I personally find it's debugger very useful. Besides, you can get all the Jetbrains product for free on a Student ID.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

www.codechef.com/ide or ubuntu gedit + terminal

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use Geany is simple, lightweight and it is easy to configure it to compile and run a C++ program in the terminal.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

codeblocks. easy 2 use.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use pen and paper , old fashioned style baby

»
20 months ago, # |
  Vote: I like it +18 Vote: I do not like it

I used to write code in Eclipse few years ago. I could install it for Windows and use it in World Finals. I'm not using Windows anymore neither Eclipse (it was total crap btw).

I started using vim, but it's not very easy, and for sure you will need several plugins and customization before feeling comfortable. Personally I found vimrc from misof very useful, and is the core of my current vimrc ( https://people.ksp.sk/~misof/programy/vimrc.html ). Note that I don't use vim for competitive programming anymore, but I use it for a lot of other things.

Then I start writing code on Sublime. Sublime is blazing fast and was all I needed in my slow computer to write code for competitive programming. It has very basic features, but if you feel comfortable writing code in your language, it is ok.

Finally I think vscode is my goto editor for competitive programming. It is very fast (not as fast as Sublime though) but has greater community and much more useful extensions and tooling.

I started to develop an extension for vscode to write code in competitive programming. You can install it from the marketplace. It is called acmX.

You can see a brief example of how to use it here: https://youtu.be/ouCU9xyW1i8

I created this Telegram group for the extension https://t.me/joinchat/FksZ0BSkGh7anvpFYisjMw.

»
20 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Sublime text 3 and Ubuntu terminal with auto-complete disabled in Sublime because it just adds std:: to everything during auto complete. I use the following aliases for running code.

Aliases

Here 00.cpp is my skeleton/template code for contest which consists of only 3 lines.

Apart from that I use my personal compiled bits/stdc++.h so that my C++ code compiles in blink of an eye because compiling original bits/stdc++.h still takes few more milliseconds even if pre-compiled for which I wrote a script before.

  • »
    »
    12 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hi, Can you tell the settings fro Sublime text3 and Ubuntu terminal. I new to it btw.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

On Ubuntu: Geany On Windows: Dev-C++

»
10 months ago, # |
  Vote: I like it -6 Vote: I do not like it

I write code in the Submit Code tab and press submit to compile. The samples are tested automatically by the tester.

»
10 months ago, # |
  Vote: I like it +1 Vote: I do not like it

I use far manager. It doesn't have that much special features except you can boast about tourist using it

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use ideone, obviously the most superior ide. ;)

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

use visual studio code ...... it's the best ..... it also supports vim....so you can actually have a vim extension on your vs code ...... the only problem with vs code is that it is a bit heavier than sublime...so unless you are using intel i3 or intel i5......it's better to use vs code

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use CLion on Mac.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I'll recommend u SUBLIME TEXT 3 , its the fastest text editor, with some great features of Snippets and auto-completions.It has separate input and output file system .it has great interface with DARK mode.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Since nobody mention cf-tool I do.

It is a great command line tool to download problems and whole contests with all testdata to the local system, compile/test/run and submit.

It perfectly fits to be used with vim as an editor.

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it
»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

use cp-editor ultra-fast and easy to use. CP-editor

  • »
    »
    7 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    has it auto complete feature?

    • »
      »
      »
      7 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No, but I would recommend you to use it once maybe you will like it.

      • »
        »
        »
        »
        7 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Can you plz tell how to enable the range based for loop in cp-editor or remove the std c++ 98 mode and get the new one

        • »
          »
          »
          »
          »
          7 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Range based is working in cp-editor.May be you have older version(i don't know).U can download new version from link i have given above.

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I use sublime text combined with xalanq's very useful cf-tool. Sublime for editing code, cf-tool for debugging and running locally.

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

In terms of an IDE, I run and debug my code on IntelliJ IDEA (Community Edition) because of the fact that it is free (just make sure not to use the "Ultimate Edition") and has a lot of useful features such as a good debugger where it kinda shows you the variable assignments without having to "look into them" and it just has a lot of "make-life-easier" tools. Some examples of those would include code simplification ideas, checking if a conditional will never be satisfied, finding infinite loops, and other things that are really annoying. To run my code, I don't use terminal because it is just easier in my opinion to use the console, with the expense of a little slower runtime.

I mainly debug my doing print statements and if things get bad enough, I also resort to the built in debugger. However, I usually do not like to use the build in debugger because it isn't really good at finding "logical" errors compared to simply using a bunch of print statements.

To test sample cases, I just copy-paste it into the console and run it on the IDE.

»
6 weeks ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

I created a plugin for this purpose. https://github.com/suraj-2306/cc_vim.git It opens up an input.txt and an output.txt along with the main .cpp file, in a split-screen config. By hitting F9, you can compile the code and execute it. The expected output is shown in the output.txt buffer while taking input from the input.txt buffer. It uses a custom makefile for compilation and execution of the code. It's pretty helpful if you're starting with cc in vim.ATB

»
6 weeks ago, # |
  Vote: I like it +15 Vote: I do not like it

I had to reinstall my setup recently so here's exactly how I have it:

install sublime

install some c++ compiler

change sublime compilation flags to use C++17 -O2 and some other compilation flags like -Wshadow

code with sublime, compile with ctrl+B, run on command line

So yeah, not much is needed.

»
6 weeks ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

CLion with JHelper.

--

Advantages: I have competitive companion, which parses the test input/output and sends it to JHelper. It's nice I don't have to copy paste the input and so on.

CLion has a bunch of useful stuff. It has a debugger, but I don't use it that much >.< ... it also has a bunch of other features I don't know how to use :P

--

I don't use terminal, although I used to use alacritty + vim.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i am a beginner & want to use vim on mac. did u use alacritty & vim on mac? if then, plz help me to do it altogether.. thanks in advance!